diff --git a/Assets/Resources/Brushes/Basic/Bubbles/Bubbles.shader b/Assets/Resources/Brushes/Basic/Bubbles/Bubbles.shader index dea9e9ba06..424d6cd6a2 100644 --- a/Assets/Resources/Brushes/Basic/Bubbles/Bubbles.shader +++ b/Assets/Resources/Brushes/Basic/Bubbles/Bubbles.shader @@ -52,6 +52,8 @@ Category { float4 vertex : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -81,6 +83,11 @@ Category { v2f vert (ParticleVertexWithSpread_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.color = TbVertToSrgb(v.color); float birthTime = v.texcoord.w; float rotation = v.texcoord.z; diff --git a/Assets/Resources/Brushes/Basic/CelVinyl/CelVinyl.shader b/Assets/Resources/Brushes/Basic/CelVinyl/CelVinyl.shader index 66ff61b6b4..c5420d8b58 100644 --- a/Assets/Resources/Brushes/Basic/CelVinyl/CelVinyl.shader +++ b/Assets/Resources/Brushes/Basic/CelVinyl/CelVinyl.shader @@ -46,6 +46,8 @@ Shader "Brush/Special/CelVinyl" { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; float4 color : COLOR; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -53,6 +55,8 @@ Shader "Brush/Special/CelVinyl" { float2 texcoord : TEXCOORD0; float4 color : COLOR; UNITY_FOG_COORDS(1) + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -61,6 +65,10 @@ Shader "Brush/Special/CelVinyl" { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; o.color = TbVertToNative(v.color); diff --git a/Assets/Resources/Brushes/Basic/ChromaticWave/ChromaticWave.shader b/Assets/Resources/Brushes/Basic/ChromaticWave/ChromaticWave.shader index 2661540554..d83130bd96 100644 --- a/Assets/Resources/Brushes/Basic/ChromaticWave/ChromaticWave.shader +++ b/Assets/Resources/Brushes/Basic/ChromaticWave/ChromaticWave.shader @@ -50,6 +50,8 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -57,6 +59,8 @@ Category { float4 color : COLOR; float2 texcoord : TEXCOORD0; float4 unbloomedColor : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -64,6 +68,11 @@ Category { PrepForOds(v.vertex); v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; o.color = bloomColor(v.color, _EmissionGain); diff --git a/Assets/Resources/Brushes/Basic/Comet/Comet.shader b/Assets/Resources/Brushes/Basic/Comet/Comet.shader index ebeabe7cdf..0347d2d8ec 100644 --- a/Assets/Resources/Brushes/Basic/Comet/Comet.shader +++ b/Assets/Resources/Brushes/Basic/Comet/Comet.shader @@ -54,12 +54,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float3 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; @@ -68,6 +72,10 @@ Category { PrepForOds(v.vertex); v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = TbVertToNative(v.color); diff --git a/Assets/Resources/Brushes/Basic/DanceFloor/DanceFloor.shader b/Assets/Resources/Brushes/Basic/DanceFloor/DanceFloor.shader index f6122f477c..117dee7c82 100644 --- a/Assets/Resources/Brushes/Basic/DanceFloor/DanceFloor.shader +++ b/Assets/Resources/Brushes/Basic/DanceFloor/DanceFloor.shader @@ -51,6 +51,8 @@ Category { float2 texcoord : TEXCOORD0; float4 texcoord1 : TEXCOORD1; float3 normal : NORMAL; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -58,6 +60,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float3 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -66,6 +70,11 @@ Category { { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float4 worldPos = mul(unity_ObjectToWorld, v.vertex); float waveform = 0; diff --git a/Assets/Resources/Brushes/Basic/Dots/Dots.shader b/Assets/Resources/Brushes/Basic/Dots/Dots.shader index f1a5a11635..12e0f7013a 100644 --- a/Assets/Resources/Brushes/Basic/Dots/Dots.shader +++ b/Assets/Resources/Brushes/Basic/Dots/Dots.shader @@ -57,6 +57,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float waveform : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -69,6 +71,11 @@ Category { { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float birthTime = v.texcoord.w; float rotation = v.texcoord.z; float halfSize = GetParticleHalfSize(v.corner.xyz, v.center, birthTime); diff --git a/Assets/Resources/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader b/Assets/Resources/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader index 547bc89444..a8f7d4e6f3 100644 --- a/Assets/Resources/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader +++ b/Assets/Resources/Brushes/Basic/DoubleTaperedMarker/DoubleTaperedMarker.shader @@ -45,6 +45,8 @@ Category { fixed4 color : COLOR; float2 texcoord0 : TEXCOORD0; float3 texcoord1 : TEXCOORD1; //per vert offset vector + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -52,6 +54,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; UNITY_FOG_COORDS(1) + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -63,6 +67,11 @@ Category { // v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float envelope = sin(v.texcoord0.x * 3.14159); float widthMultiplier = 1 - envelope; v.vertex.xyz += -v.texcoord1 * widthMultiplier; diff --git a/Assets/Resources/Brushes/Basic/Electricity/Electricity.shader b/Assets/Resources/Brushes/Basic/Electricity/Electricity.shader index 6c298e5f05..f8f3f9c877 100644 --- a/Assets/Resources/Brushes/Basic/Electricity/Electricity.shader +++ b/Assets/Resources/Brushes/Basic/Electricity/Electricity.shader @@ -40,6 +40,8 @@ CGINCLUDE float3 tangent : TANGENT; float2 texcoord0 : TEXCOORD0; float3 texcoord1 : TEXCOORD1; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; sampler2D _MainTex; @@ -50,6 +52,8 @@ CGINCLUDE float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float3 displacement(float3 pos, float mod) { @@ -77,6 +81,11 @@ CGINCLUDE PrepForOds(v.vertex); v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float envelope = sin(v.texcoord0.x * (3.14159)); float envelopePow = (1-pow(1 - envelope, 10)); diff --git a/Assets/Resources/Brushes/Basic/Embers/Embers.shader b/Assets/Resources/Brushes/Basic/Embers/Embers.shader index d0db8272d0..eace4ad726 100644 --- a/Assets/Resources/Brushes/Basic/Embers/Embers.shader +++ b/Assets/Resources/Brushes/Basic/Embers/Embers.shader @@ -57,6 +57,8 @@ Category { float4 vertex : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -103,6 +105,11 @@ Category { v2f vert (ParticleVertexWithSpread_t v) { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // Used as a random-ish seed for various calculations float seed = v.color.a; float t01 = fmod(_Time.y*_ScrollRate + seed * 10, 1); diff --git a/Assets/Resources/Brushes/Basic/Fire/Fire.shader b/Assets/Resources/Brushes/Basic/Fire/Fire.shader index 61c21cae07..dd9a74597e 100644 --- a/Assets/Resources/Brushes/Basic/Fire/Fire.shader +++ b/Assets/Resources/Brushes/Basic/Fire/Fire.shader @@ -58,6 +58,8 @@ Category { float2 texcoord : TEXCOORD0; #endif float3 worldPos : TEXCOORD1; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -69,6 +71,8 @@ Category { float2 texcoord : TEXCOORD0; #endif float3 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -82,6 +86,11 @@ Category { PrepForOds(v.vertex); v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(v.color, _EmissionGain); o.pos = UnityObjectToClipPos(v.vertex); diff --git a/Assets/Resources/Brushes/Basic/Highlighter/AdditiveCutout.shader b/Assets/Resources/Brushes/Basic/Highlighter/AdditiveCutout.shader index 27d922b446..d24a59f20f 100644 --- a/Assets/Resources/Brushes/Basic/Highlighter/AdditiveCutout.shader +++ b/Assets/Resources/Brushes/Basic/Highlighter/AdditiveCutout.shader @@ -44,12 +44,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -59,6 +63,11 @@ Category { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = TbVertToNative(v.color); diff --git a/Assets/Resources/Brushes/Basic/HyperGrid/HyperGrid.shader b/Assets/Resources/Brushes/Basic/HyperGrid/HyperGrid.shader index 790081c610..b0a2de014e 100644 --- a/Assets/Resources/Brushes/Basic/HyperGrid/HyperGrid.shader +++ b/Assets/Resources/Brushes/Basic/HyperGrid/HyperGrid.shader @@ -52,12 +52,16 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float4 texcoord1 : TEXCOORD1; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -66,6 +70,11 @@ Category { { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // Subtract out the Canvas space pose to keep the verts from popping around while // transforming (e.g. apply quantization in an immutable space). float4 worldPos = mul(unity_ObjectToWorld, v.vertex); diff --git a/Assets/Resources/Brushes/Basic/Plasma/Plasma.shader b/Assets/Resources/Brushes/Basic/Plasma/Plasma.shader index 5f5a683612..d1f3415744 100644 --- a/Assets/Resources/Brushes/Basic/Plasma/Plasma.shader +++ b/Assets/Resources/Brushes/Basic/Plasma/Plasma.shader @@ -60,6 +60,7 @@ Category { float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -67,6 +68,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float3 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -82,6 +85,11 @@ Category { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.worldPos = mul(unity_ObjectToWorld, v.vertex); o.vertex = UnityObjectToClipPos(v.vertex); o.color = v.color; diff --git a/Assets/Resources/Brushes/Basic/Rainbow/Rainbow.shader b/Assets/Resources/Brushes/Basic/Rainbow/Rainbow.shader index ce63a3df28..f79f60beaa 100644 --- a/Assets/Resources/Brushes/Basic/Rainbow/Rainbow.shader +++ b/Assets/Resources/Brushes/Basic/Rainbow/Rainbow.shader @@ -45,12 +45,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -62,6 +66,11 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color; diff --git a/Assets/Resources/Brushes/Basic/Smoke/Smoke.shader b/Assets/Resources/Brushes/Basic/Smoke/Smoke.shader index 663788ac4d..7d617ff37e 100644 --- a/Assets/Resources/Brushes/Basic/Smoke/Smoke.shader +++ b/Assets/Resources/Brushes/Basic/Smoke/Smoke.shader @@ -50,6 +50,8 @@ Category { float4 pos : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -82,6 +84,11 @@ Category { { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float birthTime = v.texcoord.w; float rotation = v.texcoord.z; float halfSize = GetParticleHalfSize(v.corner.xyz, v.center, birthTime); diff --git a/Assets/Resources/Brushes/Basic/Snow/Snow.shader b/Assets/Resources/Brushes/Basic/Snow/Snow.shader index 4df99c8731..8a6df60fcb 100644 --- a/Assets/Resources/Brushes/Basic/Snow/Snow.shader +++ b/Assets/Resources/Brushes/Basic/Snow/Snow.shader @@ -54,6 +54,8 @@ Category { float4 vertex : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -66,6 +68,11 @@ Category { v2f vert (ParticleVertexWithSpread_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.color = TbVertToSrgb(v.color); float birthTime = v.texcoord.w; float rotation = v.texcoord.z; diff --git a/Assets/Resources/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader b/Assets/Resources/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader index d9a4de7ccf..375a55c682 100644 --- a/Assets/Resources/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader +++ b/Assets/Resources/Brushes/Basic/SoftHighlighter/SoftHighlighter.shader @@ -44,12 +44,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -60,6 +64,11 @@ Category { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); #ifdef AUDIO_REACTIVE v.color = TbVertToSrgb(v.color); diff --git a/Assets/Resources/Brushes/Basic/Stars/Stars.shader b/Assets/Resources/Brushes/Basic/Stars/Stars.shader index c3e031f30d..39bd0b40c4 100644 --- a/Assets/Resources/Brushes/Basic/Stars/Stars.shader +++ b/Assets/Resources/Brushes/Basic/Stars/Stars.shader @@ -55,6 +55,8 @@ Category { float4 vertex : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (ParticleVertexWithSpread_t v) @@ -62,6 +64,11 @@ Category { v.color = TbVertToSrgb(v.color); const float PI = 3.14159265359; v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float birthTime = v.texcoord.w; float rotation = v.texcoord.z; float halfSize = GetParticleHalfSize(v.corner.xyz, v.center, birthTime); diff --git a/Assets/Resources/Brushes/Basic/Streamers/Streamers.shader b/Assets/Resources/Brushes/Basic/Streamers/Streamers.shader index f3b3226200..5cf7c9928a 100644 --- a/Assets/Resources/Brushes/Basic/Streamers/Streamers.shader +++ b/Assets/Resources/Brushes/Basic/Streamers/Streamers.shader @@ -54,6 +54,8 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -61,6 +63,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float4 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -75,6 +79,11 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.worldPos = mul(unity_ObjectToWorld, v.vertex); o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); diff --git a/Assets/Resources/Brushes/Basic/Toon/Toon.shader b/Assets/Resources/Brushes/Basic/Toon/Toon.shader index bd9ec6bbe1..822f58aba5 100644 --- a/Assets/Resources/Brushes/Basic/Toon/Toon.shader +++ b/Assets/Resources/Brushes/Basic/Toon/Toon.shader @@ -37,6 +37,8 @@ CGINCLUDE fixed4 color : COLOR; float3 normal : NORMAL; float3 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -44,6 +46,8 @@ CGINCLUDE fixed4 color : COLOR; float2 texcoord : TEXCOORD0; UNITY_FOG_COORDS(1) + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vertInflate (appdata_t v, float inflate) @@ -51,6 +55,11 @@ CGINCLUDE PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float outlineEnabled = inflate; float radius = v.texcoord.z; inflate *= radius * .4; diff --git a/Assets/Resources/Brushes/Basic/TubeToonInverted/TubeToonInverted.shader b/Assets/Resources/Brushes/Basic/TubeToonInverted/TubeToonInverted.shader index b1b046219a..5a78545aed 100644 --- a/Assets/Resources/Brushes/Basic/TubeToonInverted/TubeToonInverted.shader +++ b/Assets/Resources/Brushes/Basic/TubeToonInverted/TubeToonInverted.shader @@ -32,12 +32,16 @@ CGINCLUDE fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vertInflate (appdata_t v, float inflate) @@ -45,6 +49,11 @@ CGINCLUDE PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.xyz += v.normal.xyz * inflate; o.vertex = UnityObjectToClipPos(v.vertex); o.color = v.color; diff --git a/Assets/Resources/Brushes/Basic/VelvetInk/VelvetInk.shader b/Assets/Resources/Brushes/Basic/VelvetInk/VelvetInk.shader index 8c3e6567ec..e33df527cc 100644 --- a/Assets/Resources/Brushes/Basic/VelvetInk/VelvetInk.shader +++ b/Assets/Resources/Brushes/Basic/VelvetInk/VelvetInk.shader @@ -44,12 +44,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -60,6 +64,11 @@ Category { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); #ifdef AUDIO_REACTIVE v.color = TbVertToSrgb(v.color); diff --git a/Assets/Resources/Brushes/Basic/Waveform/Waveform.shader b/Assets/Resources/Brushes/Basic/Waveform/Waveform.shader index 4c2d52614f..65886f9f5c 100644 --- a/Assets/Resources/Brushes/Basic/Waveform/Waveform.shader +++ b/Assets/Resources/Brushes/Basic/Waveform/Waveform.shader @@ -52,6 +52,8 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -59,6 +61,8 @@ Category { float4 color : COLOR; float2 texcoord : TEXCOORD0; float4 unbloomedColor : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -67,6 +71,11 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(v.color, _EmissionGain); diff --git a/Assets/Resources/Brushes/Basic/WaveformFFT/WaveformFFT.shader b/Assets/Resources/Brushes/Basic/WaveformFFT/WaveformFFT.shader index 99b44d84ad..02c305f1d7 100644 --- a/Assets/Resources/Brushes/Basic/WaveformFFT/WaveformFFT.shader +++ b/Assets/Resources/Brushes/Basic/WaveformFFT/WaveformFFT.shader @@ -50,6 +50,8 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -57,6 +59,8 @@ Category { float4 color : COLOR; float2 texcoord : TEXCOORD0; float4 unbloomedColor : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -64,6 +68,11 @@ Category { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(v.color, _EmissionGain); diff --git a/Assets/Resources/Brushes/Basic/WaveformParticles/WaveformParticles.shader b/Assets/Resources/Brushes/Basic/WaveformParticles/WaveformParticles.shader index 2dde166182..571b28c101 100644 --- a/Assets/Resources/Brushes/Basic/WaveformParticles/WaveformParticles.shader +++ b/Assets/Resources/Brushes/Basic/WaveformParticles/WaveformParticles.shader @@ -52,6 +52,8 @@ Category { float2 texcoord : TEXCOORD0; float4 texcoord1 : TEXCOORD1; float3 tangent : TANGENT; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -60,6 +62,8 @@ Category { float2 texcoord : TEXCOORD0; float3 worldPos : TEXCOORD1; float lifetime : TEXCOORD2; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -69,6 +73,11 @@ Category { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float4 worldPos = mul(unity_ObjectToWorld, v.vertex); float3 perVertOffset = v.texcoord1.xyz; float lifetime = _Time.y - v.texcoord1.w; diff --git a/Assets/Resources/Brushes/Basic/WaveformTube/WaveformTube.shader b/Assets/Resources/Brushes/Basic/WaveformTube/WaveformTube.shader index f8ba357bfa..f902469cde 100644 --- a/Assets/Resources/Brushes/Basic/WaveformTube/WaveformTube.shader +++ b/Assets/Resources/Brushes/Basic/WaveformTube/WaveformTube.shader @@ -48,12 +48,16 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -61,6 +65,11 @@ Category { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); diff --git a/Assets/Resources/Brushes/Basic/Wireframe/Wireframe.shader b/Assets/Resources/Brushes/Basic/Wireframe/Wireframe.shader index 3c6647f9e4..fc6e8dbec2 100644 --- a/Assets/Resources/Brushes/Basic/Wireframe/Wireframe.shader +++ b/Assets/Resources/Brushes/Basic/Wireframe/Wireframe.shader @@ -38,12 +38,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -54,6 +58,10 @@ Category { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.texcoord = v.texcoord; o.color = v.color; o.vertex = UnityObjectToClipPos(v.vertex); diff --git a/Assets/Resources/Brushes/Shared/Shaders/Additive.shader b/Assets/Resources/Brushes/Shared/Shaders/Additive.shader index a8468642c6..84a2e89ec7 100644 --- a/Assets/Resources/Brushes/Shared/Shaders/Additive.shader +++ b/Assets/Resources/Brushes/Shared/Shaders/Additive.shader @@ -47,12 +47,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -62,6 +66,10 @@ Category { PrepForOds(v.vertex); v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); #ifdef AUDIO_REACTIVE o.color = musicReactiveColor(v.color, _BeatOutput.w); diff --git a/Assets/Resources/Brushes/Shared/Shaders/Bloom.shader b/Assets/Resources/Brushes/Shared/Shaders/Bloom.shader index a9f4832ffb..9bfc021ac5 100644 --- a/Assets/Resources/Brushes/Shared/Shaders/Bloom.shader +++ b/Assets/Resources/Brushes/Shared/Shaders/Bloom.shader @@ -47,12 +47,16 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -60,6 +64,11 @@ Category { PrepForOds(v.vertex); v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(v.color, _EmissionGain); #ifdef AUDIO_REACTIVE diff --git a/Assets/Resources/Brushes/Shared/Shaders/Multiplicative.shader b/Assets/Resources/Brushes/Shared/Shaders/Multiplicative.shader index abff89a122..d1e34c826e 100644 --- a/Assets/Resources/Brushes/Shared/Shaders/Multiplicative.shader +++ b/Assets/Resources/Brushes/Shared/Shaders/Multiplicative.shader @@ -42,12 +42,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -57,6 +61,11 @@ Category { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color; diff --git a/Assets/Resources/Brushes/Shared/Shaders/Special/Faceted.shader b/Assets/Resources/Brushes/Shared/Shaders/Special/Faceted.shader index b78bf838f9..7d0a208fce 100644 --- a/Assets/Resources/Brushes/Shared/Shaders/Special/Faceted.shader +++ b/Assets/Resources/Brushes/Shared/Shaders/Special/Faceted.shader @@ -37,6 +37,8 @@ SubShader { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -44,12 +46,19 @@ SubShader { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float3 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.color = v.color; o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); diff --git a/Assets/Resources/Brushes/Shared/Shaders/Special/Intersection.shader b/Assets/Resources/Brushes/Shared/Shaders/Special/Intersection.shader index c20575062a..82a574e3ae 100644 --- a/Assets/Resources/Brushes/Shared/Shaders/Special/Intersection.shader +++ b/Assets/Resources/Brushes/Shared/Shaders/Special/Intersection.shader @@ -34,6 +34,7 @@ Shader "Brush/Special/Intersection" { #pragma fragment frag #pragma geometry geom +#include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" #include "Assets/Shaders/Include/PackInt.cginc" @@ -45,6 +46,8 @@ Shader "Brush/Special/Intersection" { struct appdata_t { float4 vertex : POSITION; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -55,12 +58,18 @@ Shader "Brush/Special/Intersection" { #if TILT_ENABLE_CONSERVATIVE_RASTER // Saves some overhead when unused. float4 aabb : TEXCOORD1; float4 clipPos : TEXCOORD2; -#endif + #endif + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.worldPos = mul(unity_ObjectToWorld, v.vertex); o.color = half4(0, 0, 0, 0); diff --git a/Assets/Resources/Brushes/Shared/Shaders/Special/IntersectionDownsample.shader b/Assets/Resources/Brushes/Shared/Shaders/Special/IntersectionDownsample.shader index 2d7529cabf..b65f91228a 100644 --- a/Assets/Resources/Brushes/Shared/Shaders/Special/IntersectionDownsample.shader +++ b/Assets/Resources/Brushes/Shared/Shaders/Special/IntersectionDownsample.shader @@ -48,6 +48,8 @@ Shader "Brush/Special/IntersectionDownsample" { { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f @@ -55,11 +57,18 @@ Shader "Brush/Special/IntersectionDownsample" { // WARNING: If an interpolation modifier is added to uv, code must be updated below. float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; diff --git a/Assets/Resources/Brushes/Shared/Shaders/Special/IntersectionNonGeomFallback.shader b/Assets/Resources/Brushes/Shared/Shaders/Special/IntersectionNonGeomFallback.shader index 4074f2b113..0853929f18 100644 --- a/Assets/Resources/Brushes/Shared/Shaders/Special/IntersectionNonGeomFallback.shader +++ b/Assets/Resources/Brushes/Shared/Shaders/Special/IntersectionNonGeomFallback.shader @@ -33,23 +33,33 @@ Shader "Brush/Special/Intersection" { #pragma vertex vert #pragma fragment frag +#include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" #include "Assets/Shaders/Include/PackInt.cginc" struct appdata_t { float4 vertex : POSITION; float4 triangleids : TEXCOORD4; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float4 triangleids : TEXCOORD4; half4 color : COLOR; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.color = half4(0, 0, 0, 0); o.triangleids = v.triangleids; diff --git a/Assets/Resources/Brushes/Shared/Shaders/Unlit.shader b/Assets/Resources/Brushes/Shared/Shaders/Unlit.shader index f63524ec8a..4042dae5a7 100644 --- a/Assets/Resources/Brushes/Shared/Shaders/Unlit.shader +++ b/Assets/Resources/Brushes/Shared/Shaders/Unlit.shader @@ -44,6 +44,8 @@ SubShader { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; float4 color : COLOR; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -51,6 +53,8 @@ SubShader { float2 texcoord : TEXCOORD0; float4 color : COLOR; UNITY_FOG_COORDS(1) + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -58,6 +62,10 @@ SubShader { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; diff --git a/Assets/Resources/X/Brushes/Digital/Digital.shader b/Assets/Resources/X/Brushes/Digital/Digital.shader index 50784a8bf1..e0fa19e7f3 100644 --- a/Assets/Resources/X/Brushes/Digital/Digital.shader +++ b/Assets/Resources/X/Brushes/Digital/Digital.shader @@ -50,6 +50,8 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -57,6 +59,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float2 st : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -68,6 +72,11 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color; diff --git a/Assets/Resources/X/Brushes/Drafting/Drafting.shader b/Assets/Resources/X/Brushes/Drafting/Drafting.shader index 3431e9be5b..1273bd89f5 100644 --- a/Assets/Resources/X/Brushes/Drafting/Drafting.shader +++ b/Assets/Resources/X/Brushes/Drafting/Drafting.shader @@ -47,18 +47,27 @@ Shader "Brush/Special/Drafting" { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color * _DraftingVisibility01; diff --git a/Assets/Resources/X/Brushes/Fairy/Fairy.shader b/Assets/Resources/X/Brushes/Fairy/Fairy.shader index 1a7f1e9cc6..db1ad45573 100644 --- a/Assets/Resources/X/Brushes/Fairy/Fairy.shader +++ b/Assets/Resources/X/Brushes/Fairy/Fairy.shader @@ -48,12 +48,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -65,6 +69,11 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color; diff --git a/Assets/Resources/X/Brushes/Fire 2/Fire2.shader b/Assets/Resources/X/Brushes/Fire 2/Fire2.shader index 211f229e94..41a0578f73 100644 --- a/Assets/Resources/X/Brushes/Fire 2/Fire2.shader +++ b/Assets/Resources/X/Brushes/Fire 2/Fire2.shader @@ -63,6 +63,8 @@ Category { float2 texcoord : TEXCOORD0; #endif float3 worldPos : TEXCOORD1; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -74,6 +76,8 @@ Category { float2 texcoord : TEXCOORD0; #endif float3 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -92,6 +96,11 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(v.color, _EmissionGain); o.vertex = UnityObjectToClipPos(v.vertex); diff --git a/Assets/Resources/X/Brushes/Race/Race.shader b/Assets/Resources/X/Brushes/Race/Race.shader index 00006a8b68..c41925c035 100644 --- a/Assets/Resources/X/Brushes/Race/Race.shader +++ b/Assets/Resources/X/Brushes/Race/Race.shader @@ -51,12 +51,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -68,6 +72,11 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color; diff --git a/Assets/Resources/X/Brushes/Rain/Rain.shader b/Assets/Resources/X/Brushes/Rain/Rain.shader index 25ed45da53..ddb013f371 100644 --- a/Assets/Resources/X/Brushes/Rain/Rain.shader +++ b/Assets/Resources/X/Brushes/Rain/Rain.shader @@ -55,6 +55,8 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -62,6 +64,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float4 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; @@ -72,6 +76,10 @@ Category { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // Inflate the tube outward to explode it into // strips - giving us negative space w/o as much overdraw. _Bulge = 2.25; diff --git a/Assets/Resources/X/Brushes/RisingBubbles/RisingBubbles.shader b/Assets/Resources/X/Brushes/RisingBubbles/RisingBubbles.shader index 348e386c39..fbdeac431a 100644 --- a/Assets/Resources/X/Brushes/RisingBubbles/RisingBubbles.shader +++ b/Assets/Resources/X/Brushes/RisingBubbles/RisingBubbles.shader @@ -55,6 +55,8 @@ Category { float4 vertex : SV_POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -87,6 +89,11 @@ Category { v2f vert (ParticleVertexWithSpread_t v) { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // Used as a random-ish seed for various calculations float seed = v.color.a; float t01 = fmod(_Time.y*_ScrollRate + seed * 10, 1); diff --git a/Assets/Resources/X/Brushes/Slice/Slice.shader b/Assets/Resources/X/Brushes/Slice/Slice.shader index 1c46d57a15..a24e42c769 100644 --- a/Assets/Resources/X/Brushes/Slice/Slice.shader +++ b/Assets/Resources/X/Brushes/Slice/Slice.shader @@ -43,12 +43,16 @@ Category { // fixed4 color : COLOR; // float3 normal : NORMAL; float3 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; // fixed4 color : COLOR; float3 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -57,6 +61,11 @@ Category { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; return o; diff --git a/Assets/Resources/X/Brushes/Space/Space.shader b/Assets/Resources/X/Brushes/Space/Space.shader index 3f120badd0..1f7620cdc4 100644 --- a/Assets/Resources/X/Brushes/Space/Space.shader +++ b/Assets/Resources/X/Brushes/Space/Space.shader @@ -50,12 +50,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -67,6 +71,11 @@ Category { v.color = TbVertToSrgb(v.color); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = v.color; diff --git a/Assets/Resources/X/Brushes/Sparks/Sparks.shader b/Assets/Resources/X/Brushes/Sparks/Sparks.shader index 7aae2db97b..263b1fa546 100644 --- a/Assets/Resources/X/Brushes/Sparks/Sparks.shader +++ b/Assets/Resources/X/Brushes/Sparks/Sparks.shader @@ -54,12 +54,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -77,6 +81,10 @@ Category { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // This multiplier is a magic number but it's still not right. Is there a better // multiplciation for this (not using fmod) so I can count on the "lifetime" being contstant? /* diff --git a/Assets/Resources/X/Brushes/TaperedHueShift/TaperedHueShift.shader b/Assets/Resources/X/Brushes/TaperedHueShift/TaperedHueShift.shader index 73a7f09007..80e4db5187 100644 --- a/Assets/Resources/X/Brushes/TaperedHueShift/TaperedHueShift.shader +++ b/Assets/Resources/X/Brushes/TaperedHueShift/TaperedHueShift.shader @@ -42,6 +42,8 @@ SubShader { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; float4 color : COLOR; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -49,6 +51,8 @@ SubShader { float2 texcoord : TEXCOORD0; float4 color : COLOR; UNITY_FOG_COORDS(1) + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) @@ -57,6 +61,11 @@ SubShader { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; o.color = TbVertToNative(v.color); diff --git a/Assets/Resources/X/Brushes/Wind/Wind.shader b/Assets/Resources/X/Brushes/Wind/Wind.shader index 6df6d7bd40..d1d9d9bfc0 100644 --- a/Assets/Resources/X/Brushes/Wind/Wind.shader +++ b/Assets/Resources/X/Brushes/Wind/Wind.shader @@ -49,12 +49,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; @@ -63,6 +67,10 @@ Category { PrepForOds(v.vertex); v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = TbVertToNative(v.color); o.vertex = UnityObjectToClipPos(v.vertex); diff --git a/Assets/Scripts/Rendering/Selection/StencilToMask.shader b/Assets/Scripts/Rendering/Selection/StencilToMask.shader index a0ea55277d..bb532b5894 100644 --- a/Assets/Scripts/Rendering/Selection/StencilToMask.shader +++ b/Assets/Scripts/Rendering/Selection/StencilToMask.shader @@ -14,10 +14,6 @@ Shader "Hidden/StencilToMask" { - Properties - { - _MainTex ("Texture", 2D) = "white" {} - } SubShader { // No culling or depth @@ -41,24 +37,31 @@ Shader "Hidden/StencilToMask" { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } - sampler2D _MainTex; - fixed4 frag (v2f i) : SV_Target { fixed4 col = float4(1,1,1,1); @@ -85,24 +88,31 @@ Shader "Hidden/StencilToMask" { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } - sampler2D _MainTex; - fixed4 frag (v2f i) : SV_Target { fixed4 col = float4(0,0,0,1); diff --git a/Assets/Shaders/AmbientGrid.shader b/Assets/Shaders/AmbientGrid.shader index 78baec1337..9e33207c96 100644 --- a/Assets/Shaders/AmbientGrid.shader +++ b/Assets/Shaders/AmbientGrid.shader @@ -51,6 +51,8 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -58,6 +60,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float viewdist : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -68,6 +72,10 @@ Category { PrepForOds(v.vertex); v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.color = v.color; diff --git a/Assets/Shaders/AngleIndicator.shader b/Assets/Shaders/AngleIndicator.shader index 286d6fe3dd..102f7a7262 100644 --- a/Assets/Shaders/AngleIndicator.shader +++ b/Assets/Shaders/AngleIndicator.shader @@ -41,17 +41,25 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float4 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float3 uv : TEXCOORD0; + UNITY_VERTEX_OUTPUT_STEREO + }; v2f vert (appdata_t v) { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float age = _Time.y; o.vertex = UnityObjectToClipPos(v.vertex); diff --git a/Assets/Shaders/AssetLoading.shader b/Assets/Shaders/AssetLoading.shader index cc4b0a94c5..31e70458a3 100644 --- a/Assets/Shaders/AssetLoading.shader +++ b/Assets/Shaders/AssetLoading.shader @@ -43,16 +43,24 @@ SubShader { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); return o; diff --git a/Assets/Shaders/AudioReactiveBrushIcon.shader b/Assets/Shaders/AudioReactiveBrushIcon.shader index f00b098a0c..bccc066cad 100644 --- a/Assets/Shaders/AudioReactiveBrushIcon.shader +++ b/Assets/Shaders/AudioReactiveBrushIcon.shader @@ -26,6 +26,8 @@ Shader "Custom/AudioReactiveBrushIcon" { CGPROGRAM #pragma vertex vert #pragma fragment frag + + #include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" sampler2D _MainTex; @@ -36,16 +38,25 @@ Shader "Custom/AudioReactiveBrushIcon" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.xyz += v.vertex.xyz * _BeatOutput.x * .1; o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; diff --git a/Assets/Shaders/AudioReactiveIcon.shader b/Assets/Shaders/AudioReactiveIcon.shader index f633e7a3dd..de023e43a3 100644 --- a/Assets/Shaders/AudioReactiveIcon.shader +++ b/Assets/Shaders/AudioReactiveIcon.shader @@ -30,6 +30,8 @@ Shader "Custom/AudioReactiveIcon" { #pragma target 3.0 #pragma multi_compile __ AUDIO_REACTIVE #pragma multi_compile __ HDR_EMULATED HDR_SIMPLE + + #include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" #include "Assets/Shaders/Include/Hdr.cginc" @@ -42,16 +44,25 @@ Shader "Custom/AudioReactiveIcon" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + #ifdef AUDIO_REACTIVE v.vertex.xyz += v.vertex.xyz * .2; v.vertex.z += -.2; diff --git a/Assets/Shaders/Blended.shader b/Assets/Shaders/Blended.shader index 594665ce46..c809cd60c1 100644 --- a/Assets/Shaders/Blended.shader +++ b/Assets/Shaders/Blended.shader @@ -41,12 +41,16 @@ Category { fixed4 color : COLOR; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -55,6 +59,10 @@ Category { { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); #ifdef AUDIO_REACTIVE o.color = musicReactiveColor(v.color, _BeatOutput.w); diff --git a/Assets/Shaders/BlitDownsample.shader b/Assets/Shaders/BlitDownsample.shader index 0acb1d81b3..58cafd612a 100644 --- a/Assets/Shaders/BlitDownsample.shader +++ b/Assets/Shaders/BlitDownsample.shader @@ -38,27 +38,38 @@ Shader "Hidden/BlitDownsample" { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv * _Scale; return o; } - sampler2D _MainTex; + UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); fixed4 frag (v2f i) : SV_Target { - return tex2D(_MainTex, i.uv); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + + return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.uv); } ENDCG } diff --git a/Assets/Shaders/BlitLdrPmaOverlay.shader b/Assets/Shaders/BlitLdrPmaOverlay.shader index ac9aa82de4..08bf5868c2 100644 --- a/Assets/Shaders/BlitLdrPmaOverlay.shader +++ b/Assets/Shaders/BlitLdrPmaOverlay.shader @@ -36,22 +36,30 @@ Shader "Custom/BlitLdrPmaOverlay" { struct v2f { float4 pos : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(appdata_img v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.uv = MultiplyUV(UNITY_MATRIX_TEXTURE0, v.texcoord.xy); return o; } - sampler2D _MainTex; - sampler2D _OverlayTex; + UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); + UNITY_DECLARE_SCREENSPACE_TEXTURE(_OverlayTex); float4 _OverlayUvRange; float4 frag(v2f i) : COLOR { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); // Get the original color. - float4 mainTex = tex2D(_MainTex, i.uv); + float4 mainTex = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.uv); // Calculate the overlay's texture coordinates. float2 uvMin = _OverlayUvRange.xy; @@ -60,7 +68,7 @@ Shader "Custom/BlitLdrPmaOverlay" { float2 overlayUV = saturate((i.uv - uvMin) / uvSize); // Get the overlay color. - float4 overlayTex = tex2D(_OverlayTex, overlayUV); + float4 overlayTex = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_OverlayTex, overlayUV); // Composite the result. return (1.0f - overlayTex.a) * saturate(mainTex) + overlayTex; diff --git a/Assets/Shaders/BlitLinearToGamma.shader b/Assets/Shaders/BlitLinearToGamma.shader index 858be19730..31e0f7b45a 100644 --- a/Assets/Shaders/BlitLinearToGamma.shader +++ b/Assets/Shaders/BlitLinearToGamma.shader @@ -31,21 +31,29 @@ ZTest Always Cull Off ZWrite Off Fog { Mode Off } //Rendering settings struct v2f { float4 pos : POSITION; half2 uv : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; //Our Vertex Shader v2f vert (appdata_img v){ v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = MultiplyUV (UNITY_MATRIX_TEXTURE0, v.texcoord.xy); return o; } - sampler2D _MainTex; //Reference in Pass is necessary to let us use this variable in shaders + UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); //Reference in Pass is necessary to let us use this variable in shaders //Our Fragment Shader fixed4 frag (v2f i) : COLOR{ - fixed4 tex = tex2D(_MainTex, i.uv); //Get the orginal rendered color + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + fixed4 tex = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.uv); //Get the orginal rendered color return pow(tex, 1.0/2.2); } ENDCG diff --git a/Assets/Shaders/BlitToCompute.shader b/Assets/Shaders/BlitToCompute.shader index 158eadf608..52e4b07bbd 100644 --- a/Assets/Shaders/BlitToCompute.shader +++ b/Assets/Shaders/BlitToCompute.shader @@ -36,29 +36,40 @@ Shader "Hidden/BlitToCompute" { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } - sampler2D _MainTex; + UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); float4 _MainTex_TexelSize; RWStructuredBuffer _CaptureBuffer : register(u1); fixed4 frag (v2f i) : SV_Target { - float4 c = tex2D(_MainTex, i.uv); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + + float4 c = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.uv); float4 cOut = c; // Make sure to ignore non-zero alpha. diff --git a/Assets/Shaders/BlitWatermark.shader b/Assets/Shaders/BlitWatermark.shader index e527b97dff..9a82fda400 100644 --- a/Assets/Shaders/BlitWatermark.shader +++ b/Assets/Shaders/BlitWatermark.shader @@ -32,21 +32,29 @@ Blend SrcAlpha OneMinusSrcAlpha // Alpha blending struct v2f { float4 pos : POSITION; half2 uv : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; //Our Vertex Shader v2f vert (appdata_img v){ v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos (v.vertex); o.uv = MultiplyUV (UNITY_MATRIX_TEXTURE0, v.texcoord.xy); return o; } - sampler2D _MainTex; //Reference in Pass is necessary to let us use this variable in shaders + UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); //Reference in Pass is necessary to let us use this variable in shaders //Our Fragment Shader fixed4 frag (v2f i) : COLOR{ - fixed4 tex = tex2D(_MainTex, i.uv); //Get the orginal rendered color + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + fixed4 tex = UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, i.uv); //Get the orginal rendered color return tex; } ENDCG diff --git a/Assets/Shaders/BrowserButton.shader b/Assets/Shaders/BrowserButton.shader index 45e5bd8aa8..2745d4ee94 100644 --- a/Assets/Shaders/BrowserButton.shader +++ b/Assets/Shaders/BrowserButton.shader @@ -28,6 +28,8 @@ Shader "Custom/BrowserButton" { #pragma vertex vert #pragma fragment frag #pragma multi_compile __ HDR_EMULATED HDR_SIMPLE + + #include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" #include "Assets/Shaders/Include/Hdr.cginc" @@ -39,16 +41,25 @@ Shader "Custom/BrowserButton" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + if (_Activated) v.vertex.xyz += float3(0,0,-0.1); o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; diff --git a/Assets/Shaders/CircularProgress.shader b/Assets/Shaders/CircularProgress.shader index a81bc47384..ae77d00607 100644 --- a/Assets/Shaders/CircularProgress.shader +++ b/Assets/Shaders/CircularProgress.shader @@ -44,12 +44,16 @@ Shader "Unlit/CircularProgress" { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; float _Progress; @@ -62,6 +66,11 @@ Shader "Unlit/CircularProgress" v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; diff --git a/Assets/Shaders/ColorPicker_hl_s.shader b/Assets/Shaders/ColorPicker_hl_s.shader index 21e9990f98..2109955536 100644 --- a/Assets/Shaders/ColorPicker_hl_s.shader +++ b/Assets/Shaders/ColorPicker_hl_s.shader @@ -20,8 +20,9 @@ Properties { } CGINCLUDE + #include "UnityCG.cginc" #include "Assets/Shaders/Include/ColorSpace.cginc" - #include "Assets/Shaders/Include/Hdr.cginc" + #include "Assets/Shaders/Include/Hdr.cginc" float _Slider01; fixed4 _Color; @@ -29,11 +30,15 @@ CGINCLUDE float4 vertex : POSITION; float2 texcoord : TEXCOORD0; float4 tangent : TANGENT; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 texcoord : TEXCOORD0; float4 pos : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; ENDCG @@ -58,6 +63,11 @@ SubShader { v2f vert(appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.z += v.vertex.z + 0.05; o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; @@ -83,6 +93,11 @@ SubShader { v2f vert(appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; return o; diff --git a/Assets/Shaders/ColorPicker_hs_l.shader b/Assets/Shaders/ColorPicker_hs_l.shader index 25628a3f1d..5516c23903 100644 --- a/Assets/Shaders/ColorPicker_hs_l.shader +++ b/Assets/Shaders/ColorPicker_hs_l.shader @@ -20,8 +20,10 @@ Properties { } CGINCLUDE + + #include "UnityCG.cginc" #include "Assets/Shaders/Include/ColorSpace.cginc" - #include "Assets/Shaders/Include/Hdr.cginc" + #include "Assets/Shaders/Include/Hdr.cginc" float _Slider01; fixed4 _Color; @@ -29,11 +31,15 @@ CGINCLUDE float4 vertex : POSITION; float2 texcoord : TEXCOORD0; float4 tangent : TANGENT; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 texcoord : TEXCOORD0; float4 pos : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; ENDCG @@ -56,6 +62,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.z += v.vertex.z + 0.05; o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; @@ -82,6 +93,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; return o; diff --git a/Assets/Shaders/ColorPicker_hs_logv.shader b/Assets/Shaders/ColorPicker_hs_logv.shader index 844d0a2a37..7680839273 100644 --- a/Assets/Shaders/ColorPicker_hs_logv.shader +++ b/Assets/Shaders/ColorPicker_hs_logv.shader @@ -19,8 +19,9 @@ Properties { _Slider01 ("Slider", Range(0,1)) = 0.5 } CGINCLUDE + #include "UnityCG.cginc" #include "Assets/Shaders/Include/ColorSpace.cginc" - #include "Assets/Shaders/Include/Hdr.cginc" + #include "Assets/Shaders/Include/Hdr.cginc" float _Slider01; fixed4 _Color; @@ -28,11 +29,15 @@ CGINCLUDE float4 vertex : POSITION; float2 texcoord : TEXCOORD0; float4 tangent : TANGENT; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 texcoord : TEXCOORD0; float4 pos : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; ENDCG @@ -56,6 +61,11 @@ SubShader { v2f vert(appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.z += v.vertex.z + 0.05; o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; @@ -85,6 +95,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; return o; diff --git a/Assets/Shaders/ColorPicker_sl_h.shader b/Assets/Shaders/ColorPicker_sl_h.shader index 19586d096f..bac7eb3eb9 100644 --- a/Assets/Shaders/ColorPicker_sl_h.shader +++ b/Assets/Shaders/ColorPicker_sl_h.shader @@ -20,8 +20,9 @@ Properties { } CGINCLUDE + #include "UnityCG.cginc" #include "Assets/Shaders/Include/ColorSpace.cginc" - #include "Assets/Shaders/Include/Hdr.cginc" + #include "Assets/Shaders/Include/Hdr.cginc" float _Slider01; fixed4 _Color; @@ -29,11 +30,15 @@ CGINCLUDE float4 vertex : POSITION; float2 texcoord : TEXCOORD0; float4 tangent : TANGENT; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 texcoord : TEXCOORD0; float4 pos : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; ENDCG @@ -57,6 +62,11 @@ SubShader { v2f vert(appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.z += v.vertex.z + 0.05; o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; @@ -80,6 +90,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; return o; diff --git a/Assets/Shaders/ColorPicker_sv_h.shader b/Assets/Shaders/ColorPicker_sv_h.shader index 762bdb07dc..80797ce02e 100644 --- a/Assets/Shaders/ColorPicker_sv_h.shader +++ b/Assets/Shaders/ColorPicker_sv_h.shader @@ -20,8 +20,9 @@ Properties { } CGINCLUDE + #include "UnityCG.cginc" #include "Assets/Shaders/Include/ColorSpace.cginc" - #include "Assets/Shaders/Include/Hdr.cginc" + #include "Assets/Shaders/Include/Hdr.cginc" float _Slider01; fixed4 _Color; @@ -29,11 +30,15 @@ CGINCLUDE float4 vertex : POSITION; float2 texcoord : TEXCOORD0; float4 tangent : TANGENT; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 texcoord : TEXCOORD0; float4 pos : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; ENDCG @@ -57,6 +62,11 @@ SubShader { v2f vert(appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.vertex.z += v.vertex.z + 0.05; o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; @@ -80,6 +90,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; return o; diff --git a/Assets/Shaders/ControllerXRay.shader b/Assets/Shaders/ControllerXRay.shader index 62aae24a4a..463e6a9dab 100644 --- a/Assets/Shaders/ControllerXRay.shader +++ b/Assets/Shaders/ControllerXRay.shader @@ -48,17 +48,26 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float3 normal : NORMAL; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; v2f vert (appdata_t v) { v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/Assets/Shaders/DefaultMaterialPreview.shader b/Assets/Shaders/DefaultMaterialPreview.shader index baba359209..d43cd67c85 100644 --- a/Assets/Shaders/DefaultMaterialPreview.shader +++ b/Assets/Shaders/DefaultMaterialPreview.shader @@ -41,11 +41,15 @@ Category { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -53,6 +57,11 @@ Category { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); return o; diff --git a/Assets/Shaders/FixDistortion.shader b/Assets/Shaders/FixDistortion.shader index d09b2f7a1d..24ada22a3b 100644 --- a/Assets/Shaders/FixDistortion.shader +++ b/Assets/Shaders/FixDistortion.shader @@ -47,10 +47,17 @@ Shader "Custom/FixDistortion" { float4 position : SV_POSITION; float2 uv : TEXCOORD0; float4 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; fragment_input vert(appdata_img v) { fragment_input o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(fragment_input, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.position = UnityObjectToClipPos(v.vertex); o.uv = MultiplyUV(UNITY_MATRIX_TEXTURE0, v.texcoord); o.worldPos = mul(unity_ObjectToWorld, v.vertex); diff --git a/Assets/Shaders/FixDistortionAndReveal.shader b/Assets/Shaders/FixDistortionAndReveal.shader index 668b9d26a4..f476fb043f 100644 --- a/Assets/Shaders/FixDistortionAndReveal.shader +++ b/Assets/Shaders/FixDistortionAndReveal.shader @@ -61,10 +61,17 @@ Shader "Custom/FixDistortionAndReveal" { float4 position : SV_POSITION; float2 uv : TEXCOORD0; float4 worldPos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; fragment_input vert(appdata_img v) { fragment_input o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(fragment_input, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.position = UnityObjectToClipPos(v.vertex); o.uv = MultiplyUV(UNITY_MATRIX_TEXTURE0, v.texcoord); o.worldPos = mul(unity_ObjectToWorld, v.vertex + float4(_LocalSpaceOffset,0,0,0)); diff --git a/Assets/Shaders/FlatLit.shader b/Assets/Shaders/FlatLit.shader index 73dcd8906d..16843a4db1 100644 --- a/Assets/Shaders/FlatLit.shader +++ b/Assets/Shaders/FlatLit.shader @@ -48,6 +48,8 @@ SubShader { float4 vertex : POSITION; float2 uv : TEXCOORD0; float4 color : Color; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -57,10 +59,17 @@ SubShader { float3 worldPos : TEXCOORD2; float4 color : TEXCOORD3; SHADOW_COORDS(5) + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.uv = v.uv * _MainTex_ST.xy + _MainTex_ST.zw; o.pos = UnityObjectToClipPos(v.vertex); o.worldPos = mul(unity_ObjectToWorld, v.vertex); diff --git a/Assets/Shaders/FogDensity.shader b/Assets/Shaders/FogDensity.shader index b65ff5afa0..acf6072614 100644 --- a/Assets/Shaders/FogDensity.shader +++ b/Assets/Shaders/FogDensity.shader @@ -50,12 +50,16 @@ Shader "Custom/FogDensity" { float3 normal : NORMAL; float4 tangent : TANGENT; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vertInflate (appdata_t v, float currentSliceIndex) { @@ -63,6 +67,11 @@ Shader "Custom/FogDensity" { float ratioMultiplier = -.5; v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.tangent.w = 1.0; float totalNumSlices = 5; float ratio = (currentSliceIndex / (totalNumSlices - 1)); diff --git a/Assets/Shaders/FullScreenOverlay.shader b/Assets/Shaders/FullScreenOverlay.shader index 6f96c191a9..827366cc48 100644 --- a/Assets/Shaders/FullScreenOverlay.shader +++ b/Assets/Shaders/FullScreenOverlay.shader @@ -36,10 +36,14 @@ Shader "Unlit/FullScreenOverlay" struct appdata_t { float4 vertex : POSITION; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -47,6 +51,11 @@ Shader "Unlit/FullScreenOverlay" v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/Assets/Shaders/GpuText.shader b/Assets/Shaders/GpuText.shader index af4ba85f16..c12fbedc8e 100644 --- a/Assets/Shaders/GpuText.shader +++ b/Assets/Shaders/GpuText.shader @@ -38,12 +38,16 @@ Shader "Unlit/GpuText" { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; @@ -57,6 +61,11 @@ Shader "Unlit/GpuText" v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); return o; diff --git a/Assets/Shaders/GrabHighlightMask.shader b/Assets/Shaders/GrabHighlightMask.shader index 5926bfa812..d89b712127 100644 --- a/Assets/Shaders/GrabHighlightMask.shader +++ b/Assets/Shaders/GrabHighlightMask.shader @@ -47,20 +47,28 @@ Category { struct appdata_t { float4 vertex : POSITION; fixed4 color : COLOR; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); return o; } void frag (v2f i, out fixed4 col : SV_Target) { - col = float4(1,1,1,1); + col = float4(1,1,1,1); } ENDCG } diff --git a/Assets/Shaders/GrabHighlightUnmask.shader b/Assets/Shaders/GrabHighlightUnmask.shader index f07ec6d42e..8058033739 100644 --- a/Assets/Shaders/GrabHighlightUnmask.shader +++ b/Assets/Shaders/GrabHighlightUnmask.shader @@ -47,20 +47,29 @@ Category { struct appdata_t { float4 vertex : POSITION; fixed4 color : COLOR; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.vertex = UnityObjectToClipPos(v.vertex); return o; } void frag (v2f i, out fixed4 col : SV_Target) { - col = float4(1,1,1,1); + col = float4(1,1,1,1); } ENDCG } diff --git a/Assets/Shaders/GripPulse.shader b/Assets/Shaders/GripPulse.shader index 8ac30876d5..29e1f217c4 100644 --- a/Assets/Shaders/GripPulse.shader +++ b/Assets/Shaders/GripPulse.shader @@ -30,10 +30,14 @@ Shader "Custom/GripPulse" { struct appdata_t { float4 vertex : POSITION; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -41,6 +45,11 @@ Shader "Custom/GripPulse" { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/Assets/Shaders/GroundPlaneOverlay.shader b/Assets/Shaders/GroundPlaneOverlay.shader index 4c00fbeaef..659d8c56a6 100644 --- a/Assets/Shaders/GroundPlaneOverlay.shader +++ b/Assets/Shaders/GroundPlaneOverlay.shader @@ -38,11 +38,15 @@ Shader "Unlit/GroundPlaneOverlay" struct appdata_t { float4 vertex : POSITION; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float3 worldPosition : COLOR; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -52,6 +56,11 @@ Shader "Unlit/GroundPlaneOverlay" v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.worldPosition = mul(unity_ObjectToWorld, v.vertex).xyz; return o; diff --git a/Assets/Shaders/HighlightPulse.shader b/Assets/Shaders/HighlightPulse.shader index be77bf5658..5d2837b2ee 100644 --- a/Assets/Shaders/HighlightPulse.shader +++ b/Assets/Shaders/HighlightPulse.shader @@ -34,11 +34,15 @@ Shader "Custom/HighlightPulse" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; @@ -50,6 +54,11 @@ Shader "Custom/HighlightPulse" { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); diff --git a/Assets/Shaders/Include/Particles.cginc b/Assets/Shaders/Include/Particles.cginc index 670174ef58..d3a0f7a230 100644 --- a/Assets/Shaders/Include/Particles.cginc +++ b/Assets/Shaders/Include/Particles.cginc @@ -51,6 +51,8 @@ struct ParticleVertexWithSpread_t { fixed4 color : COLOR; float4 texcoord : TEXCOORD0; // xy: texcoord z: rotation w: birth time float3 origin : TEXCOORD1; // pos: location of the knot (particle "sprays" from this) + + UNITY_VERTEX_INPUT_INSTANCE_ID }; // } NOTOOLKIT // TOOLKIT: #define ParticleVertexWithSpread_t ParticleVertex_t @@ -62,6 +64,8 @@ struct ParticleVertex_t { // TOOLKIT: float3 center : TEXCOORD1; fixed4 color : COLOR; float4 texcoord : TEXCOORD0; // xy: texcoord z: rotation w: birth time + + UNITY_VERTEX_INPUT_INSTANCE_ID }; // Rotates the corner of a square quad centered at the origin diff --git a/Assets/Shaders/LightWidget.shader b/Assets/Shaders/LightWidget.shader index 0d2a7d5c41..6fb89f2427 100644 --- a/Assets/Shaders/LightWidget.shader +++ b/Assets/Shaders/LightWidget.shader @@ -41,14 +41,23 @@ Shader "Custom/LightWidget" { struct Input { float4 vertex : POSITION; float3 normal : NORMAL; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : SV_POSITION; float4 posWorld : TEXCOORD0; float3 normalDir : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; + v2f vert (Input v) { - v2f o = (v2f)0; + v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); // Smash along the z axis based on a 0-1 ratio v.vertex.z = v.vertex.z - v.vertex.z * _FlattenAmount; diff --git a/Assets/Shaders/LinearGradient.shader b/Assets/Shaders/LinearGradient.shader index b8bb218321..05546c3e2b 100644 --- a/Assets/Shaders/LinearGradient.shader +++ b/Assets/Shaders/LinearGradient.shader @@ -31,21 +31,31 @@ Shader "Custom/LinearGradient" { #pragma vertex vert #pragma fragment frag + #include "UnityCG.cginc" + struct vertexIn { float4 pos : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : SV_POSITION; float2 uv : TEXCOORD0; float3 modelpos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(vertexIn input) { v2f output; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_OUTPUT(v2f, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + output.pos = UnityObjectToClipPos(input.pos); output.uv = input.uv; output.modelpos = input.pos; diff --git a/Assets/Shaders/LinearGradientPreview.shader b/Assets/Shaders/LinearGradientPreview.shader index f1f02ed101..c43e82bd76 100644 --- a/Assets/Shaders/LinearGradientPreview.shader +++ b/Assets/Shaders/LinearGradientPreview.shader @@ -34,21 +34,31 @@ Shader "Custom/LinearGradientPreview" { #pragma vertex vert #pragma fragment frag + #include "UnityCG.cginc" + struct vertexIn { float4 pos : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : SV_POSITION; float2 uv : TEXCOORD0; float3 modelpos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(vertexIn input) { v2f output; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_INITIALIZE_OUTPUT(v2f, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + output.pos = UnityObjectToClipPos(input.pos); output.uv = input.uv; output.modelpos = input.pos; diff --git a/Assets/Shaders/MobileDiffuse.shader b/Assets/Shaders/MobileDiffuse.shader index fae28d454f..d074e9229e 100644 --- a/Assets/Shaders/MobileDiffuse.shader +++ b/Assets/Shaders/MobileDiffuse.shader @@ -47,6 +47,8 @@ Shader "TiltBrush/MobileDiffuse" { float2 uv1 : TEXCOORD1; half3 normal : NORMAL; float4 color : COLOR; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -56,6 +58,8 @@ Shader "TiltBrush/MobileDiffuse" { half3 worldNormal : NORMAL; UNITY_FOG_COORDS(2) SHADOW_COORDS(3) // put shadows data into TEXCOORD3 + + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; @@ -67,6 +71,10 @@ Shader "TiltBrush/MobileDiffuse" { v2f vert (appdata_t v) { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.uv0 = TRANSFORM_TEX(v.uv0, _MainTex); o.uv1 = TRANSFORM_TEX(v.uv1, _LightMap); diff --git a/Assets/Shaders/ModelGhost.shader b/Assets/Shaders/ModelGhost.shader index 504978cbea..3c9141d245 100644 --- a/Assets/Shaders/ModelGhost.shader +++ b/Assets/Shaders/ModelGhost.shader @@ -13,68 +13,72 @@ // limitations under the License. Shader "Custom/ModelGhost" { -Properties { - _Color ("Color", Color) = (1, 1, 1, 1) -} + Properties { + _Color ("Color", Color) = (1, 1, 1, 1) + } -Category { - SubShader { + Category { + SubShader { - Tags{ "Queue" = "Overlay" "IgnoreProjector" = "True" "RenderType" = "Transparent" } + Tags{ "Queue" = "Overlay" "IgnoreProjector" = "True" "RenderType" = "Transparent" } - Pass { + Pass { - //Blend SrcAlpha OneMinusSrcAlpha, Zero One - Blend One One - Lighting Off Cull Back ZTest Always ZWrite Off Fog { Mode Off } + //Blend SrcAlpha OneMinusSrcAlpha, Zero One + Blend One One + Lighting Off Cull Back ZTest Always ZWrite Off Fog { Mode Off } - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma target 3.0 + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 3.0 + #include "UnityCG.cginc" + #include "Assets/Shaders/Include/Brush.cginc" + #include "Assets/Shaders/Include/ColorSpace.cginc" - #include "UnityCG.cginc" - #include "Assets/Shaders/Include/Brush.cginc" - #include "Assets/Shaders/Include/ColorSpace.cginc" + struct appdata_t { + float4 vertex : POSITION; + fixed4 color : COLOR; + float3 normal : NORMAL; - struct appdata_t { - float4 vertex : POSITION; - fixed4 color : COLOR; - float3 normal : NORMAL; - }; + UNITY_VERTEX_INPUT_INSTANCE_ID + }; - struct v2f { - float4 vertex : POSITION; - float3 viewDir : TEXCOORD0; - float3 normal : NORMAL; + struct v2f { + float4 vertex : POSITION; + float3 viewDir : TEXCOORD0; + float3 normal : NORMAL; - }; + UNITY_VERTEX_OUTPUT_STEREO + }; - uniform float4 _Color; + uniform float4 _Color; - v2f vert (appdata_t v) { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.viewDir = normalize(ObjSpaceViewDir(v.vertex)); - o.normal = normalize(v.normal); - return o; - } + v2f vert (appdata_t v) { + v2f o; - fixed4 frag (v2f i) : COLOR { - float facingRatio = saturate(dot(i.viewDir, i.normal)); - facingRatio = 1-facingRatio; - float4 outColor = _Color * facingRatio; - outColor.w = 1; - return outColor; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); - } - ENDCG + o.vertex = UnityObjectToClipPos(v.vertex); + o.viewDir = normalize(ObjSpaceViewDir(v.vertex)); + o.normal = normalize(v.normal); + return o; + } + + fixed4 frag (v2f i) : COLOR { + float facingRatio = saturate(dot(i.viewDir, i.normal)); + facingRatio = 1-facingRatio; + float4 outColor = _Color * facingRatio; + outColor.w = 1; + return outColor; + } + ENDCG + } } } -} - -Fallback "Unlit/Diffuse" - + Fallback "Unlit/Diffuse" } diff --git a/Assets/Shaders/NewSketchButton.shader b/Assets/Shaders/NewSketchButton.shader index 4db765de14..e3243e19bc 100644 --- a/Assets/Shaders/NewSketchButton.shader +++ b/Assets/Shaders/NewSketchButton.shader @@ -49,12 +49,16 @@ Shader "Custom/NewSketchButton" { float3 normal : NORMAL; float4 tangent : TANGENT; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vertInflate (appdata_t v, float currentSliceIndex) { @@ -62,6 +66,11 @@ Shader "Custom/NewSketchButton" { float ratioMultiplier = .5; v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.tangent.w = 1.0; float totalNumSlices = 5; float ratio = (currentSliceIndex / (totalNumSlices - 1)); diff --git a/Assets/Shaders/Panel.shader b/Assets/Shaders/Panel.shader index 717ecff25a..f979e7c48f 100644 --- a/Assets/Shaders/Panel.shader +++ b/Assets/Shaders/Panel.shader @@ -34,12 +34,16 @@ SubShader { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; float4 wpos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -49,6 +53,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.wpos = mul(unity_ObjectToWorld, v.vertex); o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); diff --git a/Assets/Shaders/PanelButton.shader b/Assets/Shaders/PanelButton.shader index ff220e0f53..8e2e775b68 100644 --- a/Assets/Shaders/PanelButton.shader +++ b/Assets/Shaders/PanelButton.shader @@ -27,6 +27,8 @@ Shader "Custom/PanelButton" { #pragma vertex vert #pragma fragment frag #pragma multi_compile __ HDR_EMULATED HDR_SIMPLE + + #include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" #include "Assets/Shaders/Include/Hdr.cginc" @@ -38,16 +40,25 @@ Shader "Custom/PanelButton" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float4 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + if (_Activated) v.vertex.xyz += float3(0,0,-.2); o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = float4(v.texcoord.xy, 0, _PanelMipmapBias); diff --git a/Assets/Shaders/PanelButtonCutout.shader b/Assets/Shaders/PanelButtonCutout.shader index d68b65eb19..739517b6bb 100644 --- a/Assets/Shaders/PanelButtonCutout.shader +++ b/Assets/Shaders/PanelButtonCutout.shader @@ -29,6 +29,8 @@ Shader "Custom/PanelButtonCutout" { #pragma vertex vert #pragma fragment frag #pragma multi_compile __ HDR_EMULATED HDR_SIMPLE + + #include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" #include "Assets/Shaders/Include/Hdr.cginc" @@ -42,16 +44,25 @@ Shader "Custom/PanelButtonCutout" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float4 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + if (_Activated) v.vertex.xyz += float3(0,0,-.2); o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = float4(v.texcoord.xy, 0, _PanelMipmapBias); diff --git a/Assets/Shaders/PanelButton_Atlas.shader b/Assets/Shaders/PanelButton_Atlas.shader index 5f9c5f275e..3a954c88cf 100644 --- a/Assets/Shaders/PanelButton_Atlas.shader +++ b/Assets/Shaders/PanelButton_Atlas.shader @@ -40,16 +40,25 @@ Shader "Custom/PanelButton_Atlas" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float4 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = float4(v.texcoord.xy, 0, _PanelMipmapBias); return o; diff --git a/Assets/Shaders/PanelButton_AtlasActive.shader b/Assets/Shaders/PanelButton_AtlasActive.shader index b661a3e761..044f6c8c59 100644 --- a/Assets/Shaders/PanelButton_AtlasActive.shader +++ b/Assets/Shaders/PanelButton_AtlasActive.shader @@ -44,16 +44,25 @@ Shader "Custom/PanelButton_AtlasActive" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float4 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = float4(v.texcoord.xy, 0, _PanelMipmapBias); return o; diff --git a/Assets/Shaders/ParticleDustBokeh.shader b/Assets/Shaders/ParticleDustBokeh.shader index ea1ba76b81..9137a5a2e9 100644 --- a/Assets/Shaders/ParticleDustBokeh.shader +++ b/Assets/Shaders/ParticleDustBokeh.shader @@ -45,6 +45,8 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -52,6 +54,8 @@ Category { fixed4 color : COLOR; float2 texcoord : TEXCOORD0; float bokeh : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -60,6 +64,10 @@ Category { { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); float4 viewPos = mul(UNITY_MATRIX_MV, v.vertex); diff --git a/Assets/Shaders/Pcx/Point.shader b/Assets/Shaders/Pcx/Point.shader index d9cf0fa56f..3f185ee628 100644 --- a/Assets/Shaders/Pcx/Point.shader +++ b/Assets/Shaders/Pcx/Point.shader @@ -72,6 +72,11 @@ Shader "Point Cloud/Point" #endif Varyings o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(Varyings, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.position = UnityObjectToClipPos(pos); o.color = col; #ifdef _DISTANCE_ON diff --git a/Assets/Shaders/PinCushionItem.shader b/Assets/Shaders/PinCushionItem.shader index a6c09c5013..4e2d537faa 100644 --- a/Assets/Shaders/PinCushionItem.shader +++ b/Assets/Shaders/PinCushionItem.shader @@ -27,6 +27,8 @@ Shader "Custom/PinCushionItem" { #pragma vertex vert #pragma fragment frag #pragma multi_compile __ HDR_EMULATED HDR_SIMPLE + + #include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" #include "Assets/Shaders/Include/Hdr.cginc" @@ -38,17 +40,25 @@ Shader "Custom/PinCushionItem" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // Smash inward along Z axis based on 0-1 ratio v.vertex.z = v.vertex.z * _Activated - v.vertex.z; diff --git a/Assets/Shaders/PolyAssetThumbnail.shader b/Assets/Shaders/PolyAssetThumbnail.shader index ecaa43723d..ee9cab5277 100644 --- a/Assets/Shaders/PolyAssetThumbnail.shader +++ b/Assets/Shaders/PolyAssetThumbnail.shader @@ -40,21 +40,29 @@ Shader "Custom/PolyAssetThumbnail" { struct appdata { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata v) { + v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); v.uv -= 0.5; // Adjust UVs of 1:1 mesh for Poly's 4:3 image format v.uv.x /= 1.333; v.uv += 0.5; - - v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); return o; diff --git a/Assets/Shaders/ProfileIcon.shader b/Assets/Shaders/ProfileIcon.shader index 50a5efa72a..c1f0141851 100644 --- a/Assets/Shaders/ProfileIcon.shader +++ b/Assets/Shaders/ProfileIcon.shader @@ -35,12 +35,16 @@ Shader "Custom/ProfileIcon" { { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; fixed4 _Color; @@ -53,6 +57,11 @@ Shader "Custom/ProfileIcon" { v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); return o; diff --git a/Assets/Shaders/ReferenceImage.shader b/Assets/Shaders/ReferenceImage.shader index ac40a51571..86e9d992e1 100644 --- a/Assets/Shaders/ReferenceImage.shader +++ b/Assets/Shaders/ReferenceImage.shader @@ -47,14 +47,23 @@ Shader "Custom/ReferenceImage" { struct appdata { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata v) { + v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); v.uv -= 0.5; @@ -70,7 +79,6 @@ Shader "Custom/ReferenceImage" { v.uv += 0.5; - v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); return o; diff --git a/Assets/Shaders/SharingState.shader b/Assets/Shaders/SharingState.shader index 0fbb40ded8..38467aefc3 100644 --- a/Assets/Shaders/SharingState.shader +++ b/Assets/Shaders/SharingState.shader @@ -45,17 +45,25 @@ SubShader { float4 vertex : POSITION; float3 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // Hold animation 'til _Ratio < 0 if (_Ratio == 0) { duration = 0.0f; diff --git a/Assets/Shaders/SketchbookButton.shader b/Assets/Shaders/SketchbookButton.shader index 34e4c473a2..25b74d5ec7 100644 --- a/Assets/Shaders/SketchbookButton.shader +++ b/Assets/Shaders/SketchbookButton.shader @@ -46,22 +46,31 @@ Shader "Custom/SketchbookButton" { float3 normal : NORMAL; float4 tangent : TANGENT; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float4 color : COLOR; float4 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vertInflate (appdata_t v, float currentSliceIndex) { - float ratioMultiplier = .5; - + v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + v.tangent.w = 1.0; float totalNumSlices = 5; float ratio = (currentSliceIndex / (totalNumSlices - 1)); + float ratioMultiplier = .5; v.vertex.z -= ratioMultiplier * ratio * _Distance; totalNumSlices = 5; diff --git a/Assets/Shaders/Skybox.shader b/Assets/Shaders/Skybox.shader index 459a69a4df..60fca876ba 100644 --- a/Assets/Shaders/Skybox.shader +++ b/Assets/Shaders/Skybox.shader @@ -49,16 +49,25 @@ SubShader { struct appdata_t { float4 vertex : POSITION; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float3 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + float4 quatConjugate = float4(-_SkyboxRotation.x, -_SkyboxRotation.y, -_SkyboxRotation.z, _SkyboxRotation.w); o.vertex = UnityObjectToClipPos(quat_mult(_SkyboxRotation, quat_mult(v.vertex, quatConjugate))); o.texcoord = v.vertex; diff --git a/Assets/Shaders/SnapGrid3D.shader b/Assets/Shaders/SnapGrid3D.shader index a43ce07c0b..cfb0bf8dba 100644 --- a/Assets/Shaders/SnapGrid3D.shader +++ b/Assets/Shaders/SnapGrid3D.shader @@ -76,12 +76,16 @@ Shader "Custom/Grid3D" uint id : SV_VERTEXID; float4 vertex : POSITION; float4 pos : TEXCOORD2; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float4 pos : TEXCOORD2; + + UNITY_VERTEX_OUTPUT_STEREO }; float3 calcQuadVertex(uint vtx_idx) // face 0:x 1:y 2:z @@ -120,6 +124,11 @@ Shader "Custom/Grid3D" v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + uint vtx_per_quad = 6; uint vtx_per_line = vtx_per_quad * 2; uint vtx_per_star = vtx_per_line * 3; diff --git a/Assets/Shaders/SnapshotCameraFlash.shader b/Assets/Shaders/SnapshotCameraFlash.shader index 279a70b7bf..5836f2d9db 100644 --- a/Assets/Shaders/SnapshotCameraFlash.shader +++ b/Assets/Shaders/SnapshotCameraFlash.shader @@ -41,6 +41,8 @@ Shader "Unlit/Snapshot Camera Flash" { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f @@ -48,6 +50,8 @@ Shader "Unlit/Snapshot Camera Flash" float2 uv : TEXCOORD0; UNITY_FOG_COORDS(1) float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; @@ -59,6 +63,11 @@ Shader "Unlit/Snapshot Camera Flash" v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); UNITY_TRANSFER_FOG(o,o.vertex); diff --git a/Assets/Shaders/StencilSurface.shader b/Assets/Shaders/StencilSurface.shader index cd8e95c98f..14dc773394 100644 --- a/Assets/Shaders/StencilSurface.shader +++ b/Assets/Shaders/StencilSurface.shader @@ -49,6 +49,8 @@ CGINCLUDE float4 vertex : POSITION; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -57,12 +59,18 @@ CGINCLUDE float3 normal : TEXCOORD2; float2 texcoord : TEXCOORD3; float4 screenPos : TEXCOORD4; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = v.vertex; o.vertex = UnityObjectToClipPos(v.vertex); diff --git a/Assets/Shaders/StencilSurfaceTutorial.shader b/Assets/Shaders/StencilSurfaceTutorial.shader index e4ff076637..8c01c331cf 100644 --- a/Assets/Shaders/StencilSurfaceTutorial.shader +++ b/Assets/Shaders/StencilSurfaceTutorial.shader @@ -42,6 +42,8 @@ CGINCLUDE float4 vertex : POSITION; float3 normal : NORMAL; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { @@ -50,12 +52,18 @@ CGINCLUDE float3 normal : TEXCOORD2; float2 texcoord : TEXCOORD3; float4 screenPos : TEXCOORD4; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + // Shrink the stencil slightly to prevent z fighting when the user is drawing on top of it. float stencilShrinkAmount = .005f; float curvedStencilShrinkAmount = .015f; diff --git a/Assets/Shaders/SwatchAdditive.shader b/Assets/Shaders/SwatchAdditive.shader index a0f15a3ae4..f65421047e 100644 --- a/Assets/Shaders/SwatchAdditive.shader +++ b/Assets/Shaders/SwatchAdditive.shader @@ -41,11 +41,15 @@ Category { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -53,6 +57,11 @@ Category { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); return o; diff --git a/Assets/Shaders/SwatchBloom.shader b/Assets/Shaders/SwatchBloom.shader index 6400d653d8..1387fda310 100644 --- a/Assets/Shaders/SwatchBloom.shader +++ b/Assets/Shaders/SwatchBloom.shader @@ -48,17 +48,26 @@ Category { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(_Color, _EmissionGain); diff --git a/Assets/Shaders/ThreeDeeFadeText.shader b/Assets/Shaders/ThreeDeeFadeText.shader index 5a6a2e4f4d..87c86b970b 100644 --- a/Assets/Shaders/ThreeDeeFadeText.shader +++ b/Assets/Shaders/ThreeDeeFadeText.shader @@ -34,12 +34,16 @@ SubShader { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; float4 wpos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -49,6 +53,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.wpos = mul(unity_ObjectToWorld, v.vertex); o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); diff --git a/Assets/Shaders/ThreeDeeText.shader b/Assets/Shaders/ThreeDeeText.shader index d8617e3591..7463f759d2 100644 --- a/Assets/Shaders/ThreeDeeText.shader +++ b/Assets/Shaders/ThreeDeeText.shader @@ -35,12 +35,16 @@ SubShader { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; float4 wpos : TEXCOORD1; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -51,6 +55,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.wpos = mul(unity_ObjectToWorld, v.vertex); o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); diff --git a/Assets/Shaders/TiltBrushLogo_Progress.shader b/Assets/Shaders/TiltBrushLogo_Progress.shader index ed9b0dd17a..d5107c0aa5 100644 --- a/Assets/Shaders/TiltBrushLogo_Progress.shader +++ b/Assets/Shaders/TiltBrushLogo_Progress.shader @@ -37,11 +37,15 @@ Shader "Custom/TiltBrushLogo_Progress" { struct appdata { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv_MainTex : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; // Creates a smooth in and out line from min to max over the range t = [0, 1]. @@ -62,6 +66,11 @@ Shader "Custom/TiltBrushLogo_Progress" { v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv_MainTex = TRANSFORM_TEX(v.uv, _MainTex); return o; diff --git a/Assets/Shaders/TransformControllerOverlay.shader b/Assets/Shaders/TransformControllerOverlay.shader index 9a49279bc9..3c9c30842b 100644 --- a/Assets/Shaders/TransformControllerOverlay.shader +++ b/Assets/Shaders/TransformControllerOverlay.shader @@ -44,14 +44,23 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float3 normal : NORMAL; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex + float4(v.normal * _BlackOutlineInflation * _Intensity,0)); return o; } @@ -82,10 +91,14 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float3 normal : NORMAL; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -93,6 +106,11 @@ Category { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + _ColoredOutlineInflation += _BaseInflation * abs(sin(_Time.w*2)); o.vertex = UnityObjectToClipPos(v.vertex + float4(v.normal * _ColoredOutlineInflation * _Intensity,0)); return o; diff --git a/Assets/Shaders/TransformLine.shader b/Assets/Shaders/TransformLine.shader index 20ec12c707..ae061b1791 100644 --- a/Assets/Shaders/TransformLine.shader +++ b/Assets/Shaders/TransformLine.shader @@ -36,10 +36,14 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float3 normal : NORMAL; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -47,7 +51,12 @@ Category { v2f vert (appdata_t v) { v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/Assets/Shaders/TransformLineHint.shader b/Assets/Shaders/TransformLineHint.shader index ae48bc8840..3271e3df04 100644 --- a/Assets/Shaders/TransformLineHint.shader +++ b/Assets/Shaders/TransformLineHint.shader @@ -39,10 +39,14 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float3 normal : NORMAL; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -50,7 +54,12 @@ Category { v2f vert (appdata_t v) { v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/Assets/Shaders/TutorialNotification.shader b/Assets/Shaders/TutorialNotification.shader index 4a0e57a862..55034f2927 100644 --- a/Assets/Shaders/TutorialNotification.shader +++ b/Assets/Shaders/TutorialNotification.shader @@ -43,12 +43,16 @@ Category { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; float4 _MainTex_ST; @@ -56,6 +60,11 @@ Category { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.color = v.color; o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); diff --git a/Assets/Shaders/TwoTexAnimation.shader b/Assets/Shaders/TwoTexAnimation.shader index 87f237f786..faea0197aa 100644 --- a/Assets/Shaders/TwoTexAnimation.shader +++ b/Assets/Shaders/TwoTexAnimation.shader @@ -38,12 +38,16 @@ Shader "Custom/TwoTexAnimation" { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; @@ -55,6 +59,11 @@ Shader "Custom/TwoTexAnimation" v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); return o; diff --git a/Assets/Shaders/Unlit-BackFaces.shader b/Assets/Shaders/Unlit-BackFaces.shader index 0c9ca72e5c..9c91d19f3d 100644 --- a/Assets/Shaders/Unlit-BackFaces.shader +++ b/Assets/Shaders/Unlit-BackFaces.shader @@ -32,11 +32,14 @@ SubShader { struct appdata_t { float4 vertex : POSITION; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; - UNITY_FOG_COORDS(1) + UNITY_FOG_COORDS(1) + UNITY_VERTEX_OUTPUT_STEREO }; fixed4 _Color; @@ -44,6 +47,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); UNITY_TRANSFER_FOG(o,o.vertex); return o; diff --git a/Assets/Shaders/Unlit-Diffuse.shader b/Assets/Shaders/Unlit-Diffuse.shader index 6af1b31e40..00a566ac96 100644 --- a/Assets/Shaders/Unlit-Diffuse.shader +++ b/Assets/Shaders/Unlit-Diffuse.shader @@ -37,10 +37,14 @@ SubShader { struct appdata_t { float4 vertex : POSITION; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -48,6 +52,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); return o; } diff --git a/Assets/Shaders/Unlit-DiffuseNoCull.shader b/Assets/Shaders/Unlit-DiffuseNoCull.shader index 4502e12345..f6dfe3b848 100644 --- a/Assets/Shaders/Unlit-DiffuseNoCull.shader +++ b/Assets/Shaders/Unlit-DiffuseNoCull.shader @@ -36,11 +36,13 @@ SubShader { struct appdata_t { float4 vertex : POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; UNITY_FOG_COORDS(1) + UNITY_VERTEX_OUTPUT_STEREO }; uniform float4 _Color; @@ -49,6 +51,11 @@ SubShader { { PrepForOds(v.vertex); v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); UNITY_TRANSFER_FOG(o,o.vertex); return o; diff --git a/Assets/Shaders/Unlit-TextureNoCull.shader b/Assets/Shaders/Unlit-TextureNoCull.shader index c804aaf969..9677c8acb2 100644 --- a/Assets/Shaders/Unlit-TextureNoCull.shader +++ b/Assets/Shaders/Unlit-TextureNoCull.shader @@ -32,11 +32,15 @@ SubShader { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; @@ -45,6 +49,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); diff --git a/Assets/Shaders/Unlit-TextureTint.shader b/Assets/Shaders/Unlit-TextureTint.shader index cd0f2b47a3..80b7217ff9 100644 --- a/Assets/Shaders/Unlit-TextureTint.shader +++ b/Assets/Shaders/Unlit-TextureTint.shader @@ -33,11 +33,15 @@ SubShader { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; sampler2D _MainTex; @@ -47,6 +51,11 @@ SubShader { v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); diff --git a/Assets/Shaders/UnlitHDRColorButton.shader b/Assets/Shaders/UnlitHDRColorButton.shader index 62f3f7a393..48364b6df7 100644 --- a/Assets/Shaders/UnlitHDRColorButton.shader +++ b/Assets/Shaders/UnlitHDRColorButton.shader @@ -39,15 +39,24 @@ Shader "Custom/UnlitHDRColorButton" { struct Input { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 pos : SV_POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (Input v) { - v2f o = (v2f)0; + v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(Input, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.pos = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; diff --git a/Assets/Shaders/VisualizerRing.shader b/Assets/Shaders/VisualizerRing.shader index a36e003ea6..63d8285ade 100644 --- a/Assets/Shaders/VisualizerRing.shader +++ b/Assets/Shaders/VisualizerRing.shader @@ -46,17 +46,26 @@ Shader "Custom/VisualizerRing" { float4 vertex : POSITION; fixed4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert(appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); o.color = bloomColor(v.color, _EmissionGain); diff --git a/Assets/Shaders/WaveformIndicator.shader b/Assets/Shaders/WaveformIndicator.shader index 0830fce092..fb9b0e11cf 100644 --- a/Assets/Shaders/WaveformIndicator.shader +++ b/Assets/Shaders/WaveformIndicator.shader @@ -27,6 +27,8 @@ Shader "Custom/WaveformIndicator" { #pragma vertex vert #pragma fragment frag #pragma multi_compile __ AUDIO_REACTIVE + + #include "UnityCG.cginc" #include "Assets/Shaders/Include/Brush.cginc" fixed4 _Color; @@ -37,16 +39,25 @@ Shader "Custom/WaveformIndicator" { struct appdata_t { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : POSITION; float2 texcoord : TEXCOORD0; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata_t v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.texcoord = v.texcoord; return o; diff --git a/Assets/ThirdParty/jintiao_FXAA/FXAA.shader b/Assets/ThirdParty/jintiao_FXAA/FXAA.shader index a621eac56f..7b3ad88508 100644 --- a/Assets/ThirdParty/jintiao_FXAA/FXAA.shader +++ b/Assets/ThirdParty/jintiao_FXAA/FXAA.shader @@ -24,24 +24,33 @@ { float4 vertex : POSITION; float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float2 uv : TEXCOORD0; float4 vertex : SV_POSITION; + + UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata v) { v2f o; + + UNITY_SETUP_INSTANCE_ID(v); + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + o.vertex = UnityObjectToClipPos(v.vertex); o.uv = v.uv; return o; } - sampler2D _MainTex; + UNITY_DECLARE_SCREENSPACE_TEXTURE(_MainTex); float4 _MainTex_TexelSize; float _ContrastThreshold; @@ -65,7 +74,7 @@ float SampleLuminance(float2 uv) { - return LinearRgbToLuminance(saturate(tex2D(_MainTex, uv).rgb)); + return LinearRgbToLuminance(saturate(UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, uv).rgb)); } @@ -221,7 +230,7 @@ { LuminanceData l = SampleLuminanceNeighborhood(uv); if (ShouldSkipPixel(l)) - return tex2D(_MainTex, uv); + return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, uv); float pixelBlend = DeterminePixelBlendFactor(l); EdgeData e = DetermineEdge(l); @@ -236,12 +245,14 @@ { uv.x += e.pixelStep * finalBlend; } - return tex2Dlod(_MainTex, float4(uv, 0, 0)); + return UNITY_SAMPLE_SCREENSPACE_TEXTURE(_MainTex, float4(uv, 0, 0)); } fixed4 frag (v2f i) : SV_Target { + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + return ApplyFXAA(i.uv); } ENDCG