docs(three): add preserveDrawingBuffer and GSAP onUpdate pattern#583
docs(three): add preserveDrawingBuffer and GSAP onUpdate pattern#583gumibera wants to merge 1 commit intoheygen-com:mainfrom
Conversation
…kill The basic pattern in SKILL.md omits preserveDrawingBuffer: true on the WebGLRenderer constructor. Since HyperFrames captures frames via Puppeteer screenshots, WebGL canvases clear their drawing buffer after compositing and screenshots capture blank output. This is the same pattern already used internally by @hyperframes/shader-transitions. Additionally, documents the GSAP onUpdate callback as a reliable alternative to hf-seek events for compositions that use GSAP timelines. Discovered by 0xHoneyJar while building a Three.js + GLB composition with the Loa framework. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks for writing this up. I tried to reproduce the two claimed render failures on current What I tested:
What I observed:
So I do not think this PR proves or fixes the root issue yet. Could you add a small reproducible failing fixture, ideally a checked-in or gist-sized |
|
Hey Miguel, thanks for the thorough repro attempt — you were right. We went back and isolated the variables properly. Three test cases, identical compositions, only one variable changed per case:
Cases 2 and 3 are byte-for-byte identical across all frames. We originally debugged both issues simultaneously — when we went from "blank canvas" to "static model," we'd added The real and only issue is |
Summary
preserveDrawingBuffer: trueto theWebGLRendererconstructor in the/threeskill basic pattern — without it, Puppeteer screenshots capture blank WebGL canvasesonUpdatecallback as a reliable alternative tohf-seekevents for compositions that use GSAP timelinespreserveDrawingBufferto the Contract and Avoid sectionsContext
Discovered by 0xHoneyJar while building a Three.js + GLB composition using the Loa framework. The existing basic pattern in
skills/three/SKILL.mdsilently produces blank canvases duringnpx hyperframes renderbecause:WebGLRendererwithoutpreserveDrawingBuffer: trueclears its buffer after compositing — Puppeteer screenshots capture nothinghf-seekevents from the Three.js adapter may not reach user listeners reliably during Puppeteer frame capture (filed separately as an issue)The
preserveDrawingBufferpattern is already used internally by@hyperframes/shader-transitions(packages/shader-transitions/src/webgl.ts). The GSAPonUpdatepattern works because HyperFrames seeks GSAP timelines directly viatimeline.totalTime(), which fires the callback on every frame.Test plan
skills/three/SKILL.mdpasses skill lintnpx hyperframes renderand confirm WebGL canvas is visible in output🤖 Generated with Claude Code