Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Texture colors are not accurate #103458

Open
Nodragem opened this issue Mar 2, 2025 · 10 comments
Open

Texture colors are not accurate #103458

Nodragem opened this issue Mar 2, 2025 · 10 comments

Comments

@Nodragem
Copy link
Contributor

Nodragem commented Mar 2, 2025

Tested versions

4.4RC2

System information

Godot v4.4.rc2 - Windows 11 (build 22631) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 32.0.15.6119) - Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (12 threads)

Issue description

I was observing a slight different in color when applying a texture that uses the color ba6653 as opposed to when setting the albedo color to ba6653.

It turns out that when checking the color in Godot's the thumbnail, the color is bd6c5a:
Image

I double checked that the color was exported correctly by Substance Designer, by checking the color on the Windows 11's thumbnail:

Image

Steps to reproduce

  1. Chose a color
  2. make a texture filled with that color outside Godot (e.g. in Inkscape, GIMP, etc),
  3. import it
  4. check the thumbnail color in Godot with the color picker (e.g. from Godot, or external tool)

Image

Minimal reproduction project (MRP)

See attachment.
albedo_texture_test.zip

@AThousandShips
Copy link
Member

This is probably due to sRGB, try enabling is sRGB in the material and compare

Please upload a minimal project if this doesn't solve the difference, as this needs more details

@Nodragem
Copy link
Contributor Author

Nodragem commented Mar 2, 2025

do you mean Texture Force sRGB?

Image

This change the color even more.

@AThousandShips
Copy link
Member

I mean vertex colours, but try that one too

@Nodragem
Copy link
Contributor Author

Nodragem commented Mar 2, 2025

the difference is already observeable in the thumbnail of the imported texture, so the material's setting have no effect on it. I added a minimal project.

@AThousandShips
Copy link
Member

As asked previously an MRP should be a complete project next time uploading an MRP please upload a project, not just loose files, especially since the paths in this zip are invalid as you put the files in the root folder instead

After fixing the project I'm unsure what I'm supposed to see, the two cubes are the same color, what is the expected result?

@Lielay9
Copy link
Contributor

Lielay9 commented Mar 2, 2025

The images import setting compress/mode is set to "VRAM Compressed" which has the effect of reducing the images quality in favor of smaller size. Changing the setting to either "Lossless" or "VRAM Uncompressed" will retain the original pixel color. This is explained in the tooltip, the documentation of CompressedTexture2D and in the "importing images" documentation https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/importing_images.html#compress-mode.

@Nodragem
Copy link
Contributor Author

Nodragem commented Mar 2, 2025

As asked previously an MRP should be a complete project next time uploading an MRP please upload a project, not just loose files, especially since the paths in this zip are invalid as you put the files in the root folder instead

After fixing the project I'm unsure what I'm supposed to see, the two cubes are the same color, what is the expected result?

As explained in the first message you need to use a color picker to read the color of the imported texture and notice the difference.

The difference is not necessarily visible by the naked eye in the default environment. But when working on textures with tone mapping and post processing, the difference can become noticeable.

EDIT: you can see an animated GIF below to demonstrate the difference I was observing.

@Nodragem
Copy link
Contributor Author

Nodragem commented Mar 2, 2025

The images import setting compress/mode is set to "VRAM Compressed" which has the effect of reducing the images quality in favor of smaller size. Changing the setting to either "Lossless" or "VRAM Uncompressed" will retain the original pixel color. This is explained in the tooltip, the documentation of CompressedTexture2D and in the "importing images" documentation https://docs.godotengine.org/en/stable/tutorials/assets_pipeline/importing_images.html#compress-mode.

I tried Lossless before I posted, but I was trying with the Thumbnail Preview of the texture. Just checked again now that I set up a better test (with 2 cubes, one using Albedo color, the other using a texture filled with the color). It seems that to use Lossless resolves the issue for the cubes, but not for the Thumbnail Preview.

Maybe the thumbnail is not being updated after import, but that would be another type of bug?

Here below, I recorded myself checking the colors with a color picker when the mode is VRAM Compressed, or Lossless.

Image

The tested color is a33c3c. The left cube has its albedo color set to a33c3c, while the right cube is using a texture filled with the color a33c3c. We expect a difference between the color of the cubes in the viewport and the tested color, because of the lighting. However, we expect both cubes to share the same color in the viewport, because they have the same rotation. Finally we would expect the thumbnail to display the color a33c3c.

When using VRAM Compressed, you can see that my color picker reads the color c1524e from the left cube and c0534e from the right cube. The Thumbnail reads as a74444.

When I change to Lossless, you can see that my color picker reads the color c1524e from both cubes. The Thumbnail stil reads as a74444.

Hope that helps.

@Calinou
Copy link
Member

Calinou commented Mar 2, 2025

See this forum post: https://forum.godotengine.org/t/wrong-texture-colors-after-import-png-jpg/103771/3

Try disabling color management on your display and see if the issue persists. If the issue is gone after disabling color management, then this needs godotengine/godot-proposals#903 to be implemented to be resolved.

However, if disabling VRAM compression fixes the issue already, it's also possible that resource thumbnails don't get updated correctly after changing import options.

@Nodragem
Copy link
Contributor Author

Nodragem commented Mar 2, 2025

I use DisplayCAL, and it does not seem to change what the color picker is reading on the screen when I deactivate the profile.

As I experience often that the thumbnails do not update correctly when modifying my materials, I would suspect it could be the source of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants