godotengine / godotengine/godot
Texture2D importing doesn't expose compress/normal_map even though it still uses it.
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Godot v4.4.1.stable (49a5bc7b6)
### System information
Windows 10 (build 19045) - Multi-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 (NVIDIA; 32.0.15.7283) - AMD Ryzen 7 5700X 8-Core Processor (16 threads)
### Issue description
I was actually pulling my hair out on this one, apparently at some point I've changed my textures to Lossy and set normal map mode to Enabled and saved it as default preset for Texture2D.
After a while, everytime I was generating mipmaps for textures, the colors were getting extremely washed out, it was after a while of testing and narrowing down that I found out my texture.png.import had `compress/normal_map=1`, which isn't available for changing once you set compression mode to Lossless. (and exactly why I took forever to notice that was my problem all along).
I have no idea why that's hidden for lossless and available on all other options, but fixing it would be as simple as removing this IF in here: https://github.com/godotengine/godot/blob/4d1f26e1fd1fa46f2223fe0b6ac300744bf79b88/editor/import/resource_importer_texture.cpp#L203
### Steps to reproduce
- Open the texture import dock
- Set mode to Lossy
- set normal map to Enable
- Make sure generate mipmap is disabled
- Click Reimport
- Open the texture import dock again
- Set mode to Lossless
- Mark generate mipmaps and hit reimport
### Minimal reproduction project (MRP)
[normalmapflag.zip](https://github.com/user-attachments/files/21122109/normalmapflag.zip)
Contributor guide
Research direction
Inspect editor/import/resource_importer_texture.cpp around line 203, where the issue identifies the conditional hiding the normal-map option. Reproduce the Lossy-to-Lossless import sequence with the linked normalmapflag.zip project and verify that the compress/normal_map setting remains exposed and behaves as expected when lossless compression and mipmaps are used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100