fix: 拖尾方块塌缩(displayMetrics 未应用导致 trail 永不 shift)+ hyper-space 文字层级
- PostFX: setDisplayMetrics 原挂在 resize effect,但 effectComposer ref 尚未就绪时 return,之后 size 不变不再重跑 → cssResolution 停在 (1,1),JS 端 16px 单元格换算成 16 个 UV 宽,lastPointerCell 永不前进,尾迹数组从不 shift,只剩 trail[0] 一个方块。改为 useFrame 内按尺寸+dpr 变更键控应用(原站 useFrame 每帧调用等价语义) - HyperSpaceSection: 文字容器补 z-30。原站整个 main 内容堆叠在 canvas 宿主之上(canvas fixed z-auto 在 main 前),文字永远在 WebGL 之上;我们 canvas 是 z-30 fixed,hyper-space 漏加 z-30 被箭头不透明底盖住,Innovate with purpose / 四段主张 / FUTURE-FIRST 全部不可见 - 验证:covered 区尾迹 cells 展开+strengths 衰减+空闲淡出;seg0 字符 opacity=1 且 section 在 canvas 之上;build+tsc 通过
This commit is contained in:
@@ -149,11 +149,24 @@ export function PostFX() {
|
||||
const pointerDevRef = useRef(new Vector2(-1, -1));
|
||||
const trailUvRef = useRef(new Vector2(-1, -1));
|
||||
const lastMovedAtRef = useRef(0);
|
||||
// Display metrics must be (re)applied whenever the composer becomes
|
||||
// available — the resize effect can fire before EffectComposer assigns its
|
||||
// ref (and size alone won't change again), which left cssResolution at
|
||||
// (1,1): the JS trail then computed one giant cell, lastPointerCell never
|
||||
// advanced and the lime pointer trail collapsed to a single square.
|
||||
const lastMetricsKeyRef = useRef("");
|
||||
|
||||
useFrame((_state, delta) => {
|
||||
const composer = composerRef.current;
|
||||
if (!composer) return;
|
||||
|
||||
const dprNow = Math.min(gl.getPixelRatio(), 2);
|
||||
const metricsKey = `${size.width}x${size.height}x${dprNow}`;
|
||||
if (lastMetricsKeyRef.current !== metricsKey) {
|
||||
lastMetricsKeyRef.current = metricsKey;
|
||||
fluidPass.setDisplayMetrics(size.width, size.height, dprNow);
|
||||
}
|
||||
|
||||
const r = sT(scrollBus.sP);
|
||||
coveredRef.current = sD(
|
||||
coveredRef.current,
|
||||
|
||||
Reference in New Issue
Block a user