Skip to main content

Posts

Showing posts from August, 2021

How to create 2D grass wind motion using shaders in Godot

I have just started learning Shaders, and it is very difficult in the beginning but after couple of days I finally start understanding it. so I made this grass animation shader for 2D because most of the video I found is for 3D. making grass wind motion is very simple and easy to make. it is just a single line in the VERTEX function. I have also cover basics as well, so if you have no experience in shaders then also you can understand it too. Here is the Shaders code: shader_type canvas_item; uniform float speed = 2.0; uniform float dis = 20.0; void vertex(){ VERTEX.x += sin(TIME * speed) * dis * (UV.y-1.0); } here is a video tutorial