[unity] Fixed URP shader compile error at Unity 2021.2 (with URP 12.0 and newer). Closes #1912. Added commented-out include references to spine-core include files using package name, to be used when spine-unity is used via UPM package.

This commit is contained in:
Harald Csaszar 2021-10-29 16:16:12 +02:00
parent 5052b727de
commit dfa52de90d
5 changed files with 17 additions and 2 deletions

View File

@ -112,7 +112,18 @@
return main;
#endif
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, i.uv);
#if UNITY_VERSION < 202120
return half4(CombinedShapeLightShared(half4(main.rgb, 1), mask, i.lightingUV).rgb, main.a);
#else
SurfaceData2D surfaceData;
InputData2D inputData;
surfaceData.albedo = main.rgb;
surfaceData.alpha = 1;
surfaceData.mask = mask;
inputData.uv = i.uv;
inputData.lightingUV = i.lightingUV;
return half4(CombinedShapeLightShared(surfaceData, inputData).rgb, main.a);
#endif
}
ENDHLSL

View File

@ -1,2 +1,3 @@
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
#include "Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc"
#include "Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc"
//#include "Packages/com.esotericsoftware.spine.spine-unity/Runtime/spine-unity/Shaders/Sprite/CGIncludes/ShaderShared.cginc"

View File

@ -1,2 +1,3 @@
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
#include "Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Common.cginc"
//#include "Packages/com.esotericsoftware.spine.spine-unity/Runtime/spine-unity/Shaders/CGIncludes/Spine-Common.cginc"

View File

@ -1,2 +1,3 @@
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
#include "Assets/Spine/Runtime/spine-unity/Shaders/CGIncludes/Spine-Outline-Common.cginc"
//#include "Packages/com.esotericsoftware.spine.spine-unity/Runtime/spine-unity/Shaders/CGIncludes/Spine-Outline-Common.cginc"

View File

@ -1,2 +1,3 @@
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
#include "Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc"
#include "Assets/Spine/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc"
//#include "Packages/com.esotericsoftware.spine.spine-unity/Runtime/spine-unity/Shaders/Sprite/CGIncludes/SpriteLighting.cginc"