Skip to content

Commit

Permalink
Thanks Kaitlyn (Fixes #112)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinsi55 committed Nov 28, 2024
1 parent df60e99 commit b99e139
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Shaders/VolumetricBlit.shader
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Shader "Custom/VolumetricBlit" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
_MainTex ("Texture", any) = "white" {}
}
SubShader {
ColorMask RGB
Expand Down Expand Up @@ -31,14 +31,15 @@ Shader "Custom/VolumetricBlit" {
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);

o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;

return o;
}

fixed4 frag(v2f i) : SV_Target {
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); //Insert

return tex2D(_MainTex, i.uv);
return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.uv);
}
ENDCG
}
Expand Down Expand Up @@ -69,9 +70,10 @@ Shader "Custom/VolumetricBlit" {
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);

v.vertex = UnityObjectToClipPos(v.vertex);
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.texcoord.xy;
// For back face, we mirror the texture so that it appears right way around from both sides
v.texcoord.x = 1 - v.texcoord.x;
o.uv.x = 1 - o.uv.x;

return o;
}
Expand All @@ -84,4 +86,4 @@ Shader "Custom/VolumetricBlit" {
ENDCG
}
}
}
}
Binary file modified Shaders/camera2utilsvr
Binary file not shown.

0 comments on commit b99e139

Please sign in to comment.