Tweaks to clean up shader multi-compiles and formatting

This commit is contained in:
Andrew Cassidy 2024-07-23 21:54:39 -07:00
parent 92818edfaa
commit f1115ef188

View File

@ -43,13 +43,19 @@
} }
SubShader SubShader
{ {
Tags { "Queue" = "Geometry+100" "IgnoreProjector" = "true" "DisableBatching" = "true"} Tags
{
"Queue" = "Geometry+100" "IgnoreProjector" = "true" "DisableBatching" = "true"
}
Cull [_Cull] Cull [_Cull]
Pass Pass
{ {
Name "FORWARD" Name "FORWARD"
Tags { "LightMode" = "ForwardBase" } Tags
{
"LightMode" = "ForwardBase"
}
ZWrite [_ZWrite] ZWrite [_ZWrite]
ZTest LEqual ZTest LEqual
Blend SrcAlpha OneMinusSrcAlpha Blend SrcAlpha OneMinusSrcAlpha
@ -58,8 +64,7 @@
#pragma vertex vert #pragma vertex vert
#pragma fragment frag_forward #pragma fragment frag_forward
#pragma multi_compile_fwdbase nolightmap nodirlightmap nodynlightmap #pragma multi_compile DIRECTIONAL
#pragma skip_variants SHADOWS_DEPTH SHADOWS_CUBE SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING POINT_COOKIE
#pragma multi_compile_local __ DECAL_PREVIEW #pragma multi_compile_local __ DECAL_PREVIEW
#pragma multi_compile_local __ DECAL_BASE_NORMAL DECAL_BUMPMAP #pragma multi_compile_local __ DECAL_BASE_NORMAL DECAL_BUMPMAP
#pragma multi_compile_local __ DECAL_SPECMAP #pragma multi_compile_local __ DECAL_SPECMAP
@ -67,14 +72,16 @@
#pragma multi_compile_local __ DECAL_SDF_ALPHA #pragma multi_compile_local __ DECAL_SDF_ALPHA
#include "StandardDecal.cginc" #include "StandardDecal.cginc"
ENDCG ENDCG
} }
Pass Pass
{ {
Name "FORWARD" Name "FORWARD"
Tags { "LightMode" = "ForwardAdd" } Tags
{
"LightMode" = "ForwardAdd"
}
ZWrite Off ZWrite Off
ZTest LEqual ZTest LEqual
Blend SrcAlpha One Blend SrcAlpha One
@ -84,8 +91,7 @@
#pragma vertex vert #pragma vertex vert
#pragma fragment frag_forward #pragma fragment frag_forward
#pragma multi_compile_fwdadd nolightmap nodirlightmap nodynlightmap #pragma multi_compile DIRECTIONAL SPOT POINT
#pragma skip_variants SHADOWS_DEPTH SHADOWS_CUBE SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING POINT_COOKIE
#pragma multi_compile_local __ DECAL_PREVIEW #pragma multi_compile_local __ DECAL_PREVIEW
#pragma multi_compile_local __ DECAL_BASE_NORMAL DECAL_BUMPMAP #pragma multi_compile_local __ DECAL_BASE_NORMAL DECAL_BUMPMAP
#pragma multi_compile_local __ DECAL_SPECMAP #pragma multi_compile_local __ DECAL_SPECMAP
@ -93,14 +99,16 @@
#pragma multi_compile_local __ DECAL_SDF_ALPHA #pragma multi_compile_local __ DECAL_SDF_ALPHA
#include "StandardDecal.cginc" #include "StandardDecal.cginc"
ENDCG ENDCG
} }
Pass Pass
{ {
Name "DEFERRED_PREPASS" Name "DEFERRED_PREPASS"
Tags { "LightMode" = "Deferred" } Tags
{
"LightMode" = "Deferred"
}
ZWrite Off ZWrite Off
ZTest LEqual ZTest LEqual
Offset -1, -1 Offset -1, -1
@ -115,15 +123,19 @@
#pragma multi_compile_local __ DECAL_BASE_NORMAL #pragma multi_compile_local __ DECAL_BASE_NORMAL
#pragma multi_compile_local __ DECAL_SDF_ALPHA #pragma multi_compile_local __ DECAL_SDF_ALPHA
#include "StandardDecal.cginc" #define DECAL_PREPASS
#include "StandardDecal.cginc"
ENDCG ENDCG
} }
Pass Pass
{ {
Name "DEFERRED" Name "DEFERRED"
Tags { "LightMode" = "Deferred" } Tags
{
"LightMode" = "Deferred"
}
ZWrite Off ZWrite Off
ZTest LEqual ZTest LEqual
Offset -1, -1 Offset -1, -1
@ -132,7 +144,8 @@
Blend 2 SrcAlpha OneMinusSrcAlpha, Zero One Blend 2 SrcAlpha OneMinusSrcAlpha, Zero One
Blend 3 SrcAlpha OneMinusSrcAlpha, Zero One Blend 3 SrcAlpha OneMinusSrcAlpha, Zero One
Stencil { Stencil
{
Ref 1 Ref 1
Comp Always Comp Always
Pass Replace Pass Replace
@ -151,7 +164,6 @@
#pragma multi_compile_local __ DECAL_SDF_ALPHA #pragma multi_compile_local __ DECAL_SDF_ALPHA
#include "StandardDecal.cginc" #include "StandardDecal.cginc"
ENDCG ENDCG
} }
} }