[unity] Fixed shader compile error occurring during build on Unity URP versions 12.x and 13.x.

This commit is contained in:
Harald Csaszar 2023-02-28 19:50:04 +01:00
parent 15f9e39b14
commit 2f1b0b860c
4 changed files with 15 additions and 5 deletions

View File

@ -1,6 +1,16 @@
#ifndef SPINE_COMMON_URP_INCLUDED
#define SPINE_COMMON_URP_INCLUDED
#ifdef USE_FORWARD_PLUS
#define IS_URP_14_OR_NEWER 1
#else
#define IS_URP_14_OR_NEWER 0
#endif
#if defined(_WRITE_RENDERING_LAYERS) && IS_URP_14_OR_NEWER
#define USE_WRITE_RENDERING_LAYERS
#endif
#ifdef _LIGHT_LAYERS
uint GetMeshRenderingLayerBackwardsCompatible()
{

View File

@ -152,7 +152,7 @@ VertexOutput vert(appdata v) {
}
half4 frag(VertexOutput i
#ifdef _WRITE_RENDERING_LAYERS
#ifdef USE_WRITE_RENDERING_LAYERS
, out float4 outRenderingLayers : SV_Target1
#endif
) : SV_Target0

View File

@ -285,7 +285,7 @@ VertexOutputLWRP ForwardPassVertexSprite(VertexInput input)
}
half4 ForwardPassFragmentSprite(VertexOutputLWRP input
#ifdef _WRITE_RENDERING_LAYERS
#ifdef USE_WRITE_RENDERING_LAYERS
, out float4 outRenderingLayers : SV_Target1
#endif
) : SV_Target0
@ -302,7 +302,7 @@ half4 ForwardPassFragmentSprite(VertexOutputLWRP input
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
inputData.shadowCoord = input.shadowCoord;
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS);
inputData.shadowCoord = TransformWorldToShadowCoord(input.positionWS.xyz);
#elif defined(_MAIN_LIGHT_SHADOWS)
inputData.shadowCoord = input.shadowCoord;
#else
@ -352,7 +352,7 @@ half4 ForwardPassFragmentSprite(VertexOutputLWRP input
COLORISE(pixel)
APPLY_FOG_LWRP(pixel, input.fogFactorAndVertexLight.x)
#ifdef _WRITE_RENDERING_LAYERS
#ifdef USE_WRITE_RENDERING_LAYERS
uint renderingLayers = GetMeshRenderingLayerBackwardsCompatible();
outRenderingLayers = float4(EncodeMeshRenderingLayer(renderingLayers), 0, 0, 0);
#endif

View File

@ -2,7 +2,7 @@
"name": "com.esotericsoftware.spine.urp-shaders",
"displayName": "Spine Universal RP Shaders",
"description": "This plugin provides universal render pipeline (URP) shaders for the spine-unity runtime.\n\nPrerequisites:\nIt requires a working installation of the spine-unity runtime, version 4.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
"version": "4.1.9",
"version": "4.1.10",
"unity": "2019.3",
"author": {
"name": "Esoteric Software",