Replies: 1 comment
-
|
Hi @vincesp, this sounds quite interesting, since it's a feature request, I will convert it into a discussion so we can take it further |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
As a TresJS developer, I want to be able to render a three scene into an
OffscreenCanvasso that I can generate screenshots for downloading without having to add the scene to the DOM.This is particularly interesting when using a library like h264-mp4-encoder to render several frames into a movie for downloading.
Suggested solution
three's
WebGLRendererwhich is used in useRendererManager.ts has support for bothHTMLCanvasElementandOffscreenCanvas, see WebGLRenderer.js#L3424.Suggested solution:
TresOffscreenCanvascomponent that creates anOffscreenCanvasinstead of a<canvas>elementconvertToBlob(),getContext('2d').getImageData(), ortransferToImageBitmap()OffscreenCanvasis used, disable features related to auto-resizing or event handling throughout Tres that are not available nor meaningful for a canvas that is not part of the DOMAlternative
No response
Additional context
We use three in Vue for our project to render image data. The tool has a screenshot feature that can either export the current frame as PNG or all frames (with the current view's settings) as MP4. This currently works well with three and an
OffscreenCanvas. However, as complexity grows, our code would benefit from a transition to a declarative approach using Tres. But without support for an OffscreenCanvas, implementing the screenshot features will become cumbersome.Validations
Beta Was this translation helpful? Give feedback.
All reactions