Skip to content

Commit 85f8877

Browse files
[HDRP] Fix rendering issues for the first frame (#2836)
* Fix first frame exposure, depth pyramid / AO * Update changelog * Comment * Typo * Add missing RenderGraphBuilder.ReadTexture call * Move ComputePackedMipChainInfo at the beginning of ExecuteWithRenderGraph Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
1 parent 7339d48 commit 85f8877

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2020
- Fixed issue with faulty shadow transition when view is close to an object under some aspect ratio conditions
2121
- Fixed NullPointerException when baking probes from the lighting window (case 1289680)
2222
- Fixed volumetric fog with XR single-pass rendering.
23+
- Fixed issues with first frame rendering when RenderGraph is used (auto exposure, AO)
2324

2425
### Changed
2526
- Removed the material pass probe volumes evaluation mode.

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,7 @@ TextureHandle DynamicExposurePass(RenderGraph renderGraph, HDCamera hdCamera, Te
317317
{
318318
passData.source = builder.ReadTexture(source);
319319
passData.parameters = PrepareApplyExposureParameters(hdCamera);
320-
RTHandle prevExp;
321-
GrabExposureHistoryTextures(hdCamera, out prevExp, out _);
322-
passData.prevExposure = builder.ReadTexture(renderGraph.ImportTexture(prevExp));
320+
passData.prevExposure = builder.ReadTexture(renderGraph.ImportTexture(GetPreviousExposureTexture(hdCamera)));
323321

324322
TextureHandle dest = GetPostprocessOutputHandle(renderGraph, "Apply Exposure Destination");
325323
passData.destination = builder.WriteTexture(dest);;

com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ void ExecuteWithRenderGraph(RenderRequest renderRequest,
3434

3535
m_RenderGraph.Begin(renderGraphParams);
3636

37+
// We need to initalize the MipChainInfo here, so it will be available to any render graph pass that wants to use it during setup
38+
m_DepthBufferMipChainInfo.ComputePackedMipChainInfo(new Vector2Int(hdCamera.actualWidth, hdCamera.actualHeight));
39+
3740
#if UNITY_EDITOR
3841
var showGizmos = camera.cameraType == CameraType.Game
3942
|| camera.cameraType == CameraType.SceneView;

0 commit comments

Comments
 (0)