mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 18:26:12 +08:00
[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:
parent
5052b727de
commit
dfa52de90d
@ -112,7 +112,18 @@
|
|||||||
return main;
|
return main;
|
||||||
#endif
|
#endif
|
||||||
half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, i.uv);
|
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);
|
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
|
ENDHLSL
|
||||||
|
|||||||
@ -1,2 +1,3 @@
|
|||||||
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
|
// 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"
|
||||||
|
|||||||
@ -1,2 +1,3 @@
|
|||||||
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
|
// 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 "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"
|
||||||
|
|||||||
@ -1,2 +1,3 @@
|
|||||||
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
|
// 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 "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"
|
||||||
|
|||||||
@ -1,2 +1,3 @@
|
|||||||
// Adapt this path accordingly if you have unpacked the Spine directory to another location.
|
// 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"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user