Skip to content

Commit

Permalink
Modified cross section sphere shader to handle stereo rendering. (mla…
Browse files Browse the repository at this point in the history
riccardolops authored Dec 1, 2023
1 parent 502bd67 commit 63d3e0d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Assets/Shaders/CrossSectionSphere.shader
Original file line number Diff line number Diff line change
@@ -20,21 +20,26 @@ Shader "Custom/RimOutlineShader" {
float4 _RimColor;

struct appdata {
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 vertex : POSITION;
float3 normal : NORMAL;
};

struct v2f {
UNITY_VERTEX_OUTPUT_STEREO
float3 worldNormal : TEXCOORD0;
float3 worldPos : TEXCOORD1;
float4 vertex : SV_POSITION;
};

v2f vert(appdata v) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex);
o.worldNormal = UnityObjectToWorldNormal(v.normal);
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}

0 comments on commit 63d3e0d

Please sign in to comment.