Godot Version
4.2.2
Question
my code
shader_type canvas_item;
varying float depth;
// uniform vec4 color;
uniform float frequency = 0.1;
void vertex() {
// Called for every vertex the material is visible on.
depth = (sin(10.0*VERTEX.x)+1.0)/2.0;
}
void fragment() {
// Called for every pixel the material is visible on.
vec4 pixelColor = texture(TEXTURE,UV);
pixelColor.a = depth;
COLOR = pixelColor;
}
//void light() {
// Called for every pixel for every light affecting the CanvasItem.
// Uncomment to replace the default light processing function with this one.
//}
I expect this to form a sinwave like structure but why it giving a gradient?
Note: Vertex.x ranges from 0 to 1 since i made the size as 1 and increased the scale factor accordingly