diff --git a/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs b/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs index 724f19a4646..d27da86dbe0 100644 --- a/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs +++ b/com.unity.render-pipelines.core/Runtime/Volume/VolumeParameter.cs @@ -1449,6 +1449,19 @@ public TextureParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } // TODO: Texture interpolation + + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1464,6 +1477,19 @@ public class NoInterpTextureParameter : VolumeParameter /// The initial override state for the parameter. public NoInterpTextureParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } + + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1479,6 +1505,19 @@ public class Texture2DParameter : VolumeParameter /// The initial override state for the parameter. public Texture2DParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } + + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1494,6 +1533,19 @@ public class Texture3DParameter : VolumeParameter /// The initial override state for the parameter. public Texture3DParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } + + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1511,6 +1563,19 @@ public RenderTextureParameter(RenderTexture value, bool overrideState = false) : base(value, overrideState) { } // TODO: RenderTexture interpolation + + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1526,6 +1591,19 @@ public class NoInterpRenderTextureParameter : VolumeParameter /// The initial override state for the parameter. public NoInterpRenderTextureParameter(RenderTexture value, bool overrideState = false) : base(value, overrideState) { } + + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1542,6 +1620,19 @@ public class CubemapParameter : VolumeParameter public CubemapParameter(Texture value, bool overrideState = false) : base(value, overrideState) { } // TODO: Cubemap interpolation + + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// @@ -1557,6 +1648,19 @@ public class NoInterpCubemapParameter : VolumeParameter /// The initial override state for the parameter. public NoInterpCubemapParameter(Cubemap value, bool overrideState = false) : base(value, overrideState) { } + + public override int GetHashCode() + { + int hash = base.GetHashCode(); + + unchecked + { + if (value != null) + hash = 23 * CoreUtils.GetTextureHash(value); + } + + return hash; + } } /// diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index a09f6f4b16b..977f830bb91 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -80,6 +80,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed one frame flicker on hardware DRS - (case 1398085) - Fixed using the wrong coordinate to compute the sampling direction for the screen space global illumination. - Fixed an issue where forced sky update (like PBR sky amortized updated) would not update ambient probe. +- Fixed static lighting sky update when using an HDRI sky with a render texture in parameter. ## [14.0.0] - 2021-11-17 diff --git a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs index f2704227e30..37ba44e6357 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Sky/HDRISky/HDRISky.cs @@ -150,8 +150,8 @@ public override int GetHashCode() hash = hash * 23 + dirLightShadow.overrideState.GetHashCode(); hash = hash * 23 + rectLightShadow.overrideState.GetHashCode(); #else - hash = hdriSky.value != null ? hash * 23 + hdriSky.GetHashCode() : hash; - hash = flowmap.value != null ? hash * 23 + flowmap.GetHashCode() : hash; + hash = hash * 23 + hdriSky.GetHashCode(); + hash = hash * 23 + flowmap.GetHashCode(); hash = hash * 23 + distortionMode.GetHashCode(); hash = hash * 23 + upperHemisphereOnly.GetHashCode(); hash = hash * 23 + scrollOrientation.GetHashCode();