|
|
|
|
|
|
{ |
|
|
|
DepthPass(ref context); |
|
|
|
if(m_Asset.UsesScreenSpaceShadows) //NOTE: Should this be added to the FrameRenderingConfiguration?
|
|
|
|
ShadowCollectPass(ref context); |
|
|
|
ShadowCollectPass(ref context, visibleLights, ref lightData); |
|
|
|
} |
|
|
|
|
|
|
|
ForwardPass(visibleLights, frameRenderingConfiguration, ref context, ref lightData, stereoEnabled); |
|
|
|
|
|
|
return corners; |
|
|
|
} |
|
|
|
|
|
|
|
private void ShadowCollectPass(ref ScriptableRenderContext context) |
|
|
|
private void ShadowCollectPass(ref ScriptableRenderContext context, List<VisibleLight> lights, ref LightData lightData) |
|
|
|
|
|
|
|
//Reciever constants set up here in case of screen space shadows.
|
|
|
|
SetupShadowReceiverConstants(cmd, lights[lightData.mainLightIndex]); |
|
|
|
|
|
|
|
|
|
|
|
cmd.SetGlobalVectorArray("_FrustumCorners", GetFarPlaneCorners()); |
|
|
|
cmd.Blit(null, m_ScreenSpaceShadowMapRT, m_ScreenSpaceShadowsMaterial); |
|
|
|
|
|
|
|
|
|
|
// Main light has an optimized shader path for main light. This will benefit games that only care about a single light.
|
|
|
|
// Lightweight pipeline also supports only a single shadow light, if available it will be the main light.
|
|
|
|
SetupMainLightConstants(cmd, lights, lightData.mainLightIndex); |
|
|
|
if (lightData.shadowMapSampleType != LightShadows.None) |
|
|
|
if (lightData.shadowMapSampleType != LightShadows.None && !m_Asset.UsesScreenSpaceShadows) //TODO: Nicer way to know about SSS.
|
|
|
|
SetupShadowReceiverConstants(cmd, lights[lightData.mainLightIndex]); |
|
|
|
|
|
|
|
SetupAdditionalListConstants(cmd, lights, ref lightData); |
|
|
|