public static string GetNoiseKeyword(HBAO.NoiseType noiseType) { switch (noiseType) { case HBAO.NoiseType.InterleavedGradientNoise: return("INTERLEAVED_GRADIENT_NOISE"); case HBAO.NoiseType.Dither: case HBAO.NoiseType.SpatialDistribution: default: return("__"); } }
private void UpdateMaterialProperties() { if (this.noiseTex == null || this._quality != this.generalSettings.quality || this._noiseType != this.generalSettings.noiseType) { if (this.noiseTex != null) { UnityEngine.Object.DestroyImmediate(this.noiseTex); } float num = (float)((this.generalSettings.noiseType != HBAO.NoiseType.Dither) ? 64 : 4); this.CreateRandomTexture((int)num); } this._quality = this.generalSettings.quality; this._noiseType = this.generalSettings.noiseType; this._radius = this.aoSettings.radius; this._maxRadiusPixels = this.aoSettings.maxRadiusPixels; this._bias = this.aoSettings.bias; this._intensity = this.aoSettings.intensity; this._luminanceInfluence = this.aoSettings.luminanceInfluence; this._maxDistance = this.aoSettings.maxDistance; this._distanceFalloff = this.aoSettings.distanceFalloff; this._perPixelNormals = this.aoSettings.perPixelNormals; this._aoBaseColor = this.aoSettings.baseColor; this._colorBleedingEnabled = this.colorBleedingSettings.enabled; this._colorBleedSaturation = this.colorBleedingSettings.saturation; this._albedoMultiplier = this.colorBleedingSettings.albedoMultiplier; this._blurAmount = this.blurSettings.amount; this._blurSharpness = this.blurSettings.sharpness; this._renderingPath = this._hbaoCamera.renderingPath; this._hbaoMaterial.SetTexture("_NoiseTex", this.noiseTex); this._hbaoMaterial.SetFloat("_NoiseTexSize", (float)((this._noiseType != HBAO.NoiseType.Dither) ? 64 : 4)); this._hbaoMaterial.SetFloat("_Radius", this._radius); this._hbaoMaterial.SetFloat("_MaxRadiusPixels", this._maxRadiusPixels); this._hbaoMaterial.SetFloat("_NegInvRadius2", -1f / (this._radius * this._radius)); this._hbaoMaterial.SetFloat("_AngleBias", this._bias); this._hbaoMaterial.SetFloat("_AOmultiplier", 2f * (1f / (1f - this._bias))); this._hbaoMaterial.SetFloat("_Intensity", this._intensity); this._hbaoMaterial.SetFloat("_LuminanceInfluence", this._luminanceInfluence); this._hbaoMaterial.SetFloat("_MaxDistance", this._maxDistance); this._hbaoMaterial.SetFloat("_DistanceFalloff", this._distanceFalloff); this._hbaoMaterial.SetColor("_BaseColor", this._aoBaseColor); this._hbaoMaterial.SetFloat("_ColorBleedSaturation", this._colorBleedSaturation); this._hbaoMaterial.SetFloat("_AlbedoMultiplier", this._albedoMultiplier); this._hbaoMaterial.SetFloat("_BlurSharpness", this._blurSharpness); }