-
Notifications
You must be signed in to change notification settings - Fork 792
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
[HDRP] Fullscreen subtarget feature #6141
Conversation
… is compatible with current RP
# Conflicts: # TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset
TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset
Outdated
Show resolved
Hide resolved
...ity.render-pipelines.high-definition/Editor/Material/ShaderGraph/Nodes/HDSampleBufferNode.cs
Outdated
Show resolved
Hide resolved
...der-pipelines.high-definition/Editor/RenderPipeline/CustomPass/FullScreenCustomPassDrawer.cs
Outdated
Show resolved
Hide resolved
com.unity.render-pipelines.high-definition/Runtime/Debug/DebugLightVolumes.shader
Show resolved
Hide resolved
// For now we fake the GI sampling in fullscreen. | ||
float3 SampleBakedGI(float3 positionRWS, float3 normalWS, float2 uvStaticLightmap, float2 uvDynamicLightmap) | ||
{ | ||
return 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.
I am not sure to understand why we need a new file just for this? why is it here?
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 is to avoid including all the lighting includes for the fullscreen shder.
...nity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs
Show resolved
Hide resolved
....render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPass.cs
Show resolved
Hide resolved
...ender-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/DrawRenderersCustomPass.cs
Outdated
Show resolved
Hide resolved
# Conflicts: # TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset
…ementation # Conflicts: # TestProjects/BuiltInGraphicsTest_Foundation/Assets/Scenes/070_FullscreenEffects.meta # TestProjects/HDRP_Tests/ProjectSettings/EditorBuildSettings.asset # com.unity.render-pipelines.high-definition/Editor/RenderPipeline/CustomPass/FullScreenCustomPassDrawer.cs # com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/HDRenderPipeline.RenderGraph.cs # com.unity.render-pipelines.universal/Editor/ShaderGraph/Nodes/UniversalSampleBufferNode.cs # com.unity.shadergraph/Editor/Generation/Targets/BuiltIn/Editor/ShaderGraph/Targets/BuiltInTarget.cs # com.unity.shadergraph/Editor/Generation/Targets/CustomRenderTexture/CustomRenderTextureTarget.cs # com.unity.shadergraph/Editor/Generation/Targets/CustomRenderTexture/CustomTexture.hlsl # com.unity.shadergraph/Editor/Generation/Targets/CustomRenderTexture/CustomTextureGraph.hlsl # com.unity.shadergraph/Editor/Generation/Targets/CustomRenderTexture/CustomTextureNodes.cs # com.unity.shadergraph/Editor/Generation/Targets/CustomRenderTexture/CustomTextureSubShader.template # com.unity.shadergraph/Editor/Generation/Targets/CustomRenderTexture/CustomTextureSubTarget.cs # com.unity.shadergraph/Editor/Generation/Targets/Fullscreen/FullscreenData.cs # com.unity.shadergraph/Editor/Generation/Targets/Fullscreen/FullscreenShaderGUI.cs # com.unity.shadergraph/Editor/Generation/Targets/Fullscreen/FullscreenSubTarget.cs # com.unity.shadergraph/Editor/Generation/Targets/Fullscreen/Includes/FullscreenCommon.hlsl # com.unity.shadergraph/Editor/Generation/Targets/Fullscreen/Includes/FullscreenDrawProcedural.hlsl # com.unity.shadergraph/Editor/Generation/Targets/Fullscreen/Templates/SharedCode.template.hlsl
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.
Took over for while @TomasKiniulis was OoO.
Here's what I've tested:
- Created a brand new custom post process (simple thing that distorts UV when sampling PP inputs) with full screen shader master node to made sure I understood the feature.
- Did not managed to repro the issue mentionned earlier with DX12 (has been fixed) ✔️
- Metal issue is supposed to be fixed but can't verify (no hardware but trusting antoine on this) ✔️
- Tested all DRS algorithms in software / hardware (dx12)
⚠️ (some issues) - Pair-tested in Built-in with @alelievr using two different methods. Working as expected ✔️
- --- First one is by using post process package in built in and feeding it a material made with shader graph full screen master node. ✔️
- --- Second one is by overriding the render of the camera using the "OnRenderImage()" function by blit-ing the source texture into the destination using a temporary buffer in between to avoid read/write issues. ✔️
For the details about issues for DRS, what I've found is depending on what is sampled in the HDSampleBuffer node, FSR gives slightly darker results but ONLY when roughness or WSnormals are sampled.
Does NOT seem to repro when using IsSky, PostProcess or MotionVectors for some reasons.
https://user-images.githubusercontent.com/57442369/140384575-182694b6-44c8-4076-9b1e-9d11ff9677b1.mp4
Replaced by #6943 |
Purpose of this PR
Included in this PR:
HD Scene depth node to sample the depth with mips
HD Sample Buffers node, allows to access normal, roughness, motion vectors, and post-process input in ShaderGraph.
Full support of stencil in custom passes (in DrawRenderers and Fullscreen custom passes)
If you have any questions regarding this feature, you can ask in #devs-fullscreen-master-node.
Testing status
Fullscreen target test doc: https://confluence.unity3d.com/display/HDRP/Fullscreen+Target
Automated tests have also been added for basic features of the fullscreen SG with custom post-process and custom passes (tests cover alpha blending, stencil, and fullscreen UVs).
Note for QA:
This work is split into 3 PRs for ease of reviewing. If you want to test everything (URP, HDRP, and builtin implementation) I'd recommend to use the sg/fullscreen-target branch