Skip to content

Commit f36c70b

Browse files
ggkarm-uEvergreen
authored andcommitted
Revert "[URP] Fixed emission-enabling evaluation."
1 parent 8e67c2d commit f36c70b

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

Packages/com.unity.render-pipelines.universal/Editor/ShaderGUI/BaseShaderGUI.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,8 @@ public static void SetMaterialKeywords(Material material, Action<Material> shadi
943943
if (material.HasProperty(Property.EmissionColor))
944944
MaterialEditor.FixupEmissiveFlag(material);
945945

946-
bool shouldEmissionBeEnabled = (material.globalIlluminationFlags & MaterialGlobalIlluminationFlags.AnyEmissive) != 0;
946+
bool shouldEmissionBeEnabled =
947+
(material.globalIlluminationFlags & MaterialGlobalIlluminationFlags.EmissiveIsBlack) == 0;
947948

948949
// Not sure what this is used for, I don't see this property declared by any Unity shader in our repo...
949950
// I'm guessing it is some kind of legacy material upgrade support thing? Or maybe just dead code now...

Packages/com.unity.render-pipelines.universal/Editor/UniversalRenderPipelineMaterialUpgrader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ internal static void UpdateMaterialKeywords(Material material)
598598
// or is enabled and may be modified at runtime. This state depends on the values of the current flag and emissive color.
599599
// The fixup routine makes sure that the material is in the correct state if/when changes are made to the mode or color.
600600
MaterialEditor.FixupEmissiveFlag(material);
601-
bool shouldEmissionBeEnabled = (material.globalIlluminationFlags & MaterialGlobalIlluminationFlags.AnyEmissive) != 0;
601+
bool shouldEmissionBeEnabled = (material.globalIlluminationFlags & MaterialGlobalIlluminationFlags.EmissiveIsBlack) == 0;
602602
CoreUtils.SetKeyword(material, "_EMISSION", shouldEmissionBeEnabled);
603603
UniversalRenderPipelineMaterialUpgrader.DisableKeywords(material);
604604
}

Tests/SRPTests/Projects/UniversalGraphicsTest_Foundation/Assets/Scenes/161_FP16_BackBuffer/ParticleWhiteTransparent.mat

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Material:
1515
- _EMISSION
1616
- _SURFACE_TYPE_TRANSPARENT
1717
m_InvalidKeywords: []
18-
m_LightmapFlags: 2
18+
m_LightmapFlags: 0
1919
m_EnableInstancingVariants: 0
2020
m_DoubleSidedGI: 0
2121
m_CustomRenderQueue: 3000
@@ -87,9 +87,7 @@ Material:
8787
m_Offset: {x: 0, y: 0}
8888
m_Ints: []
8989
m_Floats:
90-
- _AddPrecomputedVelocity: 0
9190
- _AlphaClip: 0
92-
- _AlphaToMask: 0
9391
- _Blend: 0
9492
- _BlendModePreserveSpecular: 0
9593
- _BumpScale: 1
@@ -117,15 +115,13 @@ Material:
117115
- _SrcBlendAlpha: 1
118116
- _Surface: 1
119117
- _WorkflowMode: 1
120-
- _XRMotionVectorsPass: 1
121118
- _ZWrite: 0
122119
m_Colors:
123120
- _BaseColor: {r: 1, g: 1, b: 1, a: 0.12941177}
124121
- _Color: {r: 1, g: 1, b: 1, a: 0.12941177}
125122
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
126123
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
127124
m_BuildTextureStacks: []
128-
m_AllowLocking: 1
129125
--- !u!114 &6421356677785975880
130126
MonoBehaviour:
131127
m_ObjectHideFlags: 11

0 commit comments

Comments
 (0)