更新Shader

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2026-04-11 22:16:08 +08:00
parent 04802fca15
commit e02c7f5e89
18 changed files with 21046 additions and 19118 deletions

View File

@@ -37,16 +37,15 @@ namespace Ichni.RhythmGame
public override void Refresh()
{
base.Refresh();
if (shadowRenderer == null || shadowRenderer.material == null) return;
var mat = shadowRenderer.material;
MaterialPropertyBlock materialPropertyBlock = new MaterialPropertyBlock();
materialPropertyBlock.SetColor("_Color", colorSubmodule.currentBaseColor);
materialPropertyBlock.SetColor("_ShadowColor", colorSubmodule.currentEmissionColor);
materialPropertyBlock.SetFloat("_ShadowThreshold", shadowThreshold);
materialPropertyBlock.SetFloat("_ShadowSmoothness", shadowSmoothness);
materialPropertyBlock.SetVector("_FakeLightDir", new Vector4(fakeLightDir.x, fakeLightDir.y, fakeLightDir.z, 0));
materialPropertyBlock.SetFloat("_UseWorldLight", useWorldLight ? 1 : 0);
shadowRenderer.SetPropertyBlock(materialPropertyBlock);
Material material = shadowRenderer.material;
material.SetColor("_Color", colorSubmodule.currentBaseColor);
material.SetColor("_ShadowColor", colorSubmodule.currentEmissionColor);
material.SetFloat("_ShadowThreshold", shadowThreshold);
material.SetFloat("_ShadowSmoothness", shadowSmoothness);
material.SetVector("_FakeLightDir", new Vector4(fakeLightDir.x, fakeLightDir.y, fakeLightDir.z, 0));
if (useWorldLight) material.EnableKeyword("_USEWORLDLIGHT");
else material.DisableKeyword("_USEWORLDLIGHT");
}
// 可选:在属性变更时自动刷新