2D wind shader.
Asked Answered
P

2

0

Hello im trying to make a 2D wind shader, well lets say it doesnt work as quite I want to... (im completely clueless now)
The shader is moving the bottom of the image too which I dont want to but I have no idea how to fix that...

Heres the code:

shader_type canvas_item;

uniform float amplitude = 20.f;
uniform float speed = 2.f;

void vertex(){
	VERTEX.x += sin(TIME*speed)*amplitude*(UV.y-1.f);
}
Partheniaparthenocarpy answered 6/11, 2022 at 14:29 Comment(0)
D
0

I don't think shaders are a bad way to go for this effect.

The shader is working fine for me, so probably something with your sprite setup.

Dotted answered 7/11, 2022 at 10:57 Comment(0)
B
0

You seem to be overcomplicating this for a 2D effect, why not let some simple vectors and rotation take care of it? Since it's 2D, it wouldn't be too difficult to get it tweaked to your liking and have all the plants etc. blow the same way, you could make it even simpler now that I think about it and animate it.

Bertram answered 7/11, 2022 at 10:13 Comment(0)
D
0

I don't think shaders are a bad way to go for this effect.

The shader is working fine for me, so probably something with your sprite setup.

Dotted answered 7/11, 2022 at 10:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.