system
July 10, 2020, 2:54am
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
Chevi
Hello! I would like to recreate an effect similar to the one in the gif below, can someone point me to the right direction?
I decided to go into more of the mechanics of my project instead of making it look good first, so I’m yet to try to make this.
I’m doing the same. If I figure out a solution I’ll share it with you.
dontbeaboot | 2020-07-20 16:13
system
July 10, 2020, 3:46am
2
Reply From:
JimArtificer
The swaying effect is often achieved with pixel shaders.
The image you provided also appears to have some particle effects, which are easy to pick out because they are a lighter shade of green.
This is a Unity tutorial explaining the concepts for 3D, which you can translate/simplify to do it in 2D with Godot:
You may also wish to combine it with this technique to smooth out the 2D motion:
system
December 23, 2020, 7:32pm
3
Reply From:
cmzx
Hey,
I found this shader, which works as you want except it doesn’t move more when you walk on it…
You have to play with the shader parameter, then, you’ll get something like that :
https://twitter.com/i/status/1341827250082230279
system
September 13, 2022, 5:14pm
4
Reply From:
sarapan_malam
I know maybe this is an old thread, but I want to try to provide the results of my experiment, I hope it helps too
Download 2s wind sway shader
Modify the shader script by adding
uniform float skew: hint_range(-500.0, 500.0) = 0;
// vertex method
if (skew != 0.0) {
VERTEX.x += max(0.0, (1.0-UV.y) - heightOffset) * (skew / 12.0);
}
Set the value of the skew variable when the character touches it
source code
1 Like