Beispiel #1
0
        /// <summary>
        /// Returns the hash code of the gradient sky parameters.
        /// </summary>
        /// <returns>The hash code of the gradient sky parameters.</returns>
        public override int GetHashCode()
        {
            int hash = base.GetHashCode();

            unchecked
            {
#if UNITY_2019_3 // In 2019.3, when we call GetHashCode on a VolumeParameter it generate garbage (due to the boxing of the generic parameter)
                hash = hash * 23 + bottom.value.GetHashCode();
                hash = hash * 23 + top.value.GetHashCode();
                hash = hash * 23 + middle.value.GetHashCode();
                hash = hash * 23 + gradientDiffusion.value.GetHashCode();

                hash = hash * 23 + bottom.overrideState.GetHashCode();
                hash = hash * 23 + top.overrideState.GetHashCode();
                hash = hash * 23 + middle.overrideState.GetHashCode();
                hash = hash * 23 + gradientDiffusion.overrideState.GetHashCode();
#else
                hash = hash * 23 + bottom.GetHashCode();
                hash = hash * 23 + top.GetHashCode();
                hash = hash * 23 + middle.GetHashCode();
                hash = hash * 23 + gradientDiffusion.GetHashCode();
#endif
            }

            return(hash);
        }
Beispiel #2
0
            /// <summary>
            /// Returns the hash code of the CloudMap parameters.
            /// </summary>
            /// <returns>The hash code of the CloudMap parameters.</returns>
            public override int GetHashCode()
            {
                int hash = GetBakingHashCode();

                unchecked
                {
                    hash = hash * 23 + tint.GetHashCode();
                    hash = hash * 23 + exposure.GetHashCode();

                    hash = hash * 23 + distortionMode.GetHashCode();
                    hash = hash * 23 + scrollDirection.GetHashCode();
                    hash = hash * 23 + scrollSpeed.GetHashCode();
                    hash = hash * 23 + flowmap.GetHashCode();

                    hash = hash * 23 + distortionMode.GetHashCode();

#if UNITY_EDITOR
                    // In the editor, we want to rebake the texture if the texture content is modified
                    if (flowmap.value != null)
                    {
                        hash = hash * 23 + flowmap.value.imageContentsHash.GetHashCode();
                    }
#endif
                }

                return(hash);
            }
Beispiel #3
0
        /// <summary>
        /// Returns the hash code of the sky parameters.
        /// </summary>
        /// <returns>The hash code of the sky parameters.</returns>
        public override int GetHashCode()
        {
            unchecked
            {
#if UNITY_2019_3 // In 2019.3, when we call GetHashCode on a VolumeParameter it generate garbage (due to the boxing of the generic parameter)
                // UpdateMode and period should not be part of the hash as they do not influence rendering itself.
                int hash = 13;
                hash = hash * 23 + rotation.value.GetHashCode();
                hash = hash * 23 + exposure.value.GetHashCode();
                hash = hash * 23 + multiplier.value.GetHashCode();
                hash = hash * 23 + desiredLuxValue.value.GetHashCode();
                hash = hash * 23 + skyIntensityMode.value.GetHashCode();
                hash = hash * 23 + includeSunInBaking.value.GetHashCode();

                hash = hash * 23 + rotation.overrideState.GetHashCode();
                hash = hash * 23 + exposure.overrideState.GetHashCode();
                hash = hash * 23 + multiplier.overrideState.GetHashCode();
                hash = hash * 23 + desiredLuxValue.overrideState.GetHashCode();
                hash = hash * 23 + skyIntensityMode.overrideState.GetHashCode();
                hash = hash * 23 + includeSunInBaking.overrideState.GetHashCode();
#else
                // UpdateMode and period should not be part of the hash as they do not influence rendering itself.
                int hash = 13;
                hash = hash * 23 + rotation.GetHashCode();
                hash = hash * 23 + exposure.GetHashCode();
                hash = hash * 23 + multiplier.GetHashCode();
                hash = hash * 23 + desiredLuxValue.GetHashCode();
                hash = hash * 23 + skyIntensityMode.GetHashCode();
                hash = hash * 23 + includeSunInBaking.GetHashCode();
#endif

                return(hash);
            }
        }
Beispiel #4
0
        /// <summary>
        /// Returns the hash code of the HDRI sky parameters.
        /// </summary>
        /// <returns>The hash code of the HDRI sky parameters.</returns>
        public override int GetHashCode()
        {
            int hash = base.GetHashCode();

            unchecked
            {
#if UNITY_2019_3 // In 2019.3, when we call GetHashCode on a VolumeParameter it generate garbage (due to the boxing of the generic parameter)
                hash = hdriSky.value != null ? hash * 23 + hdriSky.value.GetHashCode() : hash;
                hash = hash * 23 + enableBackplate.value.GetHashCode();
                hash = hash * 23 + backplateType.value.GetHashCode();
                hash = hash * 23 + groundLevel.value.GetHashCode();
                hash = hash * 23 + scale.value.GetHashCode();
                hash = hash * 23 + projectionDistance.value.GetHashCode();
                hash = hash * 23 + plateRotation.value.GetHashCode();
                hash = hash * 23 + plateTexRotation.value.GetHashCode();
                hash = hash * 23 + plateTexOffset.value.GetHashCode();
                hash = hash * 23 + blendAmount.value.GetHashCode();
                hash = hash * 23 + shadowTint.value.GetHashCode();
                hash = hash * 23 + pointLightShadow.value.GetHashCode();
                hash = hash * 23 + dirLightShadow.value.GetHashCode();
                hash = hash * 23 + rectLightShadow.value.GetHashCode();

                hash = hdriSky.value != null ? hash * 23 + hdriSky.overrideState.GetHashCode() : hash;
                hash = hash * 23 + enableBackplate.overrideState.GetHashCode();
                hash = hash * 23 + backplateType.overrideState.GetHashCode();
                hash = hash * 23 + groundLevel.overrideState.GetHashCode();
                hash = hash * 23 + scale.overrideState.GetHashCode();
                hash = hash * 23 + projectionDistance.overrideState.GetHashCode();
                hash = hash * 23 + plateRotation.overrideState.GetHashCode();
                hash = hash * 23 + plateTexRotation.overrideState.GetHashCode();
                hash = hash * 23 + plateTexOffset.overrideState.GetHashCode();
                hash = hash * 23 + blendAmount.overrideState.GetHashCode();
                hash = hash * 23 + shadowTint.overrideState.GetHashCode();
                hash = hash * 23 + pointLightShadow.overrideState.GetHashCode();
                hash = hash * 23 + dirLightShadow.overrideState.GetHashCode();
                hash = hash * 23 + rectLightShadow.overrideState.GetHashCode();
#else
                hash = hdriSky.value != null ? hash * 23 + hdriSky.GetHashCode() : hash;
                hash = hash * 23 + enableBackplate.GetHashCode();
                hash = hash * 23 + backplateType.GetHashCode();
                hash = hash * 23 + groundLevel.GetHashCode();
                hash = hash * 23 + scale.GetHashCode();
                hash = hash * 23 + projectionDistance.GetHashCode();
                hash = hash * 23 + plateRotation.GetHashCode();
                hash = hash * 23 + plateTexRotation.GetHashCode();
                hash = hash * 23 + plateTexOffset.GetHashCode();
                hash = hash * 23 + blendAmount.GetHashCode();
                hash = hash * 23 + shadowTint.GetHashCode();
                hash = hash * 23 + pointLightShadow.GetHashCode();
                hash = hash * 23 + dirLightShadow.GetHashCode();
                hash = hash * 23 + rectLightShadow.GetHashCode();
#endif
            }

            return(hash);
        }
Beispiel #5
0
        public override int GetHashCode()
        {
            int hash = base.GetHashCode();

            unchecked
            {
                hash = hash * 23 + bottom.GetHashCode();
                hash = hash * 23 + top.GetHashCode();
                hash = hash * 23 + middle.GetHashCode();
                hash = hash * 23 + gradientDiffusion.GetHashCode();
            }

            return(hash);
        }
Beispiel #6
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 13;
         hash = hash * 23 + rotation.GetHashCode();
         hash = hash * 23 + exposure.GetHashCode();
         hash = hash * 23 + multiplier.GetHashCode();
         hash = hash * 23 + desiredLuxValue.GetHashCode();
         hash = hash * 23 + updateMode.value.GetHashCode();
         hash = hash * 23 + skyIntensityMode.value.GetHashCode();
         hash = hash * 23 + updatePeriod.GetHashCode();
         hash = hash * 23 + includeSunInBaking.GetHashCode();
         return(hash);
     }
 }
        public override int GetHashCode()
        {
            unchecked
            {
                // UpdateMode and period should not be part of the hash as they do not influence rendering itself.
                int hash = 13;
                hash = hash * 23 + rotation.GetHashCode();
                hash = hash * 23 + exposure.GetHashCode();
                hash = hash * 23 + multiplier.GetHashCode();
                hash = hash * 23 + desiredLuxValue.GetHashCode();
                hash = hash * 23 + skyIntensityMode.GetHashCode();
                hash = hash * 23 + includeSunInBaking.GetHashCode();

                return(hash);
            }
        }
Beispiel #8
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 13;
                hash = hash * 23 + rotation.GetHashCode();
                hash = hash * 23 + exposure.GetHashCode();
                hash = hash * 23 + multiplier.GetHashCode();

                // TODO: Fixme once we switch to .Net 4.6+
                //>>>
                hash = hash * 23 + ((int)updateMode.value).GetHashCode();
                //<<<

                hash = hash * 23 + updatePeriod.GetHashCode();
                return(hash);
            }
        }
        public override int GetHashCode()
        {
            int hash = GetPrecomputationHashCode();

            unchecked
            {
                // These parameters do NOT affect precomputation.
                hash = hash * 23 + sphericalMode.GetHashCode();
                hash = hash * 23 + seaLevel.GetHashCode();
                hash = hash * 23 + planetCenterPosition.GetHashCode();
                hash = hash * 23 + planetRotation.GetHashCode();

                if (groundColorTexture.value != null)
                {
                    hash = hash * 23 + groundColorTexture.GetHashCode();
                }

                if (groundEmissionTexture.value != null)
                {
                    hash = hash * 23 + groundEmissionTexture.GetHashCode();
                }

                hash = hash * 23 + groundEmissionMultiplier.GetHashCode();

                hash = hash * 23 + spaceRotation.GetHashCode();

                if (spaceEmissionTexture.value != null)
                {
                    hash = hash * 23 + spaceEmissionTexture.GetHashCode();
                }

                hash = hash * 23 + spaceEmissionMultiplier.GetHashCode();
                hash = hash * 23 + colorSaturation.GetHashCode();
                hash = hash * 23 + alphaSaturation.GetHashCode();
                hash = hash * 23 + alphaMultiplier.GetHashCode();
                hash = hash * 23 + horizonTint.GetHashCode();
                hash = hash * 23 + zenithTint.GetHashCode();
                hash = hash * 23 + horizonZenithShift.GetHashCode();
            }

            return(hash);
        }
Beispiel #10
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 13;
                hash = hash * 23 + rotation.GetHashCode();
                hash = hash * 23 + exposure.GetHashCode();
                hash = hash * 23 + multiplier.GetHashCode();
                hash = hash * 23 + desiredLuxValue.GetHashCode();

                // TODO: Fixme once we switch to .Net 4.6+
                //>>>
                hash = hash * 23 + ((int)updateMode.value).GetHashCode();
                hash = hash * 23 + ((int)skyIntensityMode.value).GetHashCode();
                //<<<

                hash = hash * 23 + updatePeriod.GetHashCode();
                hash = hash * 23 + includeSunInBaking.GetHashCode();
                return(hash);
            }
        }
Beispiel #11
0
        public override int GetHashCode()
        {
            if (!m_dirty)
            {
                return(m_hash);
            }

            var hash = base.GetHashCode();

            unchecked
            {
                hash = hash * 23 + starCellCounts.GetHashCode();
                hash = hash * 23 + starRadii.GetHashCode();
                hash = hash * 23 + starBrightnesses.GetHashCode();
                hash = hash * 23 + starFieldDensities.GetHashCode();
                hash = hash * 23 + nebulaCellCount.GetHashCode();
                hash = hash * 23 + nebulaDensity.GetHashCode();
                hash = hash * 23 + nebulaBrightness.GetHashCode();
            }
            m_hash  = hash;
            m_dirty = false;
            return(hash);
        }
        public override int GetHashCode()
        {
            int hash = base.GetHashCode();

            unchecked
            {
                hash = hdriSky.value != null ? hash * 23 + hdriSky.GetHashCode() : hash;
                hash = hash * 23 + enableBackplate.GetHashCode();
                hash = hash * 23 + backplateType.GetHashCode();
                hash = hash * 23 + groundLevel.GetHashCode();
                hash = hash * 23 + scale.GetHashCode();
                hash = hash * 23 + projectionDistance.GetHashCode();
                hash = hash * 23 + plateRotation.GetHashCode();
                hash = hash * 23 + plateTexRotation.GetHashCode();
                hash = hash * 23 + plateTexOffset.GetHashCode();
                hash = hash * 23 + blendAmount.GetHashCode();
                hash = hash * 23 + shadowTint.GetHashCode();
                hash = hash * 23 + pointLightShadow.GetHashCode();
                hash = hash * 23 + dirLightShadow.GetHashCode();
                hash = hash * 23 + rectLightShadow.GetHashCode();
            }

            return(hash);
        }
        /// <summary> Returns the hash code of the parameters of the sky. </summary>
        /// <returns> The hash code of the parameters of the sky. </returns>
        public override int GetHashCode()
        {
            int hash = GetPrecomputationHashCode();

            unchecked
            {
#if UNITY_2019_3 // In 2019.3, when we call GetHashCode on a VolumeParameter it generate garbage (due to the boxing of the generic parameter)
                // These parameters do NOT affect precomputation.
                hash = hash * 23 + sphericalMode.overrideState.GetHashCode();
                hash = hash * 23 + seaLevel.overrideState.GetHashCode();
                hash = hash * 23 + planetCenterPosition.overrideState.GetHashCode();
                hash = hash * 23 + planetRotation.overrideState.GetHashCode();

                if (groundColorTexture.value != null)
                {
                    hash = hash * 23 + groundColorTexture.overrideState.GetHashCode();
                }

                if (groundEmissionTexture.value != null)
                {
                    hash = hash * 23 + groundEmissionTexture.overrideState.GetHashCode();
                }

                hash = hash * 23 + groundEmissionMultiplier.overrideState.GetHashCode();

                hash = hash * 23 + spaceRotation.overrideState.GetHashCode();

                if (spaceEmissionTexture.value != null)
                {
                    hash = hash * 23 + spaceEmissionTexture.overrideState.GetHashCode();
                }

                hash = hash * 23 + spaceEmissionMultiplier.overrideState.GetHashCode();
                hash = hash * 23 + colorSaturation.overrideState.GetHashCode();
                hash = hash * 23 + alphaSaturation.overrideState.GetHashCode();
                hash = hash * 23 + alphaMultiplier.overrideState.GetHashCode();
                hash = hash * 23 + horizonTint.overrideState.GetHashCode();
                hash = hash * 23 + zenithTint.overrideState.GetHashCode();
                hash = hash * 23 + horizonZenithShift.overrideState.GetHashCode();
#else
                // These parameters do NOT affect precomputation.
                hash = hash * 23 + sphericalMode.GetHashCode();
                hash = hash * 23 + seaLevel.GetHashCode();
                hash = hash * 23 + planetCenterPosition.GetHashCode();
                hash = hash * 23 + planetRotation.GetHashCode();

                if (groundColorTexture.value != null)
                {
                    hash = hash * 23 + groundColorTexture.GetHashCode();
                }

                if (groundEmissionTexture.value != null)
                {
                    hash = hash * 23 + groundEmissionTexture.GetHashCode();
                }

                hash = hash * 23 + groundEmissionMultiplier.GetHashCode();

                hash = hash * 23 + spaceRotation.GetHashCode();

                if (spaceEmissionTexture.value != null)
                {
                    hash = hash * 23 + spaceEmissionTexture.GetHashCode();
                }

                hash = hash * 23 + spaceEmissionMultiplier.GetHashCode();
                hash = hash * 23 + colorSaturation.GetHashCode();
                hash = hash * 23 + alphaSaturation.GetHashCode();
                hash = hash * 23 + alphaMultiplier.GetHashCode();
                hash = hash * 23 + horizonTint.GetHashCode();
                hash = hash * 23 + zenithTint.GetHashCode();
                hash = hash * 23 + horizonZenithShift.GetHashCode();
#endif
            }

            return(hash);
        }
Beispiel #14
0
 public override int GetHashCode()
 => base.GetHashCode() * 23 +
 starColor.GetHashCode() +
 horizonPower.GetHashCode() +
 polarPower.GetHashCode();