Topic was automatically imported from the old Question2Answer platform.
Asked By
hunar 1
Old Version
Published before Godot 3 was released.
Hi
I Don’t know much about shaders but i was messing around and i made this
color col = COLOR;
float speed = 6;
float time = sin(TIME*speed)+1;
vec3 VERTEX;
float avg = (col.r+col.g+col.b)/3;
col.rgb = vec3( col.r+(avg-col.r)*time/2, col.g+(avg-col.g)*time/2, col.b+(avg-col.b)*time/2 );
COLOR = col;
It makes the image change between B&W and Color, ok that is cool but i want to get mouse position and make the parts to the left of the mouse B&W and to the right of the mouse Color
how to get the mouse position to the shader. also another question… how to get the pixel position from Vertex