Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ static void AddToggleProperty(this PropertyCollector collector, string reference

public static void AddStencilShaderProperties(PropertyCollector collector, SystemData systemData, LightingData lightingData)
{
bool ssrEnabled = systemData.surfaceType == SurfaceType.Opaque ? lightingData.receiveSSR : lightingData.receiveSSRTransparent;
bool ssrEnabled = false;

if (lightingData != null)
ssrEnabled = systemData.surfaceType == SurfaceType.Opaque ? lightingData.receiveSSR : lightingData.receiveSSRTransparent;

BaseLitGUI.ComputeStencilProperties(ssrEnabled, lightingData.subsurfaceScattering, out int stencilRef, out int stencilWriteMask,
BaseLitGUI.ComputeStencilProperties(ssrEnabled, lightingData != null && lightingData.subsurfaceScattering, out int stencilRef, out int stencilWriteMask,
out int stencilRefDepth, out int stencilWriteMaskDepth, out int stencilRefGBuffer, out int stencilWriteMaskGBuffer,
out int stencilRefMV, out int stencilWriteMaskMV
);
Expand All @@ -93,9 +96,9 @@ public static void AddStencilShaderProperties(PropertyCollector collector, Syste
collector.AddIntProperty("_StencilRefGBuffer", stencilRefGBuffer);
collector.AddIntProperty("_ZTestGBuffer", 4);

collector.AddToggleProperty(kUseSplitLighting, lightingData.subsurfaceScattering);
collector.AddToggleProperty(kReceivesSSR, lightingData.receiveSSR);
collector.AddToggleProperty(kReceivesSSRTransparent, lightingData.receiveSSRTransparent);
collector.AddToggleProperty(kUseSplitLighting, lightingData != null && lightingData.subsurfaceScattering);
collector.AddToggleProperty(kReceivesSSR, lightingData != null && lightingData.receiveSSR);
collector.AddToggleProperty(kReceivesSSRTransparent, lightingData != null && lightingData.receiveSSRTransparent);
}

public static void AddBlendingStatesShaderProperties(
Expand Down