Halo artifact in visual shader

Godot Version 4.3

Question

So here is the thing. I made visual shader, it works as intended, but on top of cylinder is a some sort of halo, that not supposed to be there because of gradient. So please help me get rid of this halo

I attached screenshot of halo that I need to remove, as well as visual shader nodes.


I would bet it’s the gradient texture using repeat sampling

1 Like

what do you mean?

Sampling UVs can overshoot, especially at low resolutions like with the Gradient’s default size of 64x64. When overshooting you hit the texture’s repeat option, either clamped, repeating, or mirror repeating.

When your gradient repeats it samples the high 1.0 value from the bottom, to the top again. Instead of clamping to the nearest 0.0 value.

1 Like