godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.45k stars 20.25k forks source link

Unwrap UV2 for Lightmap/AO option causes mesh to turn into black cube #85041

Open BlockyDK opened 10 months ago

BlockyDK commented 10 months ago

Godot version

4.2.rc1

System information

Godot v4.2.rc1 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.3699) - AMD Ryzen 5 3600 6-Core Processor (12 Threads)

Issue description

When attempting to generate UV2 for lightmapping when using the mesh drop down menu on the toolbar, the mesh turns into a black cube. The UV's do seem to generate correctly though UnwrapUV2Bug

Steps to reproduce

  1. Import a mesh as a .gltf
  2. In Godot, right click that mesh and choose New Inherited Scene
  3. In the new inherited scene, select the mesh instance
  4. In the inspector, click the drop down next to mesh (directly under MeshInstance3D) and choose Make Unique
  5. With the mesh instance still selected, click the Mesh menu on the toolbar
  6. Click Unwrap UV2 for Lightmap/AO

The mesh should turn into a black cube, but the original orange bounding box can still be seen. The UV2 will have still been successfully generated. Instancing this scene in another scene still shows it as a black cube.

Minimal reproduction project

UV_Unwrap_MRP.zip

Calinou commented 10 months ago

The correct approach to generating UV2 in an imported 3D scene is to use the Import options to use the Static + Lightmaps GI mode (or do so in the Advanced Import Settings dialog for more granular options). The Mesh menu should only be used in specific cases, not for imported scenes.