Godot Tutorial - How to fix edge stretching




So I have a sprite scene

 

If I move the UV, the pixels at the edge will stretch
 
it's quite annoying
but we can handle it


Decompose the UV that has been added


Add Step node and set the value to 1


Then multiply with alpha and connect it

Here it is
but what if you move it with a negative value?



Add the OneMinus node then the UV will flip horizontally


But what about the Y?
'Extract' Y then add Step node


Multiply them (by adding a multiply node) then connect.


Likewise if you move the Y with a negative value
add the OneMinus node then the UV will flip vertically

Comments

Popular posts from this blog

Godot Tutorial - How to make Sword Slash Effect using Visual Shader - 3 different versions

Godot Tutorial - Vertex Displacement using Visual Shader

Godot Tutorial - Gradient Mapping using Visual Shader