Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -211,7 +220,7 @@ void DrawEmissionGUI()
if (intensityChanged && !unitIsMixed)
emissiveIntensity.floatValue = newIntensity;

UpdateEmissiveColorFromIntensityAndEmissiveColorLDR();
UpdateEmissiveColorFromIntensityAndEmissiveColorLDR(emissiveColorLDR, emissiveIntensity, emissiveColor);
}
}

Expand Down