# How to port Unity shader to Unreal Engine material?

**URL:** <https://forums.unrealengine.com/t/how-to-port-unity-shader-to-unreal-engine-material/99899>\
**Category:** Rendering\
**Tags:** unreal-engine\
**Created:** [September 14, 2017, 7:26am UTC](https://forums.unrealengine.com/t/how-to-port-unity-shader-to-unreal-engine-material/99899 "2017-09-14T07:26:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SolarGT](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SolarGT](https://forums.unrealengine.com/u/SolarGT)\
**Post date:** [September 14, 2017, 7:26am UTC](https://forums.unrealengine.com/t/how-to-port-unity-shader-to-unreal-engine-material/99899/1 "2017-09-14T07:26:55Z")

</div>

I’m new to UE4 and not good at shader programming.  
But, I really want to port Unity shader to UE 4.

# There’s some shader code for Unity here :

inline float Linear01Depth( float z )  
{  
return 1.0 / (\_ZBufferParams.x \* z + \_ZBufferParams.y);  
}

# float2 pixelSize = 1.0 / \_ScreenParams.xy; float depth = Linear01Depth( tex2D( \_CameraDepthTexture, i.uv).r);

The problem is I don’t know how I can replace to UE4.  
So please, someone let me know how I replace these elements like \_ZBufferParams, \_ScreenParams, \_CameraDepthTexture in Unity to UE4 material?

Thanks.
