void UpdateParams() { if (_FogVolumeCamera && _Downsample > 1) { _FogVolumeCamera.useBilateralUpsampling = BilateralUpsampling; // _FogVolumeCamera._GenerateDepth = GenerateDepth; if (BilateralUpsampling && GenerateDepth) { _FogVolumeCamera.upsampleMode = USMode; _FogVolumeCamera.showBilateralEdge = ShowBilateralEdge; _FogVolumeCamera.upsampleDepthThreshold = upsampleDepthThreshold; } if (GenerateDepth) { SurrogateMaterial.SetInt("_ztest", (int)UnityEngine.Rendering.CompareFunction.Always); //_FogVolumeCamera.DepthMask = instance.DepthLayer; // _FogVolumeCamera.DepthMask = ThisCamera.cullingMask; //_FogVolumeCamera.DepthMask &= ~(1 << DepthLayer2); DepthLayer2 &= ~(1 << LayerMask.NameToLayer("FogVolume")); //hide FogVolume DepthLayer2 &= ~(1 << LayerMask.NameToLayer("FogVolumeShadowCaster")); //hide FogVolumeShadowCaster DepthLayer2 &= ~(1 << LayerMask.NameToLayer("FogVolumeSurrogate")); //hide FogVolumeSurrogate DepthLayer2 &= ~(1 << LayerMask.NameToLayer("FogVolumeUniform")); //hide FogVolumeUniform DepthLayer2 &= ~(1 << LayerMask.NameToLayer("UI")); //hide UI _FogVolumeCamera.DepthMask = DepthLayer2; } else { SurrogateMaterial.SetInt("_ztest", (int)UnityEngine.Rendering.CompareFunction.LessEqual); } if (!_TAA) { TAASetup(); } if (_TAA && _TAA.enabled != TAA) { _TAA.enabled = TAA; _TAAvelocity.enabled = TAA; } #if UNITY_5_6_OR_NEWER HDR = ThisCamera.allowHDR; #else HDR = ThisCamera.hdr; #endif } }
void UpdateParams() { if (_FogVolumeCamera && _Downsample > 0) { _FogVolumeCamera.useBilateralUpsampling = BilateralUpsampling; // _FogVolumeCamera._GenerateDepth = GenerateDepth; if (BilateralUpsampling && GenerateDepth) { _FogVolumeCamera.upsampleMode = USMode; _FogVolumeCamera.showBilateralEdge = ShowBilateralEdge; _FogVolumeCamera.upsampleDepthThreshold = upsampleDepthThreshold; } if (GenerateDepth) { SurrogateMaterial.SetInt("_ztest", (int)UnityEngine.Rendering.CompareFunction.Always); } else { SurrogateMaterial.SetInt("_ztest", (int)UnityEngine.Rendering.CompareFunction.LessEqual); } if (!_TAA) { TAASetup(); } if (_TAA && _TAA.enabled != TAA) { _TAA.enabled = TAA; _TAAvelocity.enabled = TAA; } #if UNITY_5_6_OR_NEWER HDR = ThisCamera.allowHDR; #else HDR = ThisCamera.hdr; #endif } }