浏览代码

[unity] Fixed fragment shader output (from COLOR to SV_Target), fixes ps4 shader compile error. Closes #1374.

Harald Csaszar 6 年之前
父节点
当前提交
e229dab539

+ 1 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader

@@ -102,7 +102,7 @@ Shader "Spine/Special/Skeleton Grayscale" {
 				return o;
 			}
 
-			float4 frag (VertexOutput i) : COLOR {
+			float4 frag (VertexOutput i) : SV_Target {
 				fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy);
 				clip(texcol.a * i.uvAndAlpha.a - _Cutoff);
 				SHADOW_CASTER_FRAGMENT(i)

+ 1 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc

@@ -40,7 +40,7 @@ vertexOutput vert(vertexInput v, float4 vertexColor : COLOR)
 
 uniform fixed _ShadowAlphaCutoff;
 
-fixed4 frag(vertexOutput IN) : COLOR 
+fixed4 frag(vertexOutput IN) : SV_Target
 {
 	fixed4 texureColor = calculateTexturePixel(IN.texcoordAndAlpha.xy);
 	clip(texureColor.a * IN.texcoordAndAlpha.a - _ShadowAlphaCutoff);

+ 1 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc

@@ -43,7 +43,7 @@ vertexOutput vert(vertexInput v, float4 vertexColor : COLOR)
 
 uniform fixed _ShadowAlphaCutoff;
 
-fixed4 frag(vertexOutput IN) : COLOR 
+fixed4 frag(vertexOutput IN) : SV_Target
 {
 	fixed4 texureColor = tex2D(_MainTex, IN.texcoordAndAlpha.xy);
 	clip(texureColor.a * IN.texcoordAndAlpha.a - _ShadowAlphaCutoff);

+ 2 - 2
spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader

@@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" {
 				return o;
 			}
 
-			float4 frag (VertexOutput i) : COLOR {
+			float4 frag (VertexOutput i) : SV_Target {
 				float4 texColor = tex2D(_MainTex, i.uv);
 
 				#if defined(_STRAIGHT_ALPHA_INPUT)
@@ -105,7 +105,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Additive" {
 			uniform sampler2D _MainTex;
 			uniform fixed _Cutoff;
 
-			float4 frag (v2f i) : COLOR {
+			float4 frag (v2f i) : SV_Target {
 				fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy);
 				clip(texcol.a * i.uvAndAlpha.a - _Cutoff);
 				SHADOW_CASTER_FRAGMENT(i)

+ 1 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader

@@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Multiply" {
 				return o;
 			}
 
-			float4 frag (VertexOutput i) : COLOR {
+			float4 frag (VertexOutput i) : SV_Target {
 				float4 texColor = tex2D(_MainTex, i.uv);
 				
 				#if defined(_STRAIGHT_ALPHA_INPUT)

+ 2 - 2
spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader

@@ -60,7 +60,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" {
 				return o;
 			}
 
-			float4 frag (VertexOutput i) : COLOR {
+			float4 frag (VertexOutput i) : SV_Target {
 				float4 texColor = tex2D(_MainTex, i.uv);
 
 				#if defined(_STRAIGHT_ALPHA_INPUT)
@@ -105,7 +105,7 @@ Shader "Spine/Blend Modes/Skeleton PMA Screen" {
 			uniform sampler2D _MainTex;
 			uniform fixed _Cutoff;
 
-			float4 frag (v2f i) : COLOR {
+			float4 frag (v2f i) : SV_Target {
 				fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy);
 				clip(texcol.a * i.uvAndAlpha.a - _Cutoff);
 				SHADOW_CASTER_FRAGMENT(i)

+ 2 - 2
spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader

@@ -69,7 +69,7 @@ Shader "Spine/Skeleton Tint Black" {
 				return o;
 			}
 
-			float4 frag (VertexOutput i) : COLOR {
+			float4 frag (VertexOutput i) : SV_Target {
 				float4 texColor = tex2D(_MainTex, i.uv);
 				
 				#if defined(_STRAIGHT_ALPHA_INPUT)
@@ -111,7 +111,7 @@ Shader "Spine/Skeleton Tint Black" {
 				return o;
 			}
 
-			float4 frag (v2f i) : COLOR {
+			float4 frag (v2f i) : SV_Target {
 				fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy);
 				clip(texcol.a * i.uvAndAlpha.a - _Cutoff);
 				SHADOW_CASTER_FRAGMENT(i)

+ 2 - 2
spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader

@@ -50,7 +50,7 @@ Shader "Spine/Skeleton" {
 				return o;
 			}
 
-			float4 frag (VertexOutput i) : COLOR {
+			float4 frag (VertexOutput i) : SV_Target {
 				float4 texColor = tex2D(_MainTex, i.uv);
 
 				#if defined(_STRAIGHT_ALPHA_INPUT)
@@ -95,7 +95,7 @@ Shader "Spine/Skeleton" {
 				return o;
 			}
 
-			float4 frag (VertexOutput i) : COLOR {
+			float4 frag (VertexOutput i) : SV_Target {
 				fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy);
 				clip(texcol.a * i.uvAndAlpha.a - _Cutoff);
 				SHADOW_CASTER_FRAGMENT(i)

+ 1 - 1
spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader

@@ -196,7 +196,7 @@ Shader "Spine/Skeleton Lit" {
 			uniform sampler2D _MainTex;
 			uniform fixed _Cutoff;
 
-			float4 frag (v2f i) : COLOR {
+			float4 frag (v2f i) : SV_Target {
 				fixed4 texcol = tex2D(_MainTex, i.uvAndAlpha.xy);
 				clip(texcol.a * i.uvAndAlpha.a - _Cutoff);
 				SHADOW_CASTER_FRAGMENT(i)