Hi,
I just use simple colored Polygon2Ds to create a landscape. Now I try to shade them, but I don't know how to get the size of the given polygon. As I don't have textures, so UV's wont work at all.
My goal would be to put a gradient on the polygon using its basecolor.
My current example:
varying vec2 position;
void vertex(){
position = VERTEX;
}
void fragment() {
c = position / size; // Something like that
COLOR = vec4(c, 0.0, 1.0);
}
But the result