From c9fb1c372cbfd5757c96d76822ccbf635773c768 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 29 Aug 2023 21:00:26 +0200 Subject: [PATCH] [unity] Fixed URP shaders compile error on Unity 2023.1 since Unity changed the OUTPUT_SH() signature back again in the same URP package patch version 15.0.6. See #2311. See commit 5635f31. --- .../Shaders/Include/Spine-SkeletonLit-ForwardPass-URP.hlsl | 6 +++++- .../Shaders/Include/Spine-Sprite-ForwardPass-URP.hlsl | 6 +++++- .../com.esotericsoftware.spine.urp-shaders/package.json | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-SkeletonLit-ForwardPass-URP.hlsl b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-SkeletonLit-ForwardPass-URP.hlsl index 3a647da69..82eb2e348 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-SkeletonLit-ForwardPass-URP.hlsl +++ b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-SkeletonLit-ForwardPass-URP.hlsl @@ -148,7 +148,11 @@ VertexOutput vert(appdata v) { // Note: ambient light is also handled via SH. half3 vertexSH; #if IS_URP_15_OR_NEWER - OUTPUT_SH(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), vertexSH); + #ifdef OUTPUT_SH4 + OUTPUT_SH4(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), vertexSH); + #else + OUTPUT_SH(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), vertexSH); + #endif #else OUTPUT_SH(normalWS.xyz, vertexSH); #endif diff --git a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-Sprite-ForwardPass-URP.hlsl b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-Sprite-ForwardPass-URP.hlsl index 1e768e3da..2c59395a5 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-Sprite-ForwardPass-URP.hlsl +++ b/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-Sprite-ForwardPass-URP.hlsl @@ -312,7 +312,11 @@ VertexOutputLWRP ForwardPassVertexSprite(VertexInput input) #endif #if IS_URP_15_OR_NEWER - OUTPUT_SH(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), output.vertexSH); + #ifdef OUTPUT_SH4 + OUTPUT_SH4(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), output.vertexSH); + #else + OUTPUT_SH(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), output.vertexSH); + #endif #else OUTPUT_SH(normalWS.xyz, output.vertexSH); #endif 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 9455e1d1b..b751acb68 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.1.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)", - "version": "4.1.20", + "version": "4.1.21", "unity": "2019.3", "author": { "name": "Esoteric Software",