- Home /
Unity 4.6 and Grabpass fails
I am using Unity 4.6 and the GrabPass feature and I would like to know if it's possible to use GrabPass ans Opaque RenderType because it doesn't seem to work....
GrabPass
{ "_Grab" }
Tags { "Queue" = "Geometry" "RenderType" = "Opaque" }
LOD 400
CGPROGRAM
#pragma target 3.0
#pragma surface surface Lighting fullforwardshadows
(...)
When adding the opaque RenderType, the shadows are available but the GrabPass not... when removing the RenderType, the GrabPass appears as a silhouette and I want to mask it.
Is it possible to use masked GrabPass and shadows in deferred rendering ? Thanks a lot !
Answer by Eno-Khaon · Jun 12, 2015 at 06:42 AM
Have you tried moving the Queue to a later point in the rendering process?
"Queue" = "Geometry+1"
might be enough to keep the object technically opaque and not wait too long before rendering it into the scene.
Thank you for the answer but this issue is more linked with the "RenderType" = "Opaque" parameter.
Hmm... I suppose there could've been a change in that functionality between Unity 4 and 5...
Let's see, then... From the perspective of Unity 5, at least, I'm not managing to encounter any problems using any RenderType. From what I can tell, they usually appear to have little use on their own. That said, if there are differences related to RenderType tags when using Surface shaders, that would be different.
As far as the Queue is concerned, Geometry timeframes appear to result in lighting and coloring being incomplete (again, in Unity 5's standard shader in this case in deferred rendering - forward has color data built by this point) and shadows haven't yet been generated. With the Queue pushed up to a $$anonymous$$imum of Geometry+501, shadows and lighting have now been generated on the objects, therefore the general calculations compounded on the Geometry timeframe occur at +500.