I`m new on three.js I’m working with a GLTF models exported from blender. My model has size of 11MB.
Alfter load the model Chrome use under 80MB of memory, but its loaded Chrome use more than 700MB of memory, I tried diposed render, and model, but doesn’t work. Do you have any idea to reduce the memory ? Thank you!
This will print the memory use of each mesh and texture in the model. The usual cause of this issue is that PNG and JPEG textures become fully uncompressed in GPU memory. The only way to avoid that is to reduce the resolution of the textures (unpack to separated .gltf, resize textures, repack to .glb), or to compress them using KTX2/Basis. glTF-Transform or gltfpack can do the KTX2/Basis compression for you, but it sometimes requires some tuning of the compression parameters to avoid compression artifacts.
Yeah, it’s just listing the (top-level) scenes. Usually there will only be one, but there could be more. The name of the first child is included because sometimes that’s more useful than the name of the scene. But listing the entire hierarchy would be pretty long, so I haven’t included that in the printout so far.
Hi! Need other advice. Do you know a tools that I can convert my texture from .jpg to .ktx2 ?
When I use GLTF-transform say this :
error: • Texture compression failed.
error: spawnSync toktx ENOENT
Could you report an issue on https://github.com/donmccurdy/glTF-Transform and share the file (or texture) that you can’t convert? gltfpack is another option, but both use the same library to convert JPG to KTX2, so I think the JPG might be using a compression feature that the compressor doesn’t support yet.
Even with .png is the same error. Yes, I’ll report
I try to use Basis Universal I understood that exist encoding for Desktop and Mobile, I use basisu to convert to .basis but just convert file form mobile version, Do you know a tool tu convert to .basis with BC7 encoding of the file?
By the other hand I see the example of basis and I see that just use one file and works fine for mobile and desktop, do you know the encoding? Or maybe the user Mugen87 know something about, I see that is a collaborator in this basis example and I see that is an active user. @Mugen87 can you help us ?
Thank you so much guys!
Do you know a tool tu convert to .basis with BC7 encoding of the file?
I think you’ve misunderstood – there are only two versions of .basis files, ETC1S or UASTC. They have different quality/size tradeoffs, ETC1S is smaller and lower quality. You load the .basis file on the device, and then THREE.BasisTextureLoader transcodes to whatever format the hardware needs, which could be BC7 or many others.
Did you see this example? It should automatically convert to BC7 if that is the most appropriate format for the hardware. Or there are low-level transcoders available specifically for BC7, but they are more advanced to use.
Oh I see, hm. No, I can’t say without looking at the demo and the texture. Can you share a demo?
If you can embed the basis textures in your glTF file it should handle a lot of things for you, but otherwise it can take a bit of understanding of compressed GPU textures to load textures this way yourself and deal with mipmaps correctly, etc.
I’d suggest making sure all textures are power-of-two dimensions, no larger than 2048x2048. The skin is an 8K texture, which many mobile devices won’t be able to handle. There are errors like this in the JS console that are important:
RENDER WARNING: texture bound to texture unit 0 is not renderable. It might be non-power-of-2 or have incompatible texture filtering (maybe)?
Blender doesn’t support basis textures, no. The CLI mentioned earlier in this thread can take a glTF file exported from Blender and convert it to a glTF file containing Basis (.ktx2) textures.
According to the first pic (for the 1st model), the render.info.memory.geometries = 15
But when I load the 2nd model (the second pic), the render.info.memory.geometries = 32
Actually the 2nd model only has 17 geometries and the 1st model has 15 geometries.