Information About Loading TGA in Three.js

Asked 1 years ago, Updated 1 years ago, 38 views

Include the TGALoader for TGA loading in Three.js.

// Excerpts only from affected parts
var loader;
vartgaLoader = new THREE.TGALoader (this.manager);
loader = tgaLoader;
varmaterialLoader = new THREE.MaterialLoader (this.manager);
var texture=loader.load(fullPath, function(t){

            t.flipY=false;
            t.wrapS = THREE.RepeatWrapping;
            t.wrapT = THREE.RepeatWrapping;

            if(isPhysicalReflectionMapping===true){

                t.mapping = THREE.SphericalReflectionMapping;

            }

} );

Yes, but

WebGL:drawArrays:texture bound to texture unit 1 is not rendersable.It may be non-power-of-2 and have compatible texture filtering or is not 'texture complete'.Or the texture is Float or Half Float type with linear filtering while OES_float_linear_extension.

The error did not display.We have verified that changing the TGALoader to DefaultLoader and changing the resources will load correctly.
Three.js sample site (http://threejs.org/examples/webgl_materials_texture_tga.html) does not load TGA files with similar errors in my environment.

javascript three.js

2022-09-30 18:49

1 Answers

Three.js r74 fixed it.

http://threejs.org/examples/webgl_materials_texture_tga.html


2022-09-30 18:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.