fix(huoshan): 修复记忆淡入被noise遮挡并恢复材质失真交接
进记忆前保留 glitch_transition noise,begin 时透明淡出并改由 HuoshanMemory 材质承接轻微失真;记忆渲染进 HuoshanScreen 以进入 VolFx 合成。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -182,7 +182,8 @@ namespace AibisDream.MiniGame.Language
|
||||
/// <summary>
|
||||
/// 记忆淡入(非阻塞):透明度在 fadeDuration 内显现,画面同时按 pushSpeed 持续推近;
|
||||
/// targetOpacity 是本次淡入的目标透明度。horizontalSpeed 为旧 Yarn 兼容参数,基础层不再横移。
|
||||
/// 争夺段的 jolt / tear / impact 仍会叠加。
|
||||
/// 进记忆前可用 glitch_transition 铺 noise;begin 时会把 noise 淡出,改由记忆材质
|
||||
/// _SimGlitch / Analog 承接轻微失真。preserveGlitch 已忽略。争夺段 jolt/tear/impact 仍叠加。
|
||||
/// </summary>
|
||||
[YarnCommand("expression_memory_begin")]
|
||||
public static void ExpressionMemoryBegin(
|
||||
|
||||
@@ -342,9 +342,8 @@ namespace AibisDream.MiniGame.Language
|
||||
state = PresentationState.Memory;
|
||||
// 兜底:跳过 face_fade_in 直进记忆时,目标字仍切到演出白。
|
||||
particleManager?.ApplyPresentationResolvedVisuals(presentationResolvedColor);
|
||||
// 记忆失真全部走 HuoshanMemory 材质;清掉 noise 叠层残留。
|
||||
// preserveGlitch 已弃用:进记忆后失真只走 HuoshanMemory 材质,不再保留 noise 叠层。
|
||||
_ = preserveGlitch;
|
||||
SilenceNoiseOverlayIfPresent();
|
||||
|
||||
SpriteRenderer incoming = activeMemoryRenderer == memoryRendererA ? memoryRendererB : memoryRendererA;
|
||||
SpriteRenderer outgoing = activeMemoryRenderer;
|
||||
@@ -365,6 +364,10 @@ namespace AibisDream.MiniGame.Language
|
||||
float resolvedFadeDuration = fadeDuration > 0f
|
||||
? Mathf.Max(0.01f, fadeDuration)
|
||||
: memoryFadeDuration;
|
||||
|
||||
// 进记忆前的 glitch_transition noise → 透明叠层后淡出;
|
||||
// 记忆材质 _SimGlitch / Analog 随透明度一起浮现,完成交接。
|
||||
ReleaseNoiseOverlayIntoMemory(resolvedFadeDuration);
|
||||
SetMemoryOpacity(incoming, 0f);
|
||||
TweenMemoryOpacity(
|
||||
incoming,
|
||||
@@ -2080,11 +2083,37 @@ namespace AibisDream.MiniGame.Language
|
||||
if (glitchController == null)
|
||||
return;
|
||||
|
||||
// OpaqueBackground 即使 Intensity=0 仍会写满不透明黑底。
|
||||
// 记忆阶段切到 TransparentOverlay,避免盖住画面。
|
||||
glitchController.SetCompositeMode(SpriteNoiseGlitchController.CompositeMode.TransparentOverlay);
|
||||
glitchController.Intensity = 0f;
|
||||
glitchController.SetAmbientNoise(0f, 320f, 0f);
|
||||
glitchController.ClearCalmField(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 进记忆交接:把进场前的 noise 从「不透明黑底」切成透明叠层并淡出,
|
||||
/// 让记忆材质自身的 _SimGlitch / Analog 接上失真,而不是突然掐断或继续盖住画面。
|
||||
/// </summary>
|
||||
private void ReleaseNoiseOverlayIntoMemory(float memoryFadeDuration)
|
||||
{
|
||||
if (glitchController == null)
|
||||
return;
|
||||
|
||||
glitchController.SetCompositeMode(SpriteNoiseGlitchController.CompositeMode.TransparentOverlay);
|
||||
glitchController.SetAmbientNoise(0f, 320f, 0f);
|
||||
glitchController.ClearCalmField(true);
|
||||
|
||||
float releaseDuration = Mathf.Clamp(memoryFadeDuration * 0.35f, 0.12f, 0.55f);
|
||||
if (glitchController.Intensity <= 0.001f)
|
||||
{
|
||||
glitchController.Intensity = 0f;
|
||||
return;
|
||||
}
|
||||
|
||||
glitchController.TransitionTo(0f, releaseDuration);
|
||||
}
|
||||
|
||||
private void ResetNoiseOverlayForGlitchTransition()
|
||||
{
|
||||
if (glitchController == null)
|
||||
@@ -2322,6 +2351,11 @@ namespace AibisDream.MiniGame.Language
|
||||
{
|
||||
GameObject obj = new GameObject(objectName);
|
||||
obj.transform.SetParent(runtimeRoot, false);
|
||||
// 与粒子 / 屏幕同属 HuoshanScreen,进入 VolFx huoshan 合成;
|
||||
// 留在 Default 会被 sortingOrder 10 的不透明 noise 盖住。
|
||||
int huoshanScreen = LayerMask.NameToLayer("HuoshanScreen");
|
||||
if (huoshanScreen >= 0)
|
||||
obj.layer = huoshanScreen;
|
||||
SpriteRenderer renderer = obj.AddComponent<SpriteRenderer>();
|
||||
renderer.sharedMaterial = memoryMaterial;
|
||||
renderer.sortingOrder = 0;
|
||||
|
||||
Reference in New Issue
Block a user