Files
Cielonos/Assets/OtherPlugins/GraphicsCat/Modules/LitPlus/Shaders/LitPlus.shader
SoulliesOfficial d15957c719 更新
2025-12-17 04:19:38 -05:00

522 lines
21 KiB
GLSL

Shader "GraphicsCat/LitPlus"
{
Properties
{
[BeginFoldout(Render Settings)]
[BeginRenderSettings]
_SURFACE_TYPE("", Int) = 0
_AlphaClipping("", Int) = 0
_Cutoff("", Range(0, 1)) = 0.5
_Cull("", Int) = 2
_ZTest("", Int) = 4
_ZWriteControl("", Int) = 0
_ZWrite("", Int) = 1
_BlendControl("", Int) = 0
_SrcBlend("", Int) = 1
_DstBlend("", Int) = 0
_AlphaSrcBlend("", Int) = 1
_AlphaDstBlend("", Int) = 0
_PreserveSpecular("", Int) = 1
_CastShadows("", Int) = 1.0
_ReceiveShadows("", Int) = 1.0
_QueueControl("", Int) = 0
_QueueOffset("", Int) = 0
[EndRenderSettings]
[EndFoldout]
[BeginFoldout(Surface Inputs)]
[BeginMiniTextureWithColor]
[MainTexture] _BaseMap("Base Map [Albedo texture]", 2D) = "white" {}
[MainColor] _BaseColor("Base Color", Color) = (1, 1, 1, 1)
[EndMiniTextureWithColor]
[Separator]
[MiniTexture][NoScaleOffset] _BaseMaskMap("Base Mask Map [RGBA packed mask]", 2D) = "white" {}
[MiniTexture][NoScaleOffset] _ExtraMaskMap("Extra Mask Map [RGBA packed mask]", 2D) = "white" {}
[Separator]
[IntEnum(None, Base Mask R, Base Mask G, Base Mask B, Base Mask A, Extra Mask R, Extra Mask G, Extra Mask B, Extra Mask A)]
_MetallicSrc("Metallic Source [Channel used for metallic map]", Int) = 1
[FloatRange(0f, 1f)] _Metallic("Metallic [Final = Mask * Metallic]", Float) = 1
[Space]
[IntEnum(None, Base Mask R, Base Mask G, Base Mask B, Base Mask A, Extra Mask R, Extra Mask G, Extra Mask B, Extra Mask A)]
_SmoothnessSrc("Smoothness Source [Channel used for smoothness map]", Int) = 4
[FloatRange(0f, 1f)] _Smoothness("Smoothness [Final = Mask * Smoothness]", Float) = 1
[Space]
[IntEnum(None, Base Mask R, Base Mask G, Base Mask B, Base Mask A, Extra Mask R, Extra Mask G, Extra Mask B, Extra Mask A)]
_OcclusionSrc("Occlusion Source [Channel used for occlusion map]", Int) = 0
[FloatRange(0f, 1f)] _OcclusionStrength("Occlusion [Final = Mask * Occlusion]", Float) = 1
[Separator]
[Toggle(_NORMALMAP)] _NORMALMAP("Normal Map [Enable normal mapping]", Float) = 0
[BeginEnableIf(_NORMALMAP, Equal, 1)]
[MiniTexture][NoScaleOffset][Normal] _BumpMap("Normal Map", 2D) = "bump" {}
[FloatRange(0f, 2f)] _BumpScale("Scale [Strength of normal map]", Float) = 1.0
[EndEnableIf]
[Separator]
[Toggle(_PARALLAXMAP)] _PARALLAXMAP("Height Map", Float) = 0
[BeginEnableIf(_PARALLAXMAP, Equal, 1)]
[MiniTexture][NoScaleOffset] _ParallaxMap("Height Map", 2D) = "black" {}
[FloatRange(0.005, 0.08)] _ParallaxScale("Scale [Strength of height map]", Float) = 0.005
[EndEnableIf]
[EndFoldout]
[BeginFoldout(Ambient)]
[KeywordEnum(Off, On)] _INDIRECT_DIFFUSE("Mode", Float) = 1
[BeginEnableIf(_INDIRECT_DIFFUSE, Greater, 0)]
[Separator]
[MultiLineVector(2, Top, 0f, 5f, Bottom, 0f, 5f)]
_IndirectDiffuseParams("Brightness", Vector) = (1, 1, 0, 0)
[EndEnableIf]
[EndFoldout]
[BeginFoldout(Diffuse)]
[KeywordEnum(Off, Default, Ramp, Skin)] _DIRECT_DIFFUSE("Mode", Float) = 1
[BeginEnableIf(_DIRECT_DIFFUSE, Greater, 0)]
[Separator]
[FloatRange(0, 1)]_DirectDiffuseShadowLift("Shadow Lift [Brighten shadowed area]", Float) = 0
[BeginShowIf(_DIRECT_DIFFUSE, Equal, 2)]
[Separator]
[MiniTexture][NoScaleOffset] _DirectDiffuseRamp("Ramp Texture", 2D) = "black" {}
[EndShowIf]
[BeginShowIf(_DIRECT_DIFFUSE, Equal, 3)]
[Separator]
[Label(Skin)]
[IntEnum(None, Base Mask R, Base Mask G, Base Mask B, Base Mask A, Extra Mask R, Extra Mask G, Extra Mask B, Extra Mask A)]
_DirectDiffuseSkinCurvatureSrc("Curvature Source [Channel for skin rendering curvature src]", Int) = 0
[FloatRange(0, 1)] _DirectDiffuseSkinCurvatureScale("Curvature", Float) = 1
[MiniTexture][NoScaleOffset] _DirectDiffuseSkinLUT("Skin LUT [Lookup texture for skin rendering]", 2D) = "gray" {}
[MultiLineVector(4, Brightness, 0f, 2f, Light Color Influence, 0f, 1f, Shadow Strength, 0f, 1f, Rim Power, 0f, 1f) ]
_DirectDiffuseSkinParams("Params", Vector) = (1, 0.5, 0.5, 0.35)
[EndShowIf]
[EndEnableIf]
[EndFoldout]
[BeginFoldout(Highlights)]
[KeywordEnum(Off, Default, Hair)] _DIRECT_SPECULAR("Mode [Mode of direct specular]", Float) = 1
[BeginEnableIf(_DIRECT_SPECULAR, Greater, 0)]
[Separator]
[HDR] _DirectSpecularColor("Color [Specular color]", Color) = (1, 1, 1, 1)
[BeginShowIf(_DIRECT_SPECULAR, Equal, 2)]
[Separator]
[MultiLineVector(4, Strength, 0f, 10f, Power, 1f, 128f, Shift, n10f, 10f, Shift From FlowMap Z, n1f, 1f)]
_DirectSpecularHairParams("Hair Specular", Vector) = (1, 64, 0, 0)
[EndShowIf]
[BeginShowIf(_DIRECT_SPECULAR, Equal, 3)]
[Separator]
[MultiLineVector(3, Strength, 0.1f, 2f, Tangential Roughness, 0.00001f, 2f, Bitangential Roughness, 0.00001f, 2f)]
_DirectSpecularAnisoParams("Anisotropy", Vector) = (1, 0.25, 0.75, 1)
[EndShowIf]
[BeginShowIf(_DIRECT_SPECULAR, GreaterEqual, 2)]
[Separator]
[Toggle(_DIRECT_SPECULAR_FLOWMAP)] _DIRECT_SPECULAR_FLOWMAP("Flow Map", Float) = 0
[BeginEnableIf(_DIRECT_SPECULAR_FLOWMAP, Greater, 0)]
[MiniTexture][NoScaleOffset] _DirectSpecularFlowMap("Flow Map [RG: Direction, B: Hair Shift]", 2D) = "gray" {}
[EndEnableIf]
[EndShowIf]
[EndEnableIf]
[EndFoldout]
[BeginFoldout(Reflections)]
[KeywordEnum(Off, Default, Custom)] _INDIRECT_SPECULAR("Mode [Specular reflection mode]", Float) = 1
[BeginEnableIf(_INDIRECT_SPECULAR, Greater, 0)]
[Separator]
[MultiLineVector(2, Strength, 0f, 2f, Fresnel, 0f, 2f)]
_IndirectSpecularParams("Params", Vector) = (1, 1, 1, 1)
[BeginShowIf(_INDIRECT_SPECULAR, Equal, 2)]
[Separator]
[NoScaleOffset][MiniTexture] _IndirectSpecularCustomCubeMap("Custom CubeMap [CubeMap for specular reflection]", Cube) = "white" {}
[EndShowIf]
[EndEnableIf]
[EndFoldout]
[BeginFoldout(Emission)]
[KeywordEnum(Off, On)] _EMISSION("Mode [Enable or disable emission]", Float) = 0
[BeginEnableIf(_EMISSION, Greater, 0)]
[Separator]
[IntEnum(None, Base Mask R, Base Mask G, Base Mask B, Base Mask A, Extra Mask R, Extra Mask G, Extra Mask B, Extra Mask A)]
_EmissionMaskSrc("Mask Source [Channel used for emission mask]", Int) = 0
[Separator]
[BeginMiniTextureWithColor]
_EmissionMap("Emission Map [Texture driving emission]", 2D) = "white" {}
[HDR] _EmissionColor("Emission Color [Color multiplier for emission]", Color) = (1, 1, 1, 1)
[EndMiniTextureWithColor]
[LightmapEmissionFlags]
[Separator]
[KeywordEnum(Off, Directional, FlowMap)] _EMISSION_FLOWMODE("Flow Mode", Float) = 0
[BeginShowIf(_EMISSION_FLOWMODE, Equal, 1)]
[MultiLineVector(3, Direction X, n1f, 1f, Direction Y, n1f, 1f, Speed, 0.1f, 10f)]
_EmissionDirectionalFlowParams("Params", Vector) = (0, 1, 1, 0)
[EndShowIf]
[BeginShowIf(_EMISSION_FLOWMODE, Equal, 2)]
[MiniTexture][NoScaleOffset] _EmissionFlowMap("Flow Map [RG: Direction]", 2D) = "linearGray" {}
[MultiLineVector(2, Speed, 0.1f, 10f, Strength, n5f, 5f)]
_EmissionFlowMapParams("Params", Vector) = (1, 1, 0, 0)
[EndShowIf]
[EndEnableIf]
[EndFoldout]
[BeginFoldout(Detail)]
[KeywordEnum(Off, On)] _DETAIL("Mode [Detail on/off]", Float) = 0
[BeginEnableIf(_DETAIL, Greater, 0)]
[Separator]
[IntEnum(None, Base Mask R, Base Mask G, Base Mask B, Base Mask A, Extra Mask R, Extra Mask G, Extra Mask B, Extra Mask A)]
_DetailMaskSrc("Mask Source [Which channel to use as mask]", Int) = 0
[Separator]
[MiniTexture] _DetailAlbedoMap("Base Map [The detail texture]", 2D) = "linearGrey" {}
[FloatRange(0f, 2f)] _DetailAlbedoMapScale("Scale", Float) = 1
[Separator]
[NoScaleOffset][Normal][MiniTexture] _DetailNormalMap("Normal Map [Detail normal map]", 2D) = "bump" {}
[FloatRange(0f, 2f)] _DetailNormalMapScale("Scale [Strength of the normal map]", Float) = 1
// [Separator]
// [MultiLineVector(4, Start Height, n50f, 50f, Height Transition, 0f, 100f, Start Angle, n1f, 1f, Angle Transition, 0f, 2f)]
// _DetailParams("Params", Vector) = (-50, 0, -1, 0)
[EndEnableIf]
[EndFoldout]
[BeginFoldout(MatCap)]
[MiniTexture][NoScaleOffset] _MatCapMaskMap("Mask Map [MatCap Layer Masks]", 2D) = "white" {}
[Separator]
[Toggle(_MATCAP_LAYER1)] _MATCAP_LAYER1("Layer 1", Int) = 0
[BeginEnableIf(_MATCAP_LAYER1, Equal, 1)]
[IntEnum(Alpha, Premultiply, Additive, Multiply)] _MatCapBlendMode1("Blend Mode", Int) = 2
[BeginMiniTextureWithColor]
[NoScaleOffset] _MatCap1("MatCap", 2D) = "white" {}
_MatCapColor1("Color", Color) = (1, 1, 1, 1)
[EndMiniTextureWithColor]
[FloatRange(0, 10)] _MatCapStrength1("MatCap Strength", Float) = 1
[FloatRange(0, 1)] _MatCapBaseMapInfluence1("Base Map Influence", Float) = 1
[FloatRange(0, 1)] _MatCapLightColorInfluence1("Light Color Influence", Float) = 1
[FloatRange(0, 1)] _MatCapShadowStrength1("Shadow Strength", Float) = 1
[FloatRange(0, 360)] _MatCapRotationDegrees1("Rotation Degrees", Float) = 0
[EndEnableIf]
[Separator]
[Toggle(_MATCAP_LAYER2)] _MATCAP_LAYER2("Layer 2", Int) = 0
[BeginEnableIf(_MATCAP_LAYER2, Equal, 1)]
[IntEnum(Alpha, Premultiply, Additive, Multiply)] _MatCapBlendMode2("Blend Mode", Int) = 2
[BeginMiniTextureWithColor]
[NoScaleOffset] _MatCap2("MatCap", 2D) = "white" {}
_MatCapColor2("Color", Color) = (1, 1, 1, 1)
[EndMiniTextureWithColor]
[FloatRange(0, 10)] _MatCapStrength2("MatCap Strength", Float) = 1
[FloatRange(0, 1)] _MatCapBaseMapInfluence2("Base Map Influence", Float) = 1
[FloatRange(0, 1)] _MatCapLightColorInfluence2("Light Color Influence", Float) = 1
[FloatRange(0, 1)] _MatCapShadowStrength2("Shadow Strength", Float) = 1
[FloatRange(0, 360)] _MatCapRotationDegrees2("Rotation Degrees", Float) = 0
[EndEnableIf]
[Separator]
[Toggle(_MATCAP_LAYER3)] _MATCAP_LAYER3("Layer 3", Int) = 0
[BeginEnableIf(_MATCAP_LAYER3, Equal, 1)]
[IntEnum(Alpha, Premultiply, Additive, Multiply)] _MatCapBlendMode3("Blend Mode", Int) = 2
[BeginMiniTextureWithColor]
[NoScaleOffset] _MatCap3("MatCap", 2D) = "white" {}
_MatCapColor3("Color", Color) = (1, 1, 1, 1)
[EndMiniTextureWithColor]
[FloatRange(0, 10)] _MatCapStrength3("MatCap Strength", Float) = 1
[FloatRange(0, 1)] _MatCapBaseMapInfluence3("Base Map Influence", Float) = 1
[FloatRange(0, 1)] _MatCapLightColorInfluence3("Light Color Influence", Float) = 1
[FloatRange(0, 1)] _MatCapShadowStrength3("Shadow Strength", Float) = 1
[FloatRange(0, 360)] _MatCapRotationDegrees3("Rotation Degrees", Float) = 0
[EndEnableIf]
[Separator]
[Toggle(_MATCAP_LAYER4)] _MATCAP_LAYER4("Layer 4", Int) = 0
[BeginEnableIf(_MATCAP_LAYER4, Equal, 1)]
[IntEnum(Alpha, Premultiply, Additive, Multiply)] _MatCapBlendMode4("Blend Mode", Int) = 2
[BeginMiniTextureWithColor]
[NoScaleOffset] _MatCap4("MatCap", 2D) = "white" {}
_MatCapColor4("Color", Color) = (1, 1, 1, 1)
[EndMiniTextureWithColor]
[FloatRange(0, 10)] _MatCapStrength4("MatCap Strength", Float) = 1
[FloatRange(0, 1)] _MatCapBaseMapInfluence4("Base Map Influence", Float) = 1
[FloatRange(0, 1)] _MatCapLightColorInfluence4("Light Color Influence", Float) = 1
[FloatRange(0, 1)] _MatCapShadowStrength4("Shadow Strength", Float) = 1
[FloatRange(0, 360)] _MatCapRotationDegrees4("Rotation Degrees", Float) = 0
[EndEnableIf]
[EndFoldout]
[BeginFoldout(Rim)]
[KeywordEnum(Off, On)] _RIM("Mode [Mode of Rim effect]", Float) = 0
[BeginEnableIf(_RIM, Greater, 0)]
[Separator]
[HDR] _RimColor("Color", Color) = (1, 1, 1, 1)
[FloatRange(0, 1)] _RimShadowStrength("Shadow Strength", Float) = 0.5
[Separator]
[MultiLineVector(3, Start, 0f, 1f, Range, 0f, 1f, Power, 0.1f, 8f)]
_RimParams("Rim Params", Vector) = (0, 1, 4, 1)
[Separator]
[MultiLineVector(4, X, n1f, 1f, Y, n1f, 1f, Z, n1f, 1f, Strength, 0f, 1f)]
_RimDirection("Direction", Vector) = (0, 1, 0, 0)
[EndEnableIf]
[EndFoldout]
/*
[BeginFoldout(Shadow Color)]
[KeywordEnum(Off, On)] _SHADOW_COLOR("Shadow Color", Float) = 0
[BeginEnableIf(_SHADOW_COLOR, Greater, 0)]
[Separator]
_ShadowColor("Shadow Color [Color of the shadow]", Color) = (0.5, 0.5, 0.5, 1)
[EndEnableIf]
[EndFoldout]
*/
/*
[BeginFoldout(Outline)]
[KeywordEnum(Off, On)] _OUTLINE("Mode", Float) = 0
[BeginEnableIf(_OUTLINE, Greater, 0)]
[Separator]
_OutlineColor("Color [Outline color]", Color) = (0.5, 0.5, 0.5, 1)
[FloatRange(0, 1)] _OutlineThickness("Thickness [Outline thickness]", Float) = 0.0025
[EndEnableIf]
[Separator]
[HelpBox(Warning)] _OutlineHelpBox("The Outline feature requires configuring the Render Objects feature in the camera's Renderer to function properly. For more details, please refer to the LitPlus documentation.", Float) = 0
[EndFoldout]
*/
[BeginFoldout(Debug Colors)]
[KeywordEnum(Off, On)] _DEBUG_COLORS("Mode", Float) = 0
[BeginEnableIf(_DEBUG_COLORS, Greater, 0)]
[Separator]
[IntEnum(Off, RGB, R, G, B, A)] _DebugVertColor("Vertex Color", int) = 0
[IntEnum(Off, XY, ZW)] _DebugUV("UV", int) = 0
[IntEnum(Off, Base Map, Base Map Alpha, Normal Map, Height Mask)] _DebugMapColor("Map Color", int) = 0
[IntEnum(Off, Base Mask R, Base Mask G, Base Mask B, Base Mask A, Extra Mask R, Extra Mask G, Extra Mask B, Extra Mask A)] _DebugMaskChannel("Mask Channel", int) = 0
[IntEnum(Off, Metallic, Smoothness, Roughness, Diffuse Color, Specular Color)] _DebugPBRData("PBR Data", int) = 0
[IntEnum(Off, Vert Normal, Vert Tangent, Vert Bitangent, Frag Normal, Frag Tangent, Frag Bitangent)] _DebugTBN("WorldSpace TBN", int) = 0
[IntEnum(Off, NdotL, NdotV, One Minus NdotV)] _DebugDotProduct("Dot Product", int) = 0
[IntEnum(Off, Color, Direction, Attenuation)] _DebugMainLightData("Main Light Data", int) = 0
[IntEnum(Off, Indirect Diffuse, Indirect Specular)] _DebugGI("Global Illumination", int) = 0
[IntEnum(Off, Indirect Diffuse, Direct Diffuse, Direct Specular, Indirect Specular)] _DebugLightingComponent("Lighting Component", int) = 0
[IntEnum(Off, H, S, V)] _DebugFinalHSV("Final HSV", int) = 0
[EndEnableIf]
[EndFoldout]
[HideInInspector]_("", Float) = 0
}
SubShader
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
"RenderType" = "Opaque"
"IgnoreProjector" = "True"
}
HLSLINCLUDE
#pragma enable_d3d11_debug_symbols
// Macros required for all passes
#pragma multi_compile_instancing
#pragma shader_feature_local _ _SURFACE_TYPE_OPAQUE _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local _ _ALPHATEST_ON
#include "Includes/Common/Precision.hlsl"
#include "Includes/Features/Misc/LODCrossFade.hlsl"
ENDHLSL
Pass
{
Name "ForwardLit"
Tags { "RenderType" = "Opaque" }
Cull [_Cull]
ZTest [_ZTest]
ZWrite [_ZWrite]
Blend [_SrcBlend][_DstBlend], [_AlphaSrcBlend][_AlphaDstBlend]
HLSLPROGRAM
#include_with_pragmas "Includes/Keywords/MaterialKeywords.hlsl"
#include_with_pragmas "Includes/Keywords/UnityKeywords.hlsl"
#include_with_pragmas "Includes/Keywords/URPKeywords.hlsl"
#pragma vertex VertexForwardLit
#pragma fragment FragmentForwardLit
#include "Includes/Passes/ForwardPass.hlsl"
ENDHLSL
}
/*
Pass
{
Name "Outline"
Tags { "LightMode" = "Outline" }
Cull Front
ZTest [_ZTest]
ZWrite [_ZWrite]
Blend [_SrcBlend][_DstBlend],[_AlphaSrcBlend][_AlphaDstBlend]
HLSLPROGRAM
#define PASS_OUTLINE 1
#include_with_pragmas "Includes/Keywords/MaterialKeywords.hlsl"
#include_with_pragmas "Includes/Keywords/UnityKeywords.hlsl"
#include_with_pragmas "Includes/Keywords/URPKeywords.hlsl"
#pragma vertex VertexForwardLit
#pragma fragment FragmentForwardLit
#include "Includes/Passes/ForwardPass.hlsl"
ENDHLSL
}
*/
Pass
{
Name "ShadowCaster"
Tags { "LightMode" = "ShadowCaster" }
Cull [_Cull]
ZWrite On
ZTest LEqual
ColorMask 0
HLSLPROGRAM
#pragma vertex VertexShadowCaster
#pragma fragment FragmentShadowCaster
#include "Includes/Passes/ShadowCasterPass.hlsl"
ENDHLSL
}
Pass
{
Name "DepthOnly"
Tags { "LightMode" = "DepthOnly" }
Cull [_Cull]
ZTest [_ZTest]
ZWrite [_ZWrite]
ColorMask 0
HLSLPROGRAM
#pragma vertex DepthOnlyVertex
#pragma fragment DepthOnlyFragment
#include "Includes/Passes/DepthOnlyPass.hlsl"
ENDHLSL
}
Pass
{
Name "DepthNormals"
Tags { "LightMode" = "DepthNormals" }
Cull [_Cull]
ZTest [_ZTest]
ZWrite [_ZWrite]
HLSLPROGRAM
#pragma vertex DepthNormalsVertex
#pragma fragment DepthNormalsFragment
#include "Includes/Passes/DepthNormalsPass.hlsl"
ENDHLSL
}
Pass
{
Name "Meta"
Tags { "LightMode" = "Meta" }
Cull Off
HLSLPROGRAM
#include_with_pragmas "Includes/Keywords/MaterialKeywords.hlsl"
#pragma vertex VertexMeta
#pragma fragment FragmentMeta
#include "Includes/Passes/MetaPass.hlsl"
ENDHLSL
}
}
CustomEditor "GraphicsCat.MarkupShaderGUI"
FallBack "Universal Render Pipeline/Unlit"
}