[unity] Fixed errors in URP blend mode shaders when main and additional lights are disabled. Closes #2592.

This commit is contained in:
Harald Csaszar 2024-08-08 16:06:10 +02:00
parent 94d26d2b52
commit 0bcdc314b4
4 changed files with 118 additions and 4 deletions

View File

@ -63,6 +63,44 @@
ENDHLSL
}
UsePass "Universal Render Pipeline/Spine/Skeleton/SHADOWCASTER"
// UsePass "Universal Render Pipeline/Spine/Skeleton/SHADOWCASTER"
// Note: UsePass above fails when both main and additional lights are disabled, thus inlined below.
Pass
{
Name "ShadowCaster"
Tags{"LightMode" = "ShadowCaster"}
ZWrite On
ColorMask 0
ZTest LEqual
Cull Off
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
// -------------------------------------
// Material Keywords
#pragma shader_feature _ALPHATEST_ON
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma shader_feature _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma vertex ShadowPassVertexSkeletonLit
#pragma fragment ShadowPassFragmentSkeletonLit
#define USE_URP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "../Include/Spine-Input-URP.hlsl"
#include "../Include/Spine-SkeletonLit-ShadowCasterPass-URP.hlsl"
ENDHLSL
}
}
}

View File

@ -63,6 +63,44 @@
ENDHLSL
}
UsePass "Universal Render Pipeline/Spine/Skeleton/SHADOWCASTER"
// UsePass "Universal Render Pipeline/Spine/Skeleton/SHADOWCASTER"
// Note: UsePass above fails when both main and additional lights are disabled, thus inlined below.
Pass
{
Name "ShadowCaster"
Tags{"LightMode" = "ShadowCaster"}
ZWrite On
ColorMask 0
ZTest LEqual
Cull Off
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
// -------------------------------------
// Material Keywords
#pragma shader_feature _ALPHATEST_ON
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma shader_feature _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma vertex ShadowPassVertexSkeletonLit
#pragma fragment ShadowPassFragmentSkeletonLit
#define USE_URP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "../Include/Spine-Input-URP.hlsl"
#include "../Include/Spine-SkeletonLit-ShadowCasterPass-URP.hlsl"
ENDHLSL
}
}
}

View File

@ -63,6 +63,44 @@
ENDHLSL
}
UsePass "Universal Render Pipeline/Spine/Skeleton/SHADOWCASTER"
// UsePass "Universal Render Pipeline/Spine/Skeleton/SHADOWCASTER"
// Note: UsePass above fails when both main and additional lights are disabled, thus inlined below.
Pass
{
Name "ShadowCaster"
Tags{"LightMode" = "ShadowCaster"}
ZWrite On
ColorMask 0
ZTest LEqual
Cull Off
HLSLPROGRAM
// Required to compile gles 2.0 with standard srp library
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d11_9x
#pragma target 2.0
// -------------------------------------
// Material Keywords
#pragma shader_feature _ALPHATEST_ON
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma shader_feature _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma vertex ShadowPassVertexSkeletonLit
#pragma fragment ShadowPassFragmentSkeletonLit
#define USE_URP
#define fixed4 half4
#define fixed3 half3
#define fixed half
#include "../Include/Spine-Input-URP.hlsl"
#include "../Include/Spine-SkeletonLit-ShadowCasterPass-URP.hlsl"
ENDHLSL
}
}
}

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.36",
"version": "4.2.37",
"unity": "2019.3",
"author": {
"name": "Esoteric Software",