Closed lyuma closed 1 year ago
It looks like the logic for detect 3D is to call the callback anytime textures are updated and p_use_linear_color
is true
However, p_use_linear_color
is always true as it is set here:
Looks like maybe we used to handle srgb differently in 2D and then we lost something during a refactoring.
I can't reproduce on Beta 2! So I am going to close this issue.
At any rate, I am changing the behaviour that I described in my earlier post so this problem should be gone soon for sure.
Reopening due to reproduction project in #74335 Should we close the new issue and keep this one open?
Should we close the new issue and keep this one open?
Yes :slightly_smiling_face:
Any news on this, or a workaround? Super nasty issues going on for me
Any news on this, or a workaround? Super nasty issues going on for me
You can change the Import Defaults for Texture2D/ImageTexture in the Project Settings. Set Detect 3D to Disable so that 3D usage detection never kicks in.
Godot version
4.0.dev 706dc74e
System information
Windows 10, Vulkan
Issue description
ShaderMaterial is treated as 3D for the purpose of "Detect 3D", even if the material is of type canvas_item and used in a 2D node.
Here you can see the problem. Let's take icon.png, a quality piece of artwork whose every pixel is perfectly preserved. Now we drag it into a 2D canvas_item shader, as opposed to a 2D sprite's texture slot. There could be lots of reasons for this. For example, it might be an auxiliary texture used for outline drawing, or a palette, or something else.
Now see what happened. (The import inspector doesn't refresh, so you select a different file and back.) It got VRAM Compressed!
Godot also prints the following.
Steps to reproduce
ColorRect
uniform sampler2D tex;
void fragment() { COLOR = texture(tex, UV); }