-
Notifications
You must be signed in to change notification settings - Fork 789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render graph support of RT and screen space shadows [Final] #1610
Conversation
It appears that you made a non-draft PR! |
a1fbf3c
to
c11f9d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke tested directionnal light RT shadows
tested denoiser / semi transparent and colored shadows
✔️
c11f9d5
to
007b212
Compare
@remi-chapelain added the remaining shadows to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smoke tested the whole RT stack one last time + made a build with every RT effect
Tested denoisers, forward/deferred, fallbacks and deactivating raytracing custom frame settings
Everything seems to look as expected ✔️
@@ -1586,7 +1590,7 @@ void RegisterRenderingDebug() | |||
widgetList.Add(new DebugUI.BoolField { displayName = "XR single-pass test mode", getter = () => data.xrSinglePassTestMode, setter = value => data.xrSinglePassTestMode = value }); | |||
} | |||
|
|||
//widgetList.Add(new DebugUI.BoolField { displayName = "Enable Render Graph", getter = () => HDRenderPipeline.currentPipeline.IsRenderGraphEnabled(), setter = value => HDRenderPipeline.currentPipeline.EnableRenderGraph(value) }); | |||
widgetList.Add(new DebugUI.BoolField { displayName = "Enable Render Graph", getter = () => HDRenderPipeline.currentPipeline.IsRenderGraphEnabled(), setter = value => HDRenderPipeline.currentPipeline.EnableRenderGraph(value) }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to revert back to commented before pushing the PR.
dimension = TextureDimension.Tex2DArray, | ||
filterMode = FilterMode.Point, | ||
enableRandomWrite = true, | ||
useDynamicScale = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useDynamicScale is already set by the first param of the TextureDesc constructor so you can remove it as it is redundant in this case.
passData.motionVectorsBuffer = builder.ReadTexture(motionVectorsBuffer); | ||
if (hdCamera.frameSettings.litShaderMode == LitShaderMode.Deferred) | ||
{ | ||
passData.gbuffer0 = prepassOutput.gbuffer.mrt[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these textures read? Seems like it's missing a builder.ReadTexture here
...s.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerDirectional.RenderGraph.cs
Show resolved
Hide resolved
{ | ||
// If it is screen space but not ray traced, then we can rely on the shadow map | ||
// WARNING: This pattern only works because we can only have one directional and the directional shadow is evaluated first. | ||
CoreUtils.SetRenderTarget(cmd, textureArray, depthSlice: sssdParams.depthSlice); | ||
cmd.SetGlobalTexture(HDShaderIDs._NormalBufferTexture, normalBuffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using SetGlobal is dangerous in the context of RenderGraph since it breaks the contract about lifetime of textures.
Please use a MaterialPropertyBlock along with the material to set this parameter.
...ines.high-definition/Runtime/Lighting/Shadow/ScreenSpaceShadowManagerPunctual.RenderGraph.cs
Show resolved
Hide resolved
passData.depthStencilBuffer = builder.UseDepthBuffer(depthStencilBuffer, DepthAccess.Read); | ||
passData.normalBuffer = builder.ReadTexture(normalBuffer); | ||
passData.sssColor = builder.ReadTexture(sssColor); | ||
passData.intermediateBuffer0 = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the intermediateBuffersX are only used in this pass. Shouldn't they use CreateTransientTexture?
{ colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 2" })); | ||
passData.intermediateBuffer3 = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) | ||
{ colorFormat = GraphicsFormat.R16G16B16A16_SFloat, enableRandomWrite = true, name = "Intermediate Texture 3" })); | ||
passData.directionBuffer = builder.WriteTexture(renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for directionBuffer
...nity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs
Show resolved
Hide resolved
int kernelSize, float angularDiameter, bool singleChannel = true) | ||
{ | ||
// Request the intermediate buffer we need | ||
RTHandle intermediateBuffer = m_RenderPipeline.GetRayTracingBuffer(InternalRayTracingBuffers.RGBA3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to be used.
int kernelSize, Vector3 lightPosition, float lightRadius) | ||
{ | ||
// Request the intermediate buffer we need | ||
RTHandle intermediateBuffer = m_RenderPipeline.GetRayTracingBuffer(InternalRayTracingBuffers.RGBA3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above (also, the format does not match the one in the render graph pass. Is that intended? Or is RGBA3 not what I think it is?)
return renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true) | ||
{ | ||
colorFormat = GraphicsFormat.R8_SNorm, | ||
slices = TextureXR.slices , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slices, dimension and useDynamicScale are already set by the 2 parameters of the TextureDesc constructor so they are redundant here.
...pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingRecursiveRenderer.cs
Show resolved
Hide resolved
int kernelSize, bool singleChannel) | ||
{ | ||
// Request the intermediate buffer we need | ||
RTHandle intermediateBuffer = m_RenderPipeline.GetRayTracingBuffer(InternalRayTracingBuffers.RGBA3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover again?
passData.normalBuffer = builder.ReadTexture(normalBuffer); | ||
passData.motionVectorBuffer = builder.ReadTexture(motionVectorBuffer); | ||
passData.velocityBuffer = renderGraph.defaultResources.blackTextureXR; | ||
passData.historyDepthTexture = renderGraph.ImportTexture(hdCamera.GetCurrentFrameRT((int)HDCameraFrameHistoryType.Depth)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing read/write info on imported buffers here. It won't have an impact since imported buffer's lifetime is not handled by rendergraph but it can be used for debug display purpose so it's better to be consistent and specify it for imported buffers as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a few comments.
Check Read/Writes |
…he pipeline. Enabled the reflection tests for the render graph variant.
Enabling RR, RTSSS and other tests for render graph.
Enabling the remaining dxr (non-pt) tests
f6f1d69
to
d888754
Compare
Doing the Rendergraph implementation for RTAO and required denoisers. Enabling the render graph compatibiliity on RTAO tests.
Doing the Rendergraph implementation ray traced reflection support for the render graph version of the pipeline.
Doing the Rendergraph implementation for RTGI and required denoisers.
Doing the Rendergraph implementation for RTSSS and RR.
Doing the Rendergraph implementation for ray traced and screen space shadow.
Testing status
Render graph tests (DXR) that were enabled are green (All but Path tracing)
All the non-RG tests are also green (DXR)