[8.x.x Backport] Fix pre/post pass sg properties #82 by alelievr · Pull Request #86 · Unity-Technologies/Graphics · GitHub
Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class EyeGUI : HDShaderGUI
// For surface option shader graph we only want all unlit features but alpha clip, back then front rendering and SSR
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;

MaterialUIBlockList uiBlocks = new MaterialUIBlockList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
);
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, false);
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
HDSubShaderUtilities.AddPrePostPassProperties(collector, alphaTestDepthPrepass.isOn, alphaTestDepthPostpass.isOn);

base.CollectShaderProperties(collector, generationMode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class FabricGUI : HDShaderGUI
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;

MaterialUIBlockList uiBlocks = new MaterialUIBlockList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
);
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, false);
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
HDSubShaderUtilities.AddPrePostPassProperties(collector, false, false);

base.CollectShaderProperties(collector, generationMode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class HairGUI : HDShaderGUI
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;

MaterialUIBlockList uiBlocks = new MaterialUIBlockList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
);
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, alphaTestShadow.isOn);
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
HDSubShaderUtilities.AddPrePostPassProperties(collector, alphaTestDepthPrepass.isOn, alphaTestDepthPostpass.isOn);

base.CollectShaderProperties(collector, generationMode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class HDLitGUI : HDShaderGUI
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;

MaterialUIBlockList uiBlocks = new MaterialUIBlockList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
);
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, alphaTestShadow.isOn);
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
HDSubShaderUtilities.AddPrePostPassProperties(collector, alphaTestDepthPrepass.isOn, alphaTestDepthPostpass.isOn);

base.CollectShaderProperties(collector, generationMode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class StackLitGUI : HDShaderGUI
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;

MaterialUIBlockList uiBlocks = new MaterialUIBlockList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
);
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, false);
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
HDSubShaderUtilities.AddPrePostPassProperties(collector, false, false);

base.CollectShaderProperties(collector, generationMode);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public enum Features
ReceiveSSR = 1 << 8,
ShowAfterPostProcessPass = 1 << 9,
Unlit = Surface | BlendMode | DoubleSided | DoubleSidedNormalMode | AlphaCutoff | AlphaCutoffShadowThreshold | AlphaCutoffThreshold | BackThenFrontRendering | ShowAfterPostProcessPass,
ShowPrePassAndPostPass = 1 << 11,
Lit = All,
All = ~0,
}
Expand Down Expand Up @@ -483,11 +484,14 @@ void DrawSurfaceGUI()
if (transparentBackfaceEnable != null)
materialEditor.ShaderProperty(transparentBackfaceEnable, Styles.transparentBackfaceEnableText);

if (transparentDepthPrepassEnable != null)
materialEditor.ShaderProperty(transparentDepthPrepassEnable, Styles.transparentDepthPrepassEnableText);
if ((m_Features & Features.ShowPrePassAndPostPass) != 0)
{
if (transparentDepthPrepassEnable != null)
materialEditor.ShaderProperty(transparentDepthPrepassEnable, Styles.transparentDepthPrepassEnableText);

if (transparentDepthPostpassEnable != null)
materialEditor.ShaderProperty(transparentDepthPostpassEnable, Styles.transparentDepthPostpassEnableText);
if (transparentDepthPostpassEnable != null)
materialEditor.ShaderProperty(transparentDepthPostpassEnable, Styles.transparentDepthPostpassEnableText);
}

if (transparentWritingMotionVec != null)
materialEditor.ShaderProperty(transparentWritingMotionVec, Styles.transparentWritingMotionVecText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ protected static void ResetMaterialCustomRenderQueue(Material material)
}

readonly static string[] floatPropertiesToSynchronize = {
"_UseShadowThreshold", kReceivesSSR, kUseSplitLighting
"_UseShadowThreshold", kReceivesSSR, kUseSplitLighting,
kTransparentDepthPrepassEnable, kTransparentDepthPostpassEnable
};

protected static void SynchronizeShaderGraphProperties(Material material)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class HDUnlitGUI : HDShaderGUI
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
^ SurfaceOptionUIBlock.Features.DoubleSidedNormalMode
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering;
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;

MaterialUIBlockList uiBlocks = new MaterialUIBlockList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
);
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, false);
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSided.isOn ? DoubleSidedMode.Enabled : DoubleSidedMode.Disabled);
HDSubShaderUtilities.AddPrePostPassProperties(collector, false, false);

base.CollectShaderProperties(collector, generationMode);
}
Expand Down