Search Unity

help needed: _CameraDepthTexture returns a blank image?

Discussion in 'Shaders' started by khoowaikeong, Jun 13, 2013.

  1. khoowaikeong

    khoowaikeong

    Joined:
    Jun 13, 2013
    Posts:
    18
    reference used:
    http://docs.unity3d.com/Documentation/Components/SL-CameraDepthTexture.html
    http://docs.unity3d.com/Documentation/Components/SL-DepthTextures.html

    using angrybot as a test case:

    in InitLevelManager i add to Start():
    Camera.main.depthTextureMode = DepthTextureMode.Depth;

    and proceed to use the "Render Depth" shader as in reference.
    modification to use float2 function instead as required in latest version.

    the rendered texture is white. what did I miss?

    I am trying to make a simple edge detector,
    the plan was to use a sobel operator on the depth buffer,
    thought it is simple and direct enough, guess not... derp.