From a96a059faf190110bc83a8a1b56a0dbc37787f60 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 10 Jul 2019 12:38:21 +0200 Subject: [PATCH] [unity] Fixed fragment shader output (from COLOR to SV_Target), fixes ps4 shader compile error. Closes #1374. --- .../Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader | 2 +- .../Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc | 2 +- .../spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc | 2 +- .../Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader | 4 ++-- .../Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader | 2 +- .../Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader | 4 ++-- .../spine-unity/Shaders/Spine-Skeleton-TintBlack.shader | 4 ++-- .../Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader | 4 ++-- .../Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader index b11723950..2dc66e519 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Spine-Special-Skeleton-Grayscale.shader @@ -101,7 +101,7 @@ Shader "Spine/Special/Skeleton Grayscale" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc index a24df47e3..478f26bd2 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/CGIncludes/SpriteShadows.cginc @@ -38,7 +38,7 @@ vertexOutput vert(vertexInput v) uniform fixed _ShadowAlphaCutoff; -fixed4 frag(vertexOutput IN) : COLOR +fixed4 frag(vertexOutput IN) : SV_Target { fixed4 texureColor = calculateTexturePixel(IN.texcoord); clip(texureColor.a - _ShadowAlphaCutoff); diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc index 6b88c198f..95fb7b8d8 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Modules/Shaders/Sprite/SpriteShadows.cginc @@ -41,7 +41,7 @@ vertexOutput vert(vertexInput v) uniform fixed _ShadowAlphaCutoff; -fixed4 frag(vertexOutput IN) : COLOR +fixed4 frag(vertexOutput IN) : SV_Target { fixed4 texureColor = tex2D(_MainTex, IN.texcoord.xy); clip(texureColor.a - _ShadowAlphaCutoff); diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader index 1b270f25d..779b2a21f 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Additive.shader +++ b/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) @@ -103,7 +103,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.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader index 18b4d7c4b..0e4e61de6 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Multiply.shader +++ b/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) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader index dab802255..54efdb440 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/BlendModes/Spine-Skeleton-PMA-Screen.shader +++ b/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) @@ -103,7 +103,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.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader index de1262f5b..d5870249e 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton-TintBlack.shader +++ b/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) @@ -110,7 +110,7 @@ Shader "Spine/Skeleton Tint Black" { return o; } - float4 frag (v2f i) : COLOR { + float4 frag (v2f i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader index 308420be4..e75e44a09 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-Skeleton.shader +++ b/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) @@ -94,7 +94,7 @@ Shader "Spine/Skeleton" { return o; } - float4 frag (VertexOutput i) : COLOR { + float4 frag (VertexOutput i) : SV_Target { fixed4 texcol = tex2D(_MainTex, i.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader index cac6036d8..2041c8199 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Shaders/Spine-SkeletonLit.shader @@ -194,7 +194,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.uv); clip(texcol.a - _Cutoff); SHADOW_CASTER_FRAGMENT(i)