浏览代码

[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.

Harald Csaszar 2 年之前
父节点
当前提交
c9fb1c372c

+ 5 - 1
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

+ 5 - 1
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

+ 1 - 1
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",