Optmize shader structure

This commit is contained in:
Misaki
2025-01-31 17:25:19 +09:00
parent f41c6c9b34
commit e8d1d5923a
19 changed files with 287 additions and 95 deletions

View File

@@ -80,9 +80,6 @@ SAMPLER(sampler_CoatMaskMap);
TEXTURE2D(_SSSLutMap);
//SAMPLER(sampler_SSSLutMap); //Use s_linear_clamp_sampler instead
TEXTURE2D(_SDFShadowTex);
SAMPLER(sampler_SDFShadowTex);
TEXTURE2D(_HairShadowTex);
TEXTURE2D(_HairBlendingTex);
@@ -184,10 +181,6 @@ float _SpecularAAThreshold;
#ifndef LAYERED_LIT_SHADER
// Set of users variables
float4 _BaseColor;
float4 _BaseColorMap_ST;
float4 _BaseColorMap_TexelSize;
float4 _BaseColorMap_MipInfo;
float _Metallic;
float _MetallicRemapMin;
@@ -325,21 +318,6 @@ PROP_DECL(float, _LinkDetailsWithBase);
#endif // LAYERED_LIT_SHADER
// Tessellation specific
#ifdef TESSELLATION_ON
float _TessellationFactor;
float _TessellationFactorMinDistance;
float _TessellationFactorMaxDistance;
float _TessellationFactorTriangleSize;
float _TessellationShapeFactor;
float _TessellationBackFaceCullEpsilon;
float _TessellationObjectScale;
float _TessellationTilingScale;
#endif
// Following two variables are feeded by the C++ Editor for Scene selection
int _ObjectId;
int _PassValue;

View File

@@ -1,14 +1,18 @@
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
TEXTURE2D(_1st_ShadeMap);
TEXTURE2D(_2nd_ShadeMap);
TEXTURE2D(_1stShadeColorMap);
TEXTURE2D(_2ndShadeColorMap);
TEXTURE2D(_SDFShadowMap);
SAMPLER(sampler_SDFShadowMap);
TEXTURE2D_ARRAY(_ShadingGradeMap);
TEXTURE2D(_MatCapMap);
sampler _Set_1st_ShadePosition;
sampler _Set_2nd_ShadePosition;
sampler _ShadingGradeMap;
sampler _HighColor_Tex;
sampler _Set_HighColorMask;
sampler _Set_RimLightMask;

View File

@@ -1,25 +1,29 @@
// cosntant in Unity Toon Shader
// Shading Color
float4 _BaseColor;
float4 _BaseColorMap_ST;
float4 _BaseColorMap_TexelSize;
float4 _BaseColorMap_MipInfo;
float4 _1stShadeColor;
float4 _2ndShadeColor;
fixed _UseBaseAs1st;
fixed _Use1stAs2nd;
float _SDFShadowLevel;
float _SDFSmoothLevel;
float _SDFHighlightStrength;
float _SDFHighlightSmoothLevel;
float _ShadingIndex;
float _utsTechnique;
float4 _Color;
fixed _Use_BaseAs1st;
fixed _Use_1stAs2nd;
fixed _Is_LightColor_Base;
float4 _1st_ShadeColor;
fixed _Is_LightColor_1st_Shade;
float4 _2nd_ShadeColor;
fixed _Is_LightColor_2nd_Shade;
fixed _Is_NormalMapToBase;
fixed _Set_SystemShadowsToBase;
float _SurfaceFeatures;
float _Tweak_SystemShadowsLevel;
float _ShadowBias;
float _SDFShadowLevel;
float _SDFSmoothGamma;
float _SDFNoseHighlightCoef;
float _SDFNoseHighlightSmoothRange;
float _EyeParallaxAmount;
float _HairBlendingFactor;