Skip to content

Commit 990903f

Browse files
[8.x.x Backport] Fix pre/post pass sg properties #82 (#86)
* Fix depth pre/post passes not correctly enabled when switching shaders on the material # Conflicts: # com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitMasterNode.cs # com.unity.render-pipelines.high-definition/Editor/Material/Unlit/HDShaderGUI.cs # com.unity.render-pipelines.high-definition/Editor/ShaderGraph/HDSubShaderUtilities.cs * Hide prepass and postpass in the material UI # Conflicts: # com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/SurfaceOptionUIBlock.cs * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
1 parent 3f6c2f2 commit 990903f

File tree

16 files changed

+35
-11
lines changed

16 files changed

+35
-11
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7777
- Fixed scalarization code for contact shadows
7878
- Fix MaterialBalls having same guid issue
7979
- Fix spelling and grammatical errors in material samples
80+
- Fixed depth prepass and postpass being disabled after changing the shader in the material UI.
8081

8182
### Changed
8283
- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history.

com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class EyeGUI : HDShaderGUI
1414
// For surface option shader graph we only want all unlit features but alpha clip, back then front rendering and SSR
1515
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
1616
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
17-
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
17+
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
18+
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;
1819

1920
MaterialUIBlockList uiBlocks = new MaterialUIBlockList
2021
{

com.unity.render-pipelines.high-definition/Editor/Material/Eye/ShaderGraph/EyeMasterNode.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
783783
);
784784
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, false);
785785
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
786+
HDSubShaderUtilities.AddPrePostPassProperties(collector, alphaTestDepthPrepass.isOn, alphaTestDepthPostpass.isOn);
786787

787788
base.CollectShaderProperties(collector, generationMode);
788789
}

com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class FabricGUI : HDShaderGUI
1515
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
1616
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
1717
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
18-
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
18+
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
19+
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;
1920

2021
MaterialUIBlockList uiBlocks = new MaterialUIBlockList
2122
{

com.unity.render-pipelines.high-definition/Editor/Material/Fabric/ShaderGraph/FabricMasterNode.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
794794
);
795795
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, false);
796796
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
797+
HDSubShaderUtilities.AddPrePostPassProperties(collector, false, false);
797798

798799
base.CollectShaderProperties(collector, generationMode);
799800
}

com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class HairGUI : HDShaderGUI
1515
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
1616
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
1717
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
18-
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
18+
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
19+
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;
1920

2021
MaterialUIBlockList uiBlocks = new MaterialUIBlockList
2122
{

com.unity.render-pipelines.high-definition/Editor/Material/Hair/ShaderGraph/HairMasterNode.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
899899
);
900900
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, alphaTestShadow.isOn);
901901
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
902+
HDSubShaderUtilities.AddPrePostPassProperties(collector, alphaTestDepthPrepass.isOn, alphaTestDepthPostpass.isOn);
902903

903904
base.CollectShaderProperties(collector, generationMode);
904905
}

com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class HDLitGUI : HDShaderGUI
1515
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
1616
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
1717
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
18-
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
18+
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
19+
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;
1920

2021
MaterialUIBlockList uiBlocks = new MaterialUIBlockList
2122
{

com.unity.render-pipelines.high-definition/Editor/Material/Lit/ShaderGraph/HDLitMasterNode.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ public override void CollectShaderProperties(PropertyCollector collector, Genera
11191119
);
11201120
HDSubShaderUtilities.AddAlphaCutoffShaderProperties(collector, alphaTest.isOn, alphaTestShadow.isOn);
11211121
HDSubShaderUtilities.AddDoubleSidedProperty(collector, doubleSidedMode);
1122+
HDSubShaderUtilities.AddPrePostPassProperties(collector, alphaTestDepthPrepass.isOn, alphaTestDepthPostpass.isOn);
11221123

11231124
base.CollectShaderProperties(collector, generationMode);
11241125
}

com.unity.render-pipelines.high-definition/Editor/Material/StackLit/ShaderGraph/StackLitGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class StackLitGUI : HDShaderGUI
1515
const SurfaceOptionUIBlock.Features surfaceOptionFeatures = SurfaceOptionUIBlock.Features.Unlit
1616
^ SurfaceOptionUIBlock.Features.AlphaCutoffThreshold
1717
^ SurfaceOptionUIBlock.Features.BackThenFrontRendering
18-
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass;
18+
^ SurfaceOptionUIBlock.Features.ShowAfterPostProcessPass
19+
^ SurfaceOptionUIBlock.Features.ShowPrePassAndPostPass;
1920

2021
MaterialUIBlockList uiBlocks = new MaterialUIBlockList
2122
{

0 commit comments

Comments
 (0)