Created
December 21, 2021 23:14
-
-
Save ShiftedClock/4eafed152bfda59a2ccb6f1c120a5682 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Shader "FullScreen/CopyColorAndDepth" | |
| { | |
| HLSLINCLUDE | |
| #pragma vertex Vert | |
| #pragma target 4.5 | |
| #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch | |
| #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl" | |
| TEXTURE2D_X(rayMarchColorOutput); | |
| TEXTURE2D_X(rayMarchDepthOutput); | |
| float4 FullScreenPass(Varyings varyings, out float depth : SV_Depth) : SV_Target | |
| { | |
| const uint3 id = uint3(varyings.positionCS.xy,0); | |
| depth = rayMarchDepthOutput[id]; | |
| return rayMarchColorOutput[id]; | |
| } | |
| ENDHLSL | |
| SubShader | |
| { | |
| Pass | |
| { | |
| Name "CopyColorAndDepth" | |
| ZWrite On | |
| ZTest Always | |
| Blend Off | |
| Cull Off | |
| HLSLPROGRAM | |
| #pragma fragment FullScreenPass | |
| ENDHLSL | |
| } | |
| } | |
| Fallback Off | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment