Browse Source

GLTFLoader: Use Texture instead of CanvasTexture for ImageBitmaps (#21976)

Mr.doob 4 years ago
parent
commit
2383c1c0e4
1 changed files with 5 additions and 2 deletions
  1. 5 2
      examples/jsm/loaders/GLTFLoader.js

+ 5 - 2
examples/jsm/loaders/GLTFLoader.js

@@ -4,7 +4,6 @@ import {
 	Box3,
 	BufferAttribute,
 	BufferGeometry,
-	CanvasTexture,
 	ClampToEdgeWrapping,
 	Color,
 	DirectionalLight,
@@ -54,6 +53,7 @@ import {
 	Sphere,
 	SpotLight,
 	TangentSpaceNormalMap,
+	Texture,
 	TextureLoader,
 	TriangleFanDrawMode,
 	TriangleStripDrawMode,
@@ -2598,7 +2598,10 @@ class GLTFParser {
 
 					onLoad = function ( imageBitmap ) {
 
-						resolve( new CanvasTexture( imageBitmap ) );
+						const texture = new Texture( imageBitmap );
+						texture.needsUpdate = true;
+
+						resolve( texture );
 
 					};