Skip to content

Commit 7655f87

Browse files
Fix DepthOfField CoC debug view (#3466)
* Push stuff for debug * changelog Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
1 parent 5d7fb34 commit 7655f87

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2727
- Fix screen being over-exposed when changing very different skies.
2828
- Fixed incorrect debug wireframe overlay on tessellated geometry (using littessellation), caused by the picking pass using an incorrect camera matrix.
2929
- Fixed nullref in layered lit shader editor.
30+
- Fix issue with Depth of Field CoC debug view.
3031

3132
### Changed
3233
- Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard

com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.RenderGraph.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,8 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu
504504
passData.farCoC = TextureHandle.nullHandle;
505505
}
506506

507-
passData.fullresCoC = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true)
508-
{ colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Full res CoC" });
507+
passData.fullresCoC = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true)
508+
{ colorFormat = k_CoCFormat, enableRandomWrite = true, name = "Full res CoC" }));
509509

510510
GetDoFResolutionScale(passData.parameters, out float unused, out float resolutionScale);
511511
float actualNearMaxBlur = passData.parameters.nearMaxBlur * resolutionScale;
@@ -557,11 +557,13 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu
557557
});
558558

559559
source = passData.destination;
560+
561+
m_HDInstance.PushFullScreenDebugTexture(renderGraph, passData.fullresCoC, FullScreenDebugMode.DepthOfFieldCoc);
560562
}
561563
else
562564
{
563-
passData.fullresCoC = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true)
564-
{ colorFormat = k_CoCFormat, enableRandomWrite = true, useMipMap = true, name = "Full res CoC" });
565+
passData.fullresCoC = builder.ReadWriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true)
566+
{ colorFormat = k_CoCFormat, enableRandomWrite = true, useMipMap = true, name = "Full res CoC" }));
565567

566568
passData.pingFarRGB = builder.CreateTransientTexture(new TextureDesc(Vector2.one, true, true)
567569
{ colorFormat = m_ColorFormat, useMipMap = true, enableRandomWrite = true, name = "DoF Source Pyramid" });
@@ -573,6 +575,7 @@ TextureHandle DepthOfFieldPass(RenderGraph renderGraph, HDCamera hdCamera, Textu
573575
});
574576

575577
source = passData.destination;
578+
m_HDInstance.PushFullScreenDebugTexture(renderGraph, passData.fullresCoC, FullScreenDebugMode.DepthOfFieldCoc);
576579
}
577580
}
578581
}

0 commit comments

Comments
 (0)