Skip to content

Conversation

@AlexandrosGounis
Copy link
Contributor

A CanvasTexture can also receive an ImageBitmap, and this is how textures are loaded in worker threads.

The supported types should include an ImageBitmap.

Related discussion: https://discourse.threejs.org/t/offscreen-canvas-with-textures/11678

This example implements a CanvasTexture using an ImageBitmap:

var loader = new THREE.ImageBitmapLoader().setPath( path );
loader.setOptions( { imageOrientation: 'flipY' } );
loader.load( 'textures/matcaps/matcap-porcelain-white.jpg', function ( imageBitmap ) {
var texture = new THREE.CanvasTexture( imageBitmap );

@mrdoob mrdoob added this to the r125 milestone Jan 20, 2021
@mrdoob mrdoob merged commit 0025183 into mrdoob:dev Jan 20, 2021
@mrdoob
Copy link
Owner

mrdoob commented Jan 20, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants