#glTF UV Map problem with Blender

9 messages · Page 1 of 1 (latest)

north shore
#

Hi everyone, hopefully someone can help me with this.

Disclaimer: I'm unfortunately not a Blender guy, I'm just hoping that this can be fixed relatively easily...

So, I have a generated (meaning, I did not make the model, nor the materials) spaceship in Blender (see renders with grey background).
I exported it to glTF, including UVs, materials and textures and imported it to the scene. It had no textures at all (see 3rd image).
Then I added an UV map in Blender (just by clicking to the + button in Object Data Properties -> UV Maps, exported it again, now it has textures, but all messed up (see 4th image -- sorry for the darkness there...).

I just wonder how does it show up correctly on the renders in Blender, I hope it's just a minor tweak to get it to work in Three and I don't have to manually mess around with texture placement, because I'm planning on creating many of these ships.

Can anyone push me in the right direction? I can share the .blend file if that helps.

Thanks is advance!

vapid egret
#

Threejs uses the 2nd UV set for AO and lightmaps, and the 1st UV set for everything else.

#

glTF and Blender are more flexible, but if the glTF file doesn’t follow that requirement then three.js won’t show it correctly.

north shore
#

Thanks @vapid egret, can you suggest any relatively easy method to make this work? If it involves lots of manual work, I will abandon this idea…

vapid egret
#

Depends entirely on what's in your .blend file, but, the model should have come with UVs and texture(s) that were made specifically for those UVs. Clicking the "add UVs" button in Blender is not going to do anything good, because the textures would've been made for some other, original UV set, the new UVs won't be compatible.

#

if you can share files that'd help to answer?

north shore
vapid egret
#

Hm, not going to be an easy fix here I don't think. The materials don't seem set up to use UVs at all, they're using object space coordinates, and I don't think you'll be able to export that from Blender.

#

It's probably possible to create a new UV layout, bake the old texture(s) to that UV layout, and then export the whole thing with the new texture... but that's a decently complex bit of work, you'd need someone who knows Blender better or to dig through some UV and baking tutorials I think.