Acces to unity final pass shader (deferred)

hi there,

does anybody know if we have access to the final pass shader (deferred lighting) which combines albedo, lighting and emission?
and if so, how?

thanks, lars

I thought that was all in Internal-PrePassLighting.shader ?

just like its name might indicate it only writes lighting and shadows but it does not combine albedo, lighting and emission.

The final pass is a classic per object pass you define in a shader. To get it, simply read the compiled shader and find a pass named… I think it was LightPass Final?

Yeah, Unity uses a lighting pre pass technique, which has everything rendered first into a G-buffer and then again reading from the L-buffer to determine final colour.

I find the shadow pipeline pretty confusing.
I try to sort it out with AutoLight.cginc

SHADOWS_NATIVE ???
SHADOWS_OFF No shadows
SHADOWS_SCREEN ???
SHADOWS_DEPTH ???
SHADOWS_CUBE Point light shadows
SHADOWS_SOFT Spot light shadows

Any ideas on what those ??? can be ?

hi dolkar,

thanks for the reply. i guess you are right. and it is called:
Name “PREPASS”
Tags { “LightMode” = “PrePassFinal” }
from what i can see.
well, i think i will have to get deeper into the actual rendering pipeline.

lars

Just want to share what I found. After looking at the compiled code, I found that

SHADOWS_NATIVE seems to use shadow2DEXT to sample the shadow map, in which the calculation whether the current z is in front of the shadow map is done in the hardware directly.

Meanwhile, SHADOWS_SCREEN seems to be the usual shadow map technique, using texture2DProj to sample the shadow map, and then compare the current z to the result in the code.

I am talking from OpenGL point of view, but I think it should be similar for DX as well