Skip to content

Commit 8c5fdb8

Browse files
Fix color curves changes not applying immediately in editor (#6322)
* Always recompute LUT hash when colro curves are overridden * Changelog * Missing tiny part of comment Co-authored-by: sebastienlagarde <[email protected]>
1 parent 558f213 commit 8c5fdb8

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

com.unity.render-pipelines.core/Runtime/Volume/VolumeComponent.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,19 @@ public override int GetHashCode()
299299
}
300300
}
301301

302+
/// <summary>
303+
/// Returns true if any of the volume properites has been overridden.
304+
/// </summary>
305+
/// <returns>True if any of the volume properites has been overridden.</returns>
306+
public bool AnyPropertiesIsOverridden()
307+
{
308+
for (int i = 0; i < parameters.Count; ++i)
309+
{
310+
if (parameters[i].overrideState) return true;
311+
}
312+
return false;
313+
}
314+
302315
/// <summary>
303316
/// Unity calls this method before the object is destroyed.
304317
/// </summary>

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5656
- Fixed camera bridge action in release build (case 1367866).
5757
- Fixed contact shadow disappearing when shadowmask is used and no non-static object is available.
5858
- Fixed atmospheric scattering being incorrectly enabled when scene lighting is disabled.
59+
- Fixed for changes of color curves not being applied immediately.
5960

6061
### Changed
6162
- Optimizations for the physically based depth of field.

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.PostProcess.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4306,7 +4306,8 @@ TextureHandle ColorGradingPass(RenderGraph renderGraph)
43064306
var currentGradingHash = ComputeLUTHash();
43074307

43084308
// The lut we have already is ok.
4309-
if (currentGradingHash == m_LutHash)
4309+
if (currentGradingHash == m_LutHash &&
4310+
!m_Curves.AnyPropertiesIsOverridden()) // Curves content are not hashed, to compute the hash of the curves would probably be more expensive than actually running the LUT pass. So we just check if the project is using anything but the default
43104311
return logLut;
43114312

43124313
// Else we update the hash and we recompute the LUT.

0 commit comments

Comments
 (0)