Search Unity

Render Translucent Objects with RenderWithShader()

Discussion in 'Shaders' started by sebj, Aug 24, 2017.

  1. sebj

    sebj

    Joined:
    Dec 4, 2013
    Posts:
    70
    Hi,

    I want to use a replacement shader to draw the depth of all objects in the scene, including transparent objects.

    When I call RenderWithShader(), the UpdateDepthTexture/DepthPass.Job pass does not include the transparent objects.

    I believe this is due to the render queue settings from the material. If I manually change the material's render queue to 2000 on one such object, it renders fine.

    The material's setting is "From Shader", but even if I put "RenderQueue"="Geometry" in the replacement shader, it still doesn't work.

    How do I make the depth pass include these objects (without manually changing the render queue parameters back and forth)?