- Home /
What does the GrabPass capture?
Hello
I'm currently attempting to learn Shaderlab in Unity3D writing CG shaders.
I've come across the GrabPass that should, the way I understand, capture the scene without the object to which the shader is applied and provide the image as a texture in later passes.
However, I cannot seems to understand what exactly is caught in the pass. Is it everything the camera sees, but without the shaded object? is it a cubemap from around the object? is it only the mesh itself rendered as transparent?
Sorry if this is written clearly somewhere, I just ca't seem to find any resource on exactly what the pass does.
Thanks in advance : )
Answer by Aka_ToolBuddy · Feb 24, 2017 at 08:14 PM
It captures, as far as I know, what was rendered until that rendering step. You can use the Frame debugger and see each step of the rendering, it will make things easier to understand. https://docs.unity3d.com/Manual/FrameDebugger.html Keep in mind that if you name your grab pass, it will be updated only once a frame https://docs.unity3d.com/Manual/SL-GrabPass.html under the "Syntax" paragraph
Exactly. So if you use GrabPass in a skybox shader, there ain't gonna be much there. If it's in a transparent shader, you'll get all the objects drawn in the geometry queue before it.
Your answer
Follow this Question
Related Questions
Mobile shader: add an emission based on alpha blended texture 0 Answers
Shaderlab Multiple Texture Layers 0 Answers
Irregular shape window to a different background world? 0 Answers
Scene Depth Node, find depth value from x/y position of camera frame 1 Answer
Assigning UV Map to model at runtime 0 Answers