Skip to content

Commit

Permalink
Merge pull request #1333 from anatawa12/fakeshadow
Browse files Browse the repository at this point in the history
fix compatibility with liltoon fakeshadow and fur
  • Loading branch information
anatawa12 authored Nov 7, 2024
2 parents 9aa7bef + 746b77a commit 80af0a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Editor/APIInternal/ShaderInformation.Liltoon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public override void GetMaterialInformation(MaterialInformationCallback matInfo)
return STAndScrollRotateToMatrix("_MainTex_ST", "_MainTex_ScrollRotate");
}

#region Default.lilblock / DefaultALL.lilblock
matInfo.RegisterTextureUVUsage("_DitherTex", SamplerStateInformation.LinearRepeatSampler,
UsingUVChannels.NonMesh, null); // dither UV is based on screen space

Expand Down Expand Up @@ -558,7 +559,18 @@ public override void GetMaterialInformation(MaterialInformationCallback matInfo)
}

// _BaseMap and _BaseColorMap are unused

#endregion Default.lilblock

#region DefaultFurCutout, DefaultFurTransparent, DefaultAll,
// fur
LIL_SAMPLE_2D_ST("_FurNoiseMask", "_MainTex", UsingUVChannels.UV0);
LIL_SAMPLE_2D_ST_WithMat("_FurMask", "_MainTex", uvMain, uvMainMatrix);
LIL_SAMPLE_2D_ST_WithMat("_FurLengthMask", "_MainTex", uvMain, uvMainMatrix);
LIL_SAMPLE_2D_WithMat("_FurLengthMask", SamplerStateInformation.LinearRepeatSampler, UsingUVChannels.UV0,
STToMatrix($"_MainTex_ST"));
LIL_SAMPLE_2D_WithMat("_FurVectorTex", SamplerStateInformation.LinearRepeatSampler, uvMain, uvMainMatrix);

#endregion
// Vertex ID
var idMaskProperties = new[]
{
Expand Down
1 change: 1 addition & 0 deletions Editor/Processors/ShaderMaterialInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public override void RegisterTextureUVUsage(
if ((_supportedKind & ShaderInformationKind.TextureAndUVUsage) == 0)
throw new InvalidOperationException("RegisterOtherUVUsage is not registered as supported information");
if (_textureUsageInformations == null) return;
if (_material.HasTexture(textureMaterialPropertyName)) return;
UVChannel uvChannel;
switch (uvChannels)
{
Expand Down

0 comments on commit 80af0a7

Please sign in to comment.