diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 6e53c0ffcfc..c5354aaa09b 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -47,6 +47,7 @@ The version number for this package has increased due to a version update of a r - Fixed a NaN generating in Area light code. - Fixed CustomPassUtils scaling issues when used with RTHandles allocated from a RenderTexture. - Fixed undo of some properties on light editor. +- Fixed material Emission properties not begin animated when recording an animation (case 1328108). ### Changed - Reduced the maximal number of bounces for both RTGI and RTR (case 1318876). diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs index bdff8bae4ab..3e6a935a4c9 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/UIBlocks/EmissionUIBlock.cs @@ -114,6 +114,15 @@ void UpdateEmissiveColorFromIntensityAndEmissiveColorLDR() materialEditor.serializedObject.Update(); } + internal static void UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(MaterialProperty emissiveColorLDR, MaterialProperty emissiveIntensity, MaterialProperty emissiveColor) + => emissiveColor.colorValue = emissiveColorLDR.colorValue.linear * emissiveIntensity.floatValue; + + internal static void UpdateEmissiveColorLDRFromIntensityAndEmissiveColor(MaterialProperty emissiveColorLDR, MaterialProperty emissiveIntensity, MaterialProperty emissiveColor) + { + Color emissiveColorLDRLinear = emissiveColorLDR.colorValue / emissiveIntensity.floatValue; + emissiveColorLDR.colorValue = emissiveColorLDRLinear.gamma; + } + void UpdateEmissionUnit(float newUnitFloat) { foreach (Material target in materials) @@ -211,7 +220,7 @@ void DrawEmissionGUI() if (intensityChanged && !unitIsMixed) emissiveIntensity.floatValue = newIntensity; - UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(); + UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(emissiveColorLDR, emissiveIntensity, emissiveColor); } }