GrabPass and Queues

Hi there,

I have and object with a shader with two passes.

Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+1" }
GrabPass    {    }
Pass {  //Some stuff }

And then I have another one with a single pass with the following tags

Tags { "RenderType"="Opaque"  "Queue"="Geometry+10"}

On the second pass of the first shader, I do some stuff with the GrabPass Texture I just grabbed.
The problem is that the second object appears in the GrabPassTexture even though the GrabPass is supposed to grab the texture before the second object is drawn (at “Queue” = “Geometry+1”) The second renders after (at “Queue”=“Geometry+10”).

Any idea what might be going on?
Thanks!

I found out people having similar problems:

https://forum.unity3d.com/threads/i-want-to-use-grabpass-in-different-queues-or-how-to-use-a-grabpass-in-two-shaders.182905/

I have tried:

  • using a separate shader for the GrabPass
  • using “Queue” tags inside the GrabPass
  • using a different texture name for the GrabPass

All with the same result, GrabPass is always rendered at the end of the Geometry queue.

It seems GrabPass is always executed at the end of each main queue (Geometry, Transparent, etc…) but not in between Oo?

Is there anyone experiencing a similar behavior? or can someone from Unity confirm if that is the expected behavior?

Thanks!

The GrabPass can be excuted at specified renderqueue. look the the material of second one in debug mode to see the actual renderQueue of that material. if you’ve changed the shader of that material, the renderQueue may not equal what you write in shader