three.js icon indicating copy to clipboard operation
three.js copied to clipboard

WebGPURenderer: multiple canvas support

Open aardgoose opened this issue 1 year ago • 3 comments

This introduces a CanvasRenderTarget() to represent a screen canvas, which can be used via renderer.setRenderTarget() for use with WebGPU, thus supporting multiple canvases.

The default screen canvas state in Renderer() is replaced by a CanvasRenderTarget(). - this may be too much code change?

aardgoose avatar Jan 26 '24 20:01 aardgoose

The API feels amazing!!

LeviPesin avatar Jan 28 '24 15:01 LeviPesin

This PR sounds great to PR. @mrdoob @Mugen87 Any thoughts on this approach?

const canvasRT = new CanvasRenderTarget( { domElement } );

renderer.setRenderTarget( canvasRT );

sunag avatar Feb 24 '24 07:02 sunag

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
683.5 kB (169.2 kB) 683.5 kB (169.2 kB) +0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
460.7 kB (111.1 kB) 460.7 kB (111.1 kB) +0 B

github-actions[bot] avatar Jul 14 '24 17:07 github-actions[bot]