What exactly is a second set of UVs ? If im not mistaken each model has its own UV. If by chance you duplicated you model and used the same UV. Its possible something carried over. For that go to Blender, select your object, then in the menu above, select object - relations - make local or make single user. If you have one model, and indeed somehow have 2 different UVs for the same model, then you can try to manipulate the UV properties in detail. console.log(yourgltfmodel), then the UV properties are located gltf.children.geometry.uv. Just remember the UVs use x and y coordinates, or rather u and v coordinates.
Thanks, ì’ve been struggling upon these for days! Anyway, i think that there is something broken in general. The documentation says that ao maps and light maps loaded from gltf are automatically mapped on the second uv set but that is not true, even the three js editor seems to be broken.
Forcing the use of the right channel through texture.channel solves it perfectly, thanks again
Previously GLTFLoader generated a second UV set (a copy of the first) for models containing AO maps, because AO maps in three.js required it. GLTFLoader has never done anything particular for lightmaps, because glTF does not support them.
Because three.js can now use an AO map with whichever UV set it’s actually supposed to use, GLTFLoader does nothing custom here anymore, and all textures default to .channel = 0 unless otherwise specified in the glTF file.
The documentation explains that ambient occlusion/light map need a seccond uv set. If i import a gltf model with 2 uv sets and if i don’t specify which one to use, the first set is picked by default instead of the second. It’s the same in the three.js editor webapp, i can use lightmaps and AO maps just with the first uv set and the second is totally ignored.
The lines that say “{aoMap,lightMap} requires a second set of UVs” are out of date, this is no longer true. We should fix this in the documentation. Because the second UV set is no longer required, neither GLTFLoader nor the editor are forcing your model to use them, that part is correct.
Ok good to know! In your opinion, willl be changed also the three.js editor so that is possible to choose which uv set to use for AO/light maps?
I’m asking this because should be really useful the usage of three.js editor for scenes setups, basically i’m trying to build a bridge from blender to three.js passing through the editor to prepare the scene (mostly shading and lighting) without coding. Does this make sense to you?
Makes sense to me – it would probably make sense to include this for all texture types, since aoMap and lightMap are no different anymore. It’d probably be best to open a feature request on GitHub, to make sure others are OK with the idea and it fits into the UI.