Closed EIREXE closed 6 years ago
This is how the texture filtering and how the hardware interpolates the pixel colors to get the final color result work. If you reimport the texture with filtering disabled it shouldn't happen.
@mrcdk oh so it's not really a bug?
I tried @mrcdk's solution, and it worked on the test project.
The problem stems from the texture having "Repeat" and "Filter" on, should be like this:
After this, it seems to work fine.
Yes, it's not a bug @EIREXE Basically, when the filtering is disabled, the GPU will pick the closest color it can find but when the filtering is enabled it will combine the surrounding colors to get the final color. This plus repeat enabled makes it get the green and the red color at uv(0, 0) combine them and return yellow. The same will happen at uv(0, 0.5) and uv(0, 1)
Oh alright, thanks!
Godot version: 3.0 RC3
OS/device including version: Windows, 64.
Issue description: When getting a point from the top of a texture that has two colors:
texture() returns a mix between the color at the top and the color at the bottom, for example, when getting UV 0.0,0.0:
And then when getting UV 0.0,0.1:
UV 0.0,0.6:
Seems like a precision issue to me or something.
Minimal reproduction project: ShaderBug.zip