Godot Version
4.2.1
Question
Hey. I have some grass swaying in the wind. And for this I’ve manually pointed the normals of the grass straight upwards, to make it fit the ground better.
like so:
//Pointing normals upwards manually
NORMAL = vec3(0.0,1.0,0.0);
//Cant believe this worked!
But now i figure i want to point the normals as is from the mesh at the top of the quads.
Obviously I would just lerp it i guess, but it seems that is not a thing in the vertex part of the shader!
I’ve tried naturally stupid stuff like:
vec3 up_n = vec3(0.0,1.0,0.0);
NORMAL = vec3.lerp(NORMAL,up_n,UV.y);
//Ofcourse not!
Then to my surprise, this does a thing (doesnt cast any errors!)
vec3 up_normal = vec3(0.0,1.0,0.0);
NORMAL = NORMAL + (up_normal * (1.0 - UV.y));
(But does it make any sense???)
Anyone know how to do this properly?