A game about forced loneliness, made by TACStudios
1Shader "Hidden/CoreSRP/CoreCopy"
2{
3 SubShader
4 {
5 Tags { "RenderType" = "Opaque" }
6 ZClip Off
7 ZTest Off
8 ZWrite Off Cull Off
9 Pass
10 {
11 Name "Copy"
12
13 HLSLPROGRAM
14 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
15 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl"
16 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureXR.hlsl"
17 #include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
18
19 #pragma vertex Vert
20 #pragma fragment CopyFrag
21
22
23 // Declares the framebuffer input as a texture 2d containing half.
24 FRAMEBUFFER_INPUT_FLOAT(0);
25
26 // Out frag function takes as input a struct that contains the screen space coordinate we are going to use to sample our texture. It also writes to SV_Target0, this has to match the index set in the UseTextureFragment(sourceTexture, 0, …) we defined in our render pass script.
27 float4 CopyFrag(Varyings input) : SV_Target0
28 {
29 // read the current pixel from the framebuffer
30 float2 uv = input.texcoord.xy;
31 // read previous subpasses directly from the framebuffer.
32 half4 color = LOAD_FRAMEBUFFER_INPUT(0, input.positionCS.xy);
33
34 // Modify the sampled color
35 return color;
36 }
37 ENDHLSL
38 }
39
40 Tags { "RenderType" = "Opaque" }
41 ZClip Off
42 ZTest Off
43 ZWrite Off Cull Off
44 Pass
45 {
46 Name "CopyMS"
47
48 HLSLPROGRAM
49 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
50 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl"
51 #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureXR.hlsl"
52 #include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
53
54 #pragma vertex Vert
55 #pragma fragment CopyFragMS
56 #pragma target 4.5
57 #pragma require msaatex
58
59 // Declares the framebuffer input as a texture 2d containing half.
60 FRAMEBUFFER_INPUT_FLOAT_MS(0);
61
62 // Out frag function takes as input a struct that contains the screen space coordinate we are going to use to sample our texture. It also writes to SV_Target0, this has to match the index set in the UseTextureFragment(sourceTexture, 0, …) we defined in our render pass script.
63 float4 CopyFragMS(Varyings input, uint sampleID : SV_SampleIndex) : SV_Target0
64 {
65 // read the current pixel from the framebuffer
66 float2 uv = input.texcoord.xy;
67 // read previous subpasses directly from the framebuffer.
68 half4 color = LOAD_FRAMEBUFFER_INPUT_MS(0, sampleID, input.positionCS.xy);
69
70 // Modify the sampled color
71 return color;
72 }
73 ENDHLSL
74 }
75 }
76}
77