Hello.
I'm creating a simple shader like this:
shader_type spatial;
uniform sampler2D heightmap;
void vertex() {
float d = (texture(heightmap, UV).a - 0.5) * 10.0;
VERTEX.xyz += NORMAL * d;
}
I put that shader as a material on a plane object.
If I give an input texture which has a constant alpha, I get a flat plane.
If I give an input texture with various alpha on the right part of the texture, I get something rugged on the right part of my plane as expected, but I also get artefacts on the left border of the plane: Some points on the left border are higher than others. So, it looks like vertices with values of U or V == 0 or 1 are affected by the value at the other end of the texture.
My texture is a png file, setup with lossless compression.
Any idea what the issue may be?