Open hristoiankov opened 5 months ago
This feature is quite important since most licensed assets have materials setup in this way with a secondary UV Map. Not having this can hold Godot back from competing with the ease of importing marketplace assets in engines like Unreal and Unity.
Godot supports multiple materials for a mesh, but even when those are defined, there is no way to set which UV Map the materials should use.
There should be a per-texture UV Map selection.
This selection only exists for the detail texture, but a similar dropdown for the main material Albedo, Metallic, Roughness, Emission, and Normal Map textures would be ideal.
Once this option is available, the import can be extended to set the UV Map index from the gltf/glb file.
Thanks for opening this issue! I've fixed it as much as possible in PR #96748. This doesn't support everything that can possibly be specified in glTF, since that would require changes to Godot's material system (at which point, a proposal would be needed to justify why custom UV assignment, and UV3/UV4/etc, are required in the core engine).
Tested versions
System information
Windows 10 - Godot v4.2.2.stable - Vulkan (Forward +) - dedicated GPU
Issue description
The UV Map node is ignored in materials in imported gltf/glb models. Godot instead defaults to the first UV Map for all materials.
From left to right (Godot, Blender, 3D Viewer): The above image shows Blender and 3D Viewer rendering the materials using the correct UV map, while Godot is ignoring the assigned UV Map and using the default.
When the UV Map node is removed from the materials, Blender renders the model the same way as it shows up in Godot:
Steps to reproduce
Minimal reproduction project (MRP)
From left to right (Godot, Windows 3D Viewer):
The right image correctly shows the UVMap.001being used for the GreenMaterial.
cube-2uv-materials.zip