Skip to content

Commit

Permalink
Some fragment shaders are using target symantics which may be problem…
Browse files Browse the repository at this point in the history
…atic on some platforms, so change vertex output to SV_POSITION and fragment to SV_TARGET
  • Loading branch information
mrlinds authored and dubois committed Jan 31, 2020
1 parent fee645e commit c97c8ae
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Shader "Brush/Special/CelVinyl" {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
float2 texcoord : TEXCOORD0;
float4 color : COLOR;
UNITY_FOG_COORDS(1)
Expand All @@ -65,7 +65,7 @@ Shader "Brush/Special/CelVinyl" {
return o;
}

fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
fixed4 tex = tex2D(_MainTex, i.texcoord) * i.color;
UNITY_APPLY_FOG(i.fogCoord, tex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 unbloomedColor : TEXCOORD1;
Expand All @@ -67,7 +67,7 @@ Category {
}

// Input color is srgb
fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
// Envelope
float envelope = sin(i.texcoord.x * 3.14159);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_FOG_COORDS(1)
Expand All @@ -68,7 +68,7 @@ Category {
return o;
}

fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{

UNITY_APPLY_FOG(i.fogCoord, i.color.rgb);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CGINCLUDE
half _EmissionGain;

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
Expand Down Expand Up @@ -112,7 +112,7 @@ CGINCLUDE
}

// Input color is srgb
fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
// interior procedural line
float procedural = ( abs(i.texcoord.y - 0.5) < .1 ) ? 2 : 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
Expand All @@ -63,7 +63,7 @@ Category {
return o;
}

fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
half4 c = tex2D(_MainTex, i.texcoord );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float3 worldPos : TEXCOORD1;
Expand Down Expand Up @@ -90,7 +90,7 @@ Category {
return abs(noise.x + noise.y) * 0.5;
}

fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
// Workaround for b/30500118, caused by b/30504121
i.color.a = saturate(i.color.a);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
Expand Down Expand Up @@ -153,7 +153,7 @@ Category {
}

// Input color is srgb
fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
i.color.a = 1; //ignore incoming vert alpha
#ifdef AUDIO_REACTIVE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
Expand All @@ -72,7 +72,7 @@ Category {

}

fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
half4 c = tex2D(_MainTex, i.texcoord );
return i.color * c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPos : TEXCOORD1;
Expand Down Expand Up @@ -84,7 +84,7 @@ Category {
}

// Input color is srgb
fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
// Create parametric flowing UV's
half2 uvs = i.texcoord;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
Expand All @@ -71,7 +71,7 @@ Category {
return o;
}

fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
half4 c = tex2D(_MainTex, i.texcoord );
return i.color * c;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Category {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 unbloomedColor : TEXCOORD1;
Expand All @@ -70,7 +70,7 @@ Category {
}

// Input colors are srgb
fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
// Envelope
float envelope = sin(i.texcoord.x * 3.14159);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ SubShader {
};

struct v2f {
float4 vertex : POSITION;
float4 vertex : SV_POSITION;
float2 texcoord : TEXCOORD0;
float4 color : COLOR;
UNITY_FOG_COORDS(1)
Expand All @@ -63,7 +63,7 @@ SubShader {
return o;
}

fixed4 frag (v2f i) : COLOR
fixed4 frag (v2f i) : SV_Target
{
fixed4 c;
UNITY_APPLY_FOG(i.fogCoord, i.color);
Expand Down

0 comments on commit c97c8ae

Please sign in to comment.