From 2538c3401afd0fd5d6b169f3c535e4a41296fa23 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 9 Dec 2025 20:44:40 +0100 Subject: [PATCH] [unity] Fixed URP shaders compile error on Unity 6.3. Closes #2993. --- .../Shaders/2D/Spine-SkeletonLit-URP-2D.shader | 18 +++++++++++++----- .../Shaders/2D/Spine-Sprite-URP-2D.shader | 17 ++++++++++++----- .../package.json | 2 +- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/2D/Spine-SkeletonLit-URP-2D.shader b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/2D/Spine-SkeletonLit-URP-2D.shader index a3c0885b1..d725fcf87 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/2D/Spine-SkeletonLit-URP-2D.shader +++ b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/2D/Spine-SkeletonLit-URP-2D.shader @@ -39,10 +39,12 @@ Shader "Universal Render Pipeline/2D/Spine/Skeleton Lit" { // Required to compile gles 2.0 with standard srp library #pragma prefer_hlslcc gles #pragma exclude_renderers d3d11_9x - #pragma multi_compile USE_SHAPE_LIGHT_TYPE_0 __ - #pragma multi_compile USE_SHAPE_LIGHT_TYPE_1 __ - #pragma multi_compile USE_SHAPE_LIGHT_TYPE_2 __ - #pragma multi_compile USE_SHAPE_LIGHT_TYPE_3 __ + #if UNITY_VERSION < 60030000 // before Unity 6000.3 + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_0 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_1 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_2 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_3 __ + #endif // UNITY_VERSION < 60030000 #pragma multi_compile _ _LIGHT_AFFECTS_ADDITIVE #pragma shader_feature _TINT_BLACK_ON @@ -71,7 +73,13 @@ Shader "Universal Render Pipeline/2D/Spine/Skeleton Lit" { #pragma vertex CombinedShapeLightVertex #pragma fragment CombinedShapeLightFragment - #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl" + #if UNITY_VERSION < 60030000 // before Unity 6000.3 + #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl" + #else + #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/ShapeLightShared.hlsl" + #endif + #define USE_URP #include "../Include/SpineCoreShaders/Spine-Common.cginc" #include "../Include/SpineCoreShaders/Spine-Skeleton-Tint-Common.cginc" diff --git a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/2D/Spine-Sprite-URP-2D.shader b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/2D/Spine-Sprite-URP-2D.shader index 425eefb55..6558e6807 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/2D/Spine-Sprite-URP-2D.shader +++ b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/2D/Spine-Sprite-URP-2D.shader @@ -71,10 +71,12 @@ Shader "Universal Render Pipeline/2D/Spine/Sprite" // Required to compile gles 2.0 with standard srp library #pragma prefer_hlslcc gles #pragma exclude_renderers d3d11_9x - #pragma multi_compile USE_SHAPE_LIGHT_TYPE_0 __ - #pragma multi_compile USE_SHAPE_LIGHT_TYPE_1 __ - #pragma multi_compile USE_SHAPE_LIGHT_TYPE_2 __ - #pragma multi_compile USE_SHAPE_LIGHT_TYPE_3 __ + #if UNITY_VERSION < 60030000 // before Unity 6000.3 + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_0 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_1 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_2 __ + #pragma multi_compile USE_SHAPE_LIGHT_TYPE_3 __ + #endif // ------------------------------------- // Material Keywords @@ -106,7 +108,12 @@ Shader "Universal Render Pipeline/2D/Spine/Sprite" #define fixed3 half3 #define fixed half - #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl" + #if UNITY_VERSION < 60030000 // before Unity 6000.3 + #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl" + #else + #include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/ShapeLightShared.hlsl" + #endif #define SPRITE_SHADER_2D #include "../Include/Spine-Input-Sprite-URP.hlsl" diff --git a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json index 97e9b4f8d..926753a0a 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json +++ b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/package.json @@ -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.3.20 or newer.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)", - "version": "4.3.23", + "version": "4.3.24", "unity": "2019.3", "author": { "name": "Esoteric Software",