Skip to content

Commit 693c214

Browse files
lukaschodphi-lira
andauthored
Removing duplicated property in lit shader (#3564)
* Removing _GlossMapScale duplicated property in lit shader * Extending test to check if shaders have duplicated properties * Adding changelog entry * Moving _GlossMapScale to obsolete properties as it is not used. Also removing it in complex lit as it is not using upgrade path Co-authored-by: Felipe Lira <[email protected]>
1 parent 2b839dd commit 693c214

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

com.unity.render-pipelines.universal/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
4444
- Fixed shadow cascade blend culling factor.
4545
- Removed Custom.meta which was causing warnings. [case 1314288](https://issuetracker.unity3d.com/issues/urp-warnings-about-missing-metadata-appear-after-installing)
4646
- Fixed a case where shadow fade was clipped too early.
47+
- Fixed lit shader property duplication issue. [case 1315032](https://issuetracker.unity3d.com/issues/shader-dot-propertytoid-returns-the-same-id-when-shaders-properties-have-the-same-name-but-different-type)
4748
- Fixed undo issues for the additional light property on the UniversalRenderPipeline Asset. [case 1300367]
4849

4950
### Changed

com.unity.render-pipelines.universal/Shaders/ComplexLit.shader

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Shader "Universal Render Pipeline/Complex Lit"
1414
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
1515

1616
_Smoothness("Smoothness", Range(0.0, 1.0)) = 0.5
17-
_GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
1817
_SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
1918

2019
_Metallic("Metallic", Range(0.0, 1.0)) = 0.0

com.unity.render-pipelines.universal/Shaders/Lit.shader

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ Shader "Universal Render Pipeline/Lit"
1111
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
1212

1313
_Smoothness("Smoothness", Range(0.0, 1.0)) = 0.5
14-
_GlossMapScale("Smoothness Scale", Range(0.0, 1.0)) = 1.0
1514
_SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
1615

1716
_Metallic("Metallic", Range(0.0, 1.0)) = 0.0

com.unity.render-pipelines.universal/Tests/Editor/EditorTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ public void ValidateShaderResources(ShaderPathID shaderPathID)
110110

111111
var shader = AssetDatabase.LoadAssetAtPath<Shader>(path);
112112
Assert.AreEqual(shader.name, ShaderUtils.GetShaderPath(shaderPathID));
113+
114+
var propertyNames = new System.Collections.Generic.HashSet<string>();
115+
for (int j = 0; j < shader.GetPropertyCount(); ++j)
116+
{
117+
string propertyName = shader.GetPropertyName(j);
118+
Assert.IsFalse(propertyNames.Contains(propertyName), $"{shader.name} has duplicated property {propertyName}!");
119+
propertyNames.Add(propertyName);
120+
}
113121
}
114122

115123
// When creating URP all required resources should be initialized.

0 commit comments

Comments
 (0)