Skip to content

Commit 4313b48

Browse files
[HDRP] Fix decal draw order for ShaderGraph decal materials (#3018)
* Fixed ShaderGraph decal draw order * Updated changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
1 parent 88daab3 commit 4313b48

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3636
- Fixed an issue with the frame count management for the volumetric fog (case 1299251).
3737
- Fixed issue with shadow mask and area lights.
3838
- Fixed an issue with the capture callback (now includes post processing results).
39+
- Fixed decal draw order for ShaderGraph decal materials.
3940

4041
### Changed
4142
- Removed the material pass probe volumes evaluation mode.

com.unity.render-pipelines.high-definition/Runtime/Material/Decal/DecalSystem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,9 +859,9 @@ public int DrawOrder
859859
{
860860
get
861861
{
862-
if (m_IsHDRenderPipelineDecal)
862+
if (this.m_Material.HasProperty(HDShaderIDs._DrawOrder))
863863
{
864-
return this.m_Material.GetInt("_DrawOrder");
864+
return this.m_Material.GetInt(HDShaderIDs._DrawOrder);
865865
}
866866
else
867867
{

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDStringConstants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ static class HDShaderIDs
243243
public static readonly int _DecalNormalBufferStencilRef = Shader.PropertyToID("_DecalNormalBufferStencilRef");
244244
public static readonly int _DecalPrepassTexture = Shader.PropertyToID("_DecalPrepassTexture");
245245
public static readonly int _DecalPrepassTextureMS = Shader.PropertyToID("_DecalPrepassTextureMS");
246+
public static readonly int _DrawOrder = Shader.PropertyToID("_DrawOrder");
246247

247248

248249
public static readonly int _WorldSpaceCameraPos = Shader.PropertyToID("_WorldSpaceCameraPos");

0 commit comments

Comments
 (0)