Using TIME to animate alpha map and speed control.
Asked Answered
E

1

0

I am trying to rotate through a texture and use it for the alpha values for a water fountain water fall. Problem is I am having trouble controlling the animation of the uv cordinates using TIME. Here is what I have already for the fragment.

void fragment() {

	float speed;
	vec2 uvo;
	uvo.x=(TIME*100.0*xspeed)/100.0;
	uvo.y=(TIME*100.0*yspeed)/100.0;



	float wateralpha=texture(noisealpha,UV+uvo).a;

	ALBEDO=watercol;
	//float wateralpha=1.0;
	ALPHA=wateralpha*alphaadjust;

}
Espy answered 5/12, 2022 at 17:20 Comment(0)
E
0

I found out from the godot manual that TIME is total elapsed time of the shader. I was thinking it was a value between 0.0-1.0. It's now fixed.

Espy answered 7/12, 2022 at 15:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.