summaryrefslogtreecommitdiffstats
path: root/tooner_lighting.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-07-28 14:14:30 -0700
committeryum <yum.food.vr@gmail.com>2024-07-28 14:14:30 -0700
commit22d3a28ef6ac9f4fc9204ae3bc0c67d82feac46e (patch)
tree1cfe361a86a731e630ceece702e7654ce62cfabf /tooner_lighting.cginc
parentaa932e9df0691f1de27fb44e06e8d786400c3d2a (diff)
Implement stereo instancing
Seems to fix VR flickering bug. Also: * Add vertex lighting factor * Remove clearcoat 10x factors * Lighting factors now affect clearcoat * Simplify `#pragma multi_compile` bits
Diffstat (limited to 'tooner_lighting.cginc')
-rw-r--r--tooner_lighting.cginc5
1 files changed, 3 insertions, 2 deletions
diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc
index cdc6e34..4531931 100644
--- a/tooner_lighting.cginc
+++ b/tooner_lighting.cginc
@@ -219,10 +219,10 @@ tess_data hull_vertex(appdata v)
{
tess_data o;
- UNITY_INITIALIZE_OUTPUT(tess_data, o);
UNITY_SETUP_INSTANCE_ID(v);
- UNITY_TRANSFER_INSTANCE_ID(v, o);
+ UNITY_INITIALIZE_OUTPUT(tess_data, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
+ UNITY_TRANSFER_INSTANCE_ID(v, o);
o.pos = v.vertex;
//o.vertex = UnityObjectToClipPos(v.vertex);
@@ -1340,6 +1340,7 @@ float4 effect(inout v2f i)
fixed4 frag(v2f i) : SV_Target
{
+ UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
return effect(i);
}