mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-12 10:08:44 +08:00
[unity] Fixed shader compile error with Unity 2019.4 and Urp 7.4.1. Closes #1700. Shader cleanup, removal of unused instancing vars and separate alpha texture variable.
This commit is contained in:
parent
af8691c98e
commit
3a1dcd651a
@ -11,8 +11,6 @@ Shader "Spine/Outline/Sprite/Pixel Lit"
|
||||
_BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
@ -8,8 +8,6 @@ Shader "Spine/Outline/Sprite/Unlit"
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
|
||||
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
|
||||
|
||||
_ZWrite ("Depth Write", Float) = 0.0
|
||||
_Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0
|
||||
|
||||
@ -11,8 +11,6 @@ Shader "Spine/Outline/Sprite/Vertex Lit"
|
||||
_BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
// Upgrade NOTE: upgraded instancing buffer 'PerDrawSprite' to new syntax.
|
||||
|
||||
// Upgrade NOTE: upgraded instancing buffer 'PerDrawSprite' to new syntax.
|
||||
|
||||
#ifndef SHADER_SHARED_INCLUDED
|
||||
#define SHADER_SHARED_INCLUDED
|
||||
|
||||
@ -13,28 +11,6 @@
|
||||
#include "UnityCG.cginc"
|
||||
#endif
|
||||
|
||||
#ifdef UNITY_INSTANCING_ENABLED
|
||||
|
||||
UNITY_INSTANCING_BUFFER_START(PerDrawSprite)
|
||||
// SpriteRenderer.Color while Non-Batched/Instanced.
|
||||
fixed4 unity_SpriteRendererColorArray[UNITY_INSTANCED_ARRAY_SIZE];
|
||||
// this could be smaller but that's how bit each entry is regardless of type
|
||||
float4 unity_SpriteFlipArray[UNITY_INSTANCED_ARRAY_SIZE];
|
||||
UNITY_INSTANCING_BUFFER_END(PerDrawSprite)
|
||||
|
||||
#define _RendererColor unity_SpriteRendererColorArray[unity_InstanceID]
|
||||
#define _Flip unity_SpriteFlipArray[unity_InstanceID]
|
||||
|
||||
#endif // instancing
|
||||
|
||||
CBUFFER_START(UnityPerDrawSprite)
|
||||
#ifndef UNITY_INSTANCING_ENABLED
|
||||
fixed4 _RendererColor;
|
||||
float4 _Flip;
|
||||
#endif
|
||||
float _EnableExternalAlpha;
|
||||
CBUFFER_END
|
||||
|
||||
////////////////////////////////////////
|
||||
// Space functions
|
||||
//
|
||||
@ -376,11 +352,6 @@ inline fixed4 applyFog(fixed4 pixel, float fogCoordOrFactorAtLWRP)
|
||||
|
||||
uniform sampler2D _MainTex;
|
||||
|
||||
#if ETC1_EXTERNAL_ALPHA
|
||||
//External alpha texture for ETC1 compression
|
||||
uniform sampler2D _AlphaTex;
|
||||
#endif //ETC1_EXTERNAL_ALPHA
|
||||
|
||||
#if _TEXTURE_BLEND
|
||||
uniform sampler2D _BlendTex;
|
||||
uniform float _BlendAmount;
|
||||
@ -401,11 +372,6 @@ inline fixed4 calculateTexturePixel(float2 texcoord)
|
||||
pixel = tex2D(_MainTex, texcoord);
|
||||
#endif // !_TEXTURE_BLEND
|
||||
|
||||
#if ETC1_EXTERNAL_ALPHA
|
||||
fixed4 alpha = tex2D (_AlphaTex, texcoord);
|
||||
pixel.a = lerp (pixel.a, alpha.r, _EnableExternalAlpha);
|
||||
#endif
|
||||
|
||||
#if defined(_COLOR_ADJUST)
|
||||
pixel = adjustColor(pixel);
|
||||
#endif // _COLOR_ADJUST
|
||||
|
||||
@ -9,8 +9,6 @@ Shader "Spine/Sprite/Pixel Lit"
|
||||
_BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
@ -6,8 +6,6 @@ Shader "Spine/Sprite/Unlit"
|
||||
_Color ("Color", Color) = (1,1,1,1)
|
||||
|
||||
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
|
||||
|
||||
_ZWrite ("Depth Write", Float) = 0.0
|
||||
_Cutoff ("Depth alpha cutoff", Range(0,1)) = 0.0
|
||||
|
||||
@ -9,8 +9,6 @@ Shader "Spine/Sprite/Vertex Lit"
|
||||
_BumpMap ("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex ("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
@ -9,8 +9,6 @@ Shader "Lightweight Render Pipeline/Spine/Sprite"
|
||||
_BumpMap("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[MaterialToggle] PixelSnap("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha("Enable External Alpha", Float) = 0
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
@ -10,8 +10,6 @@ Shader "Universal Render Pipeline/2D/Spine/Sprite"
|
||||
_BumpMap("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[MaterialToggle] PixelSnap("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha("Enable External Alpha", Float) = 0
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
@ -9,8 +9,6 @@ Shader "Universal Render Pipeline/Spine/Sprite"
|
||||
_BumpMap("Normal Map", 2D) = "bump" {}
|
||||
|
||||
[MaterialToggle] PixelSnap("Pixel snap", Float) = 0
|
||||
[PerRendererData] _AlphaTex("External Alpha", 2D) = "white" {}
|
||||
[PerRendererData] _EnableExternalAlpha("Enable External Alpha", Float) = 0
|
||||
|
||||
_EmissionColor("Color", Color) = (0,0,0,0)
|
||||
_EmissionMap("Emission", 2D) = "white" {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user