(WIP) KTX2Loader: Return DataTexture when transcoding to uncompressed format#29926
(WIP) KTX2Loader: Return DataTexture when transcoding to uncompressed format#29926donmccurdy wants to merge 3 commits intomrdoob:devfrom
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
@Mugen87 I'm running into the old problems from #26642 (comment) here, I'm just not sure how to properly set up mipmaps for DataTexture, DataArrayTexture, and DataCubeTexture classes. I've left Data3DTexture out of scope for this PR. I see what looks like a TODO about it here: three.js/src/renderers/webgl/WebGLTextures.js Lines 1301 to 1307 in de9b967 I also feel worried about this pattern... texture = new DataCubeTexture( mipmaps[ 0 ].data, format, type );
texture.mipmaps = mipmaps.map( ( mip ) => new DataCubeTexture( mip.data, mip.width, mip.height ) );... since the other existing pattern is to initialize a CubeTexture with an array of 6 DataTextures, but here we have one DataCubeTexture per mip, not per face, and it's pretty inconsistent. Is this something we could work out for the |
Yes, it think this TODO should eventually be resolved. Ideally, the image and mipmaps property behaves the same for all texture types. The policy should be: If no mipmaps are present, the engine evaluates the |
Work in progress. Tested and working for:
Related: