-
fix(shader-transitions): add engine-render-mode init using tl.set tweens
发布于
2026-04-19 21:26:24 +00:00 When the page is loaded by the Hyperframes engine,
init()would happily set
up GL contexts and html2canvas captures even though the engine composites
every transition itself fromwindow.__hf.transitionsmetadata. That work was
both wasted and harmful: scenes were left atopacity: 0(waiting for the
async capture to resolve) when the engine sampled the DOM, so
queryElementStacking()reported them invisible and the layered HDR
compositor produced black frames between transitions.Engine mode is detected via
window.__HF_VIRTUAL_TIME__(the shim the engine
injects). When present,initEngineMode()runs instead of the GL pipeline and
schedules deterministic opacity flips:tl.set('#toId', { opacity: 1 }, T)// crossfade starttl.set('#fromId', { opacity: 0 }, T + d)// crossfade end
tl.set(zero-duration tweens) is required instead oftl.call, because
tl.callonly fires in the direction of playback. The engine's warmup loop
seeks forward through every transition start and then the main render loop
seeks back to t=0 —tl.call-set state would get stuck.tl.settweens
revert cleanly on backward seeks.The new path still calls the shared
registerTimeline()helper so the timeline
shows up onwindow.__timelines[compId]for the engine to drive.Made-with: Cursor
下载附件