update shaders for spi support

This commit is contained in:
Crispy 2023-06-25 18:08:22 +02:00
parent e8ebac67fb
commit dce6916eb1
4 changed files with 163 additions and 142 deletions

View file

@ -23,13 +23,14 @@
{ {
float4 vertex : POSITION; float4 vertex : POSITION;
float2 uv : TEXCOORD0; float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
}; };
struct v2f struct v2f
{ {
float2 uv : TEXCOORD0; float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
}; };
sampler2D _LastFrame; sampler2D _LastFrame;
@ -38,9 +39,12 @@
v2f vert (appdata v) v2f vert (appdata v)
{ {
v2f o; v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex); o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv; o.uv = v.uv;
return o; return o;
} }

View file

@ -21,12 +21,14 @@
{ {
float4 vertex : POSITION; float4 vertex : POSITION;
float2 uv : TEXCOORD0; float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
}; };
struct v2f struct v2f
{ {
float2 uv : TEXCOORD0; float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
}; };
sampler2D _LastFrame; sampler2D _LastFrame;
@ -34,6 +36,10 @@
v2f vert (appdata v) v2f vert (appdata v)
{ {
v2f o; v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex); o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv; o.uv = v.uv;
return o; return o;

View file

@ -22,12 +22,14 @@
{ {
float4 vertex : POSITION; float4 vertex : POSITION;
float2 uv : TEXCOORD0; float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
}; };
struct v2f struct v2f
{ {
float2 uv : TEXCOORD0; float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
}; };
sampler2D _MainTex; sampler2D _MainTex;
@ -37,6 +39,10 @@
v2f vert (appdata v) v2f vert (appdata v)
{ {
v2f o; v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex); o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex); o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o; return o;
@ -44,8 +50,7 @@
fixed4 frag (v2f i) : SV_Target fixed4 frag (v2f i) : SV_Target
{ {
fixed4 col = tex2D(_MainTex, i.uv); return tex2D(_MainTex, i.uv) * _Color;
return col * _Color;
} }
ENDCG ENDCG
} }

View file

@ -19,16 +19,22 @@
struct appdata struct appdata
{ {
float4 vertex : POSITION; float4 vertex : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
}; };
struct v2f struct v2f
{ {
float4 vertex : SV_POSITION; float4 vertex : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
}; };
v2f vert (appdata v) v2f vert (appdata v)
{ {
v2f o; v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_OUTPUT(v2f, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.vertex = UnityObjectToClipPos(v.vertex); o.vertex = UnityObjectToClipPos(v.vertex);
return o; return o;
} }