Search Unity

Screen-space GrabPass filter without Camera?

Discussion in 'Shaders' started by Deleted User, Apr 26, 2017.

  1. Deleted User

    Deleted User

    Guest

    I have a pass in my custom shader which reads a GrabPass texture and I want it to modify the entire GrabTexture (the whole screen) and then I want to have another GrabPass to grab the result of that to be used in the following pass, but like a normal mesh shader on the actual mesh vertices and pixels.

    The problem is if I use a regular vert function which uses the mesh vertices then I can only modify the pixels of the first GrabTexture that are inside the mesh silhouette. What I think I need is that special pass to draw to a fullscreen quad but I don't know how to write a vert function which would basically ignore the real mesh for that one pass and draw a quad.

    Is this possible? Or is there some other workaround? I want to avoid using a RenderTexture and a Camera script because I need to cull meshes using certain shaders and the only other way I can think to do that is with assigning Layers for each GameObject with a MeshRenderer and thats very inconvenient.

    Thanks!