Search Unity

Someone helps me about some elements in Unity shader?

Discussion in 'Shaders' started by solargram, Sep 14, 2017.

  1. solargram

    solargram

    Joined:
    Apr 19, 2013
    Posts:
    2
    Hi. I'm a user using both Unity 5 and Unreal Engine 4 but not good at shader.
    I want to port a Unity shader to UE4 like below :

    ======================================
    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);
    =======================================

    Actually, I have no idea what these elements mean such as _ZBufferParams, _ScreenParams, _CameraDepthTexture and how to port them to UE4.

    So if you know about how to port them to UE4 or what they mean, please let me know.
    Thanks.