Răsfoiți Sursa

[unity] Fixed URP shader compile errors on Unity 6. Closes #2603.

Harald Csaszar 1 an în urmă
părinte
comite
80fb9f3c5a

+ 6 - 0
spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-Common-URP.hlsl

@@ -14,6 +14,12 @@
 #endif
 #if IS_URP_14_OR_NEWER && !defined(_USE_WEBGL1_LIGHTS)
     #define IS_URP_15_OR_NEWER 1
+    #include "Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolume.hlsl"
+    #if defined(_APVWorldOffset)
+        #define IS_URP_17_OR_NEWER 1
+    #else
+        #define IS_URP_17_OR_NEWER 0
+    #endif
 #else
     #define IS_URP_15_OR_NEWER 0
 #endif

+ 6 - 1
spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-SkeletonLit-ForwardPass-URP.hlsl

@@ -149,7 +149,12 @@ VertexOutput vert(appdata v) {
 	half3 vertexSH;
 #if IS_URP_15_OR_NEWER
 	#ifdef OUTPUT_SH4
-		OUTPUT_SH4(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), vertexSH);
+		#if IS_URP_17_OR_NEWER
+			float4 ignoredProbeOcclusion;
+			OUTPUT_SH4(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), vertexSH, ignoredProbeOcclusion);
+		#else // 15 or newer
+			OUTPUT_SH4(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), vertexSH);
+		#endif
 	#else
 		OUTPUT_SH(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), vertexSH);
 	#endif

+ 6 - 1
spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Shaders/Include/Spine-Sprite-ForwardPass-URP.hlsl

@@ -313,7 +313,12 @@ VertexOutputLWRP ForwardPassVertexSprite(VertexInput input)
 
 #if IS_URP_15_OR_NEWER
 	#ifdef OUTPUT_SH4
-		OUTPUT_SH4(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), output.vertexSH);
+		#if IS_URP_17_OR_NEWER
+			float4 ignoredProbeOcclusion;
+			OUTPUT_SH4(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), output.vertexSH, ignoredProbeOcclusion);
+		#else // 15 or newer
+			OUTPUT_SH4(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), output.vertexSH);
+		#endif
 	#else
 		OUTPUT_SH(positionWS, normalWS.xyz, GetWorldSpaceNormalizeViewDir(positionWS), 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.2.\n(See http://esotericsoftware.com/git/spine-runtimes/spine-unity)",
-  "version": "4.2.37",
+  "version": "4.2.38",
   "unity": "2019.3",
   "author": {
     "name": "Esoteric Software",