Strange behaviour when using gradient-texture 1D in custom shader

Godot Version


Hi all,

I was doing some experiments using a gradienttexture 1D in a custom shader, and I’m getting some weird artifacts.
As you can see in the screenshots, for some reason values from the other side of the gradient are bleeding through in the wrong area.
The incoming UVs are clamped between 0 and 1, so there shouldn’t be any out-of-bounds sampling.
Any ideas as to why this might be happening?

The issue:

The gradient texture (note how blue is only present at 0.0, and magenta only 1.0, somehow magenta is being sampled at the 0.0 end of the gradient)


add : repeat_disable after the sampler in the shader and see if that helps.

1 Like

That did the trick, thank you so much!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.