Search Unity

Creating a ClearMask-Texture

Discussion in 'Shaders' started by Marrt, Dec 12, 2012.

  1. Marrt

    Marrt

    Joined:
    Feb 7, 2012
    Posts:
    613
    Hi, i am very new to shader stuff and did my search but i couldn't find a solution to my problem anywhere else and i think this is doable with shaders:

    i need to copy the 'clearing', that a camera observes, to another camera.

    my idea was that if i could generate a monochrom "clear-texture" from the first camera and submit it to my 2nd camera it should do.
    -similar to this i guess:http://docs.unity3d.com/Documentation/ScriptReference/DepthTextureMode.DepthNormals.html?from=Camera

    -the second camera can not be in the same place as the first and i need the same pixels cleared, therefore just using the same masking procedure won't work

    Edit:
    I am Using this DepthMaskShader and SetRenderQueue for the masking
    http://wiki.unity3d.com/index.php?title=DepthMask
     
    Last edited: Dec 13, 2012