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

This commit is contained in:
Harald Csaszar 2024-08-16 18:11:19 +02:00
parent d774632ccf
commit 80fb9f3c5a
4 changed files with 19 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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

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.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",