diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index c13edbec416..57a442be3af 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -170,6 +170,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed ray traced reflections that were too dark for unlit materials. Reflections are now more consistent with the material emissiveness. - Fixed pyramid color being incorrect when hardware dynamic resolution is enabled. - Fixed SSR Accumulation with Offset with Viewport Rect Offset on Camera +- Fixed material Emission properties not begin animated when recording an animation (case 1328108). ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard 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 d95718b4cc0..9a6cb060e80 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 @@ -116,6 +116,9 @@ internal static void UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(Materia materialEditor.serializedObject.Update(); } + internal static void UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(MaterialProperty emissiveColorLDR, MaterialProperty emissiveIntensity, MaterialProperty emissiveColor) + => emissiveColor.colorValue = emissiveColorLDR.colorValue.linear * emissiveIntensity.floatValue; + internal static void UpdateEmissiveColorLDRFromIntensityAndEmissiveColor(MaterialEditor materialEditor, Material[] materials) { materialEditor.serializedObject.ApplyModifiedProperties(); @@ -126,6 +129,12 @@ internal static void UpdateEmissiveColorLDRFromIntensityAndEmissiveColor(Materia materialEditor.serializedObject.Update(); } + internal static void UpdateEmissiveColorLDRFromIntensityAndEmissiveColor(MaterialProperty emissiveColorLDR, MaterialProperty emissiveIntensity, MaterialProperty emissiveColor) + { + Color emissiveColorLDRLinear = emissiveColorLDR.colorValue / emissiveIntensity.floatValue; + emissiveColorLDR.colorValue = emissiveColorLDRLinear.gamma; + } + internal static void DoEmissiveIntensityGUI(MaterialEditor materialEditor, MaterialProperty emissiveIntensity, MaterialProperty emissiveIntensityUnit) { bool unitIsMixed = emissiveIntensityUnit.hasMixedValue; @@ -186,13 +195,13 @@ protected override void OnGUIOpen() else { if (updateEmissiveColor) - UpdateEmissiveColorLDRFromIntensityAndEmissiveColor(materialEditor, materials); + UpdateEmissiveColorLDRFromIntensityAndEmissiveColor(emissiveColorLDR, emissiveIntensity, emissiveColor); EditorGUI.BeginChangeCheck(); DoEmissiveTextureProperty(emissiveColorLDR); DoEmissiveIntensityGUI(materialEditor, emissiveIntensity, emissiveIntensityUnit); if (EditorGUI.EndChangeCheck()) - UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(materialEditor, materials); + UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(emissiveColorLDR, emissiveIntensity, emissiveColor); } materialEditor.ShaderProperty(emissiveExposureWeight, Styles.emissiveExposureWeightText);