#GLB and KTX2 texture files are each separated not merged in one file in most of popular websites

12 messages · Page 1 of 1 (latest)

hybrid sluice
#

Hi everyone. I spent a lot of time to figure out the problem that wrote above.
https://www.sprite.com/zerolimits
for example, in this website, I could see all textures were not merged into glb file but loaded seperately like image file and then merged in Javascript code.
I tried the same approach but didn't work..!
as you can see on third photo, it looks like the problem is from uv mapping, so I checked the blender file and deleted useless uv map and then exported again, but didn't work too.
my 3d framework is r3f and wrote the sample code below this as well since I'm not sure if blender or my code is the problem.

import texture from '/path/to/ktx_texture'
import glb from '/path/to/glb'
...
const texture = useKTX2(texture) // same as .png with useTexture(pngImage);
const { nodes } = useGLTF(glb)
...
<mesh geometry={nodes.Plane003.geometry}>
<meshStandardMaterial map={texture} />
</mesh>
...

also I was wondering if seperating glb and ktx2 has more benefit than one single glb containing ktx2

Discover your legacy in the Hall of Zero Limits

hybrid sluice
#

my uv map looks like this, and exported diffuse map as well

snow wasp
#

did you try testing texture.flipY= false ?

hybrid sluice
unborn sorrel
#

For parallel download maybe

snow wasp
#

Advantages of Loading images separately

  • you can update textures quickly without editing the model
  • you can have resolution versions like 1k 2k 4k and load based on performance or have a texture lod system
  • if your 3d software can't embed ktx or avif or webP into the glb , applying externally helps
  • model without textures can load very quickly and user gets feedback immediately (good ux) , & textures can take it's own time to load (like sketchfab)
hybrid sluice
hybrid sluice
unborn sorrel
#

Yes but the texture will start to download only after you parse and download the glb. Total file size does not change in this case, what changes is the total download time

hybrid sluice
snow wasp
#

added one more point in the list cat_blush