internal int GetBakingHashCode(Light sunLight) { int hash = 17; bool lighting = layerA.lighting.value; bool shadows = sunLight != null && layerA.castShadows.value; unchecked { hash = hash * 23 + upperHemisphereOnly.GetHashCode(); hash = hash * 23 + layers.GetHashCode(); hash = hash * 23 + resolution.GetHashCode(); hash = hash * 23 + layerA.GetBakingHashCode(); if (layers.value == CloudMapMode.Double) { hash = hash * 23 + layerB.GetBakingHashCode(); lighting |= layerB.lighting.value; shadows |= layerB.castShadows.value; } if (lighting && sunLight != null) { hash = hash * 23 + sunLight.transform.rotation.GetHashCode(); } if (shadows) { hash = hash * 23 + shadowResolution.GetHashCode(); } } return(hash); }
/// <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); } }
internal int GetBakingHashCode() { int hash = 0; unchecked { hash = hash * 23 + cloudMap.GetHashCode(); hash = hash * 23 + opacityR.GetHashCode(); hash = hash * 23 + opacityG.GetHashCode(); hash = hash * 23 + opacityB.GetHashCode(); hash = hash * 23 + opacityA.GetHashCode(); hash = hash * 23 + rotation.GetHashCode(); hash = hash * 23 + castShadows.GetHashCode(); if (lighting.value) { hash = hash * 23 + lighting.GetHashCode(); hash = hash * 23 + steps.GetHashCode(); hash = hash * 23 + thickness.GetHashCode(); } #if UNITY_EDITOR // In the editor, we want to rebake the texture if the texture content is modified if (cloudMap.value != null) { hash = hash * 23 + cloudMap.value.imageContentsHash.GetHashCode(); } #endif } return(hash); }
public int GetPrecomputationHashCode() { int hash = base.GetHashCode(); unchecked { // These parameters affect precomputation. hash = hash * 23 + earthPreset.GetHashCode(); hash = hash * 23 + planetaryRadius.GetHashCode(); hash = hash * 23 + groundTint.GetHashCode(); hash = hash * 23 + airMaximumAltitude.GetHashCode(); hash = hash * 23 + airDensityR.GetHashCode(); hash = hash * 23 + airDensityG.GetHashCode(); hash = hash * 23 + airDensityB.GetHashCode(); hash = hash * 23 + airTint.GetHashCode(); hash = hash * 23 + aerosolMaximumAltitude.GetHashCode(); hash = hash * 23 + aerosolDensity.GetHashCode(); hash = hash * 23 + aerosolTint.GetHashCode(); hash = hash * 23 + aerosolAnisotropy.GetHashCode(); hash = hash * 23 + numberOfBounces.GetHashCode(); } return(hash); }
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 + sunSize.value.GetHashCode(); hash = hash * 23 + sunSizeConvergence.value.GetHashCode(); hash = hash * 23 + atmosphereThickness.value.GetHashCode(); hash = hash * 23 + skyTint.value.GetHashCode(); hash = hash * 23 + groundColor.value.GetHashCode(); hash = hash * 23 + multiplier.value.GetHashCode(); hash = hash * 23 + enableSunDisk.value.GetHashCode(); hash = hash * 23 + sunSize.overrideState.GetHashCode(); hash = hash * 23 + sunSizeConvergence.overrideState.GetHashCode(); hash = hash * 23 + atmosphereThickness.overrideState.GetHashCode(); hash = hash * 23 + skyTint.overrideState.GetHashCode(); hash = hash * 23 + groundColor.overrideState.GetHashCode(); hash = hash * 23 + multiplier.overrideState.GetHashCode(); hash = hash * 23 + enableSunDisk.overrideState.GetHashCode(); #else hash = hash * 23 + sunSize.GetHashCode(); hash = hash * 23 + sunSizeConvergence.GetHashCode(); hash = hash * 23 + atmosphereThickness.GetHashCode(); hash = hash * 23 + skyTint.GetHashCode(); hash = hash * 23 + groundColor.GetHashCode(); hash = hash * 23 + multiplier.GetHashCode(); hash = hash * 23 + enableSunDisk.GetHashCode(); #endif } return(hash); }
/// <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); }
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); } }
internal int GetPrecomputationHashCode() { 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) // These parameters affect precomputation. hash = hash * 23 + earthPreset.overrideState.GetHashCode(); hash = hash * 23 + planetaryRadius.overrideState.GetHashCode(); hash = hash * 23 + groundTint.overrideState.GetHashCode(); hash = hash * 23 + airMaximumAltitude.overrideState.GetHashCode(); hash = hash * 23 + airDensityR.overrideState.GetHashCode(); hash = hash * 23 + airDensityG.overrideState.GetHashCode(); hash = hash * 23 + airDensityB.overrideState.GetHashCode(); hash = hash * 23 + airTint.overrideState.GetHashCode(); hash = hash * 23 + aerosolMaximumAltitude.overrideState.GetHashCode(); hash = hash * 23 + aerosolDensity.overrideState.GetHashCode(); hash = hash * 23 + aerosolTint.overrideState.GetHashCode(); hash = hash * 23 + aerosolAnisotropy.overrideState.GetHashCode(); hash = hash * 23 + numberOfBounces.overrideState.GetHashCode(); #else // These parameters affect precomputation. hash = hash * 23 + earthPreset.GetHashCode(); hash = hash * 23 + planetaryRadius.GetHashCode(); hash = hash * 23 + groundTint.GetHashCode(); hash = hash * 23 + airMaximumAltitude.GetHashCode(); hash = hash * 23 + airDensityR.GetHashCode(); hash = hash * 23 + airDensityG.GetHashCode(); hash = hash * 23 + airDensityB.GetHashCode(); hash = hash * 23 + airTint.GetHashCode(); hash = hash * 23 + aerosolMaximumAltitude.GetHashCode(); hash = hash * 23 + aerosolDensity.GetHashCode(); hash = hash * 23 + aerosolTint.GetHashCode(); hash = hash * 23 + aerosolAnisotropy.GetHashCode(); hash = hash * 23 + numberOfBounces.GetHashCode(); #endif } return(hash); }
/// <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 = cloudMap.value != null ? hash * 23 + cloudMap.value.GetHashCode() : hash; hash = flowmap.value != null ? hash * 23 + flowmap.value.GetHashCode() : hash; hash = hash * 23 + enabled.value.GetHashCode(); hash = hash * 23 + upperHemisphereOnly.value.GetHashCode(); hash = hash * 23 + tint.value.GetHashCode(); hash = hash * 23 + intensityMultiplier.value.GetHashCode(); hash = hash * 23 + rotation.value.GetHashCode(); hash = hash * 23 + enableDistortion.value.GetHashCode(); hash = hash * 23 + procedural.value.GetHashCode(); hash = hash * 23 + scrollDirection.value.GetHashCode(); hash = hash * 23 + scrollSpeed.value.GetHashCode(); hash = cloudMap.value != null ? hash * 23 + cloudMap.overrideState.GetHashCode() : hash; hash = flowmap.value != null ? hash * 23 + flowmap.overrideState.GetHashCode() : hash; hash = hash * 23 + enabled.overrideState.GetHashCode(); hash = hash * 23 + upperHemisphereOnly.overrideState.GetHashCode(); hash = hash * 23 + tint.overrideState.GetHashCode(); hash = hash * 23 + intensityMultiplier.overrideState.GetHashCode(); hash = hash * 23 + rotation.overrideState.GetHashCode(); hash = hash * 23 + enableDistortion.overrideState.GetHashCode(); hash = hash * 23 + procedural.overrideState.GetHashCode(); hash = hash * 23 + scrollDirection.overrideState.GetHashCode(); hash = hash * 23 + scrollSpeed.overrideState.GetHashCode(); #else hash = cloudMap.value != null ? hash * 23 + cloudMap.GetHashCode() : hash; hash = flowmap.value != null ? hash * 23 + flowmap.GetHashCode() : hash; hash = hash * 23 + enabled.GetHashCode(); hash = hash * 23 + upperHemisphereOnly.GetHashCode(); hash = hash * 23 + tint.GetHashCode(); hash = hash * 23 + intensityMultiplier.GetHashCode(); hash = hash * 23 + rotation.GetHashCode(); hash = hash * 23 + enableDistortion.GetHashCode(); hash = hash * 23 + procedural.GetHashCode(); hash = hash * 23 + scrollDirection.GetHashCode(); hash = hash * 23 + scrollSpeed.GetHashCode(); #endif } return(hash); }
public override int GetHashCode() { int hash = base.GetHashCode(); unchecked { hash = hash * 23 + sunSize.GetHashCode(); hash = hash * 23 + sunSizeConvergence.GetHashCode(); hash = hash * 23 + atmosphereThickness.GetHashCode(); hash = hash * 23 + skyTint.GetHashCode(); hash = hash * 23 + groundColor.GetHashCode(); hash = hash * 23 + multiplier.GetHashCode(); hash = hash * 23 + enableSunDisk.GetHashCode(); } return(hash); }
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(); hash = hash * 23 + includeSunInBaking.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); }
/// <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 { hash = hash * 23 + cloudMap.GetHashCode(); hash = hash * 23 + flowmap.GetHashCode(); hash = hash * 23 + enabled.GetHashCode(); hash = hash * 23 + upperHemisphereOnly.GetHashCode(); hash = hash * 23 + tint.GetHashCode(); hash = hash * 23 + intensityMultiplier.GetHashCode(); hash = hash * 23 + rotation.GetHashCode(); hash = hash * 23 + enableDistortion.GetHashCode(); hash = hash * 23 + procedural.GetHashCode(); hash = hash * 23 + scrollDirection.GetHashCode(); hash = hash * 23 + scrollSpeed.GetHashCode(); } 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); }