Skip to content

Commit 891a586

Browse files
committed
Added cameraDepthFlags
1 parent d614c5e commit 891a586

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

PostProcessing/Runtime/PostProcessLayer.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ public sealed class SerializedBundleRef
164164

165165
public Dictionary<PostProcessEvent, List<SerializedBundleRef>> sortedBundles { get; private set; }
166166

167+
public DepthTextureMode cameraDepthFlags { get; private set; }
168+
167169
// We need to keep track of bundle initialization because for some obscure reason, on
168170
// assembly reload a MonoBehavior's Editor OnEnable will be called BEFORE the MonoBehavior's
169171
// own OnEnable... So we'll use it to pre-init bundles if the layer inspector is opened and
@@ -717,7 +719,7 @@ internal void OverrideSettings(List<PostProcessEffectSettings> baseSettings, flo
717719
// scriptable render pipelines.
718720
void SetLegacyCameraFlags(PostProcessRenderContext context)
719721
{
720-
var flags = context.camera.depthTextureMode;
722+
var flags = DepthTextureMode.None;
721723

722724
foreach (var bundle in m_Bundles)
723725
{
@@ -735,7 +737,8 @@ void SetLegacyCameraFlags(PostProcessRenderContext context)
735737
if (debugLayer.debugOverlay != DebugOverlay.None)
736738
flags |= debugLayer.GetCameraFlags();
737739

738-
context.camera.depthTextureMode = flags;
740+
context.camera.depthTextureMode |= flags;
741+
cameraDepthFlags = flags;
739742
}
740743

741744
/// <summary>

0 commit comments

Comments
 (0)