[Godot Shader Tutorial] Stylized Waterfall
HTML-код
- Опубликовано: 3 авг 2024
- Credits to Harry Alisavakis: halisavakis.com/my-take-on-sha...
textures: imgur.com/a/nRWnaVu
shader scripts:
waterfall: pastebin.com/zwLWZPvv
splash foam: pastebin.com/tuh4aSGe
edge foam: pastebin.com/t03zpvPN - Игры
For anybody who is using 3.1 stable there is a bug with the depth texture. If you are having issues with the edge foam set the contact property on your directional light to 1. You do not have to enable shadows on the directional light for this workaround to work. Thanks for the awesome video
Miziziziz!
thank you very much I was desperate
Wow, looking good! So nice to see the effect being used so well in other engines too ^^
Thanks! And thanks for all your tutorials as well
I'm surprised, every time you share more fabulous tutorials, with you I'm learning a lot, I feel very lucky to be in your channel, many more people should know your channel, they don't know what they are missing
Another banger, cheers Miziziziz 👍 Very useful for those of us who still have projects on 3.x
I could not find any good 3d shader tutorials thanks to you i learned a lot about shaders. :)
Awesome tutorial! I have a queue of videos I need to walk through myself to get the full learning effect... this one made the list for sure! Huge fan that you explained the shader code... its still a big voodoo black box to me at the moment.
great video + godot 3D = a great mix. Thank you for sharing.
Great video! Awesome effect.
thank you I was looking for this a long time ago
Great work, thank you so much for this content.
Fascinating stuff.
Good vid.
this exactly what I was looking for...danke
bone attachment. sick. thank you
Just when I need it. I want to do a canoeing simulator for Oculus Quest, and thought about the way of stylization for water
awesome!!!! good job
Thank you! Great!
Pretty good
im taking this concept, but making it red, and putting into my diablo styled game
Is it out?
Thanks for this excellent resource. I know this is a somewhat older video but I did have one question that I was hoping you (or someone else viewing) may be able to help with. Do you know how the foam portion of this would be applied to work with an orthographic camera instead of a perspective one? Thanks!
This looks great . Could the same shader be applied to a 2d waterfall ?
Definitely, would need to change it from a spatial to canvas type shader
Subbed)
the water edges aren't working for me, the displacement texture is scrolling across the entire mesh
I dont know why but for water dosent work edge detecion... Somehow is like dosent work... I dont know how to handle with that :/
Shader works but in really unexpected way. Look like stuck to point of view some strip and thats all... Help...? Please.
Why you use ALBEDO and not a regular color output? Good tutorial.
COLOR is only settable in vertex(), it's read-only in fragment()
can this be applied to 2d also?
nvm, i tried it. just replace ALBEDO to COLOR.rgb and set shader_type to canvas_item;
how do you make it transparent?
Make what transparent? Just set the ALPHA value
@@Miziziziz I was hoping to test to see if i could make the water fall blue see through. But I tried setting the alpha value at a lower value from the top bottom dark and light color slots but it doesnt change.
@@hanzx1309 you need to add transparent to the render_mode
@@Miziziziz oh i figured it out. i just did this: ALBEDO = col.xyz;
if (ALBEDO.r > 0.9 && ALBEDO.g > 0.9 && ALBEDO.b > 0.9) {
ALPHA = 0.9;
} else {
ALPHA = 0.5;
}
But now I am trying to figure out how to make the white areas see through... like a dripping effect extended over the primary waterfall.
disolve was wonky, HELP!!!!!!!
is it just me or does the entire godot 4 UI change this whole tutorial? Certain steps don't behave the same and some stuff just isn't there. (I'm new to using godot and game engines generally so there's not a lot I can intuit)
I know i'm late but try this:
shader_type spatial;
render_mode unshaded;
uniform sampler2D noise_tex;
uniform sampler2D displ_tex;
uniform vec4 top_light_color : source_color;
uniform vec4 top_dark_color : source_color;
uniform vec4 bot_light_color : source_color;
uniform vec4 bot_dark_color : source_color;
uniform float displ_amount : hint_range(0.0, 0.1) = 0.02;
uniform float bottom_foam_threshold : hint_range(0.0, 1.0) = 0.48;
uniform float speed : hint_range(0.0, 1.0) = 0.25;
void vertex() {
vec2 displ = texture(displ_tex, UV - TIME / 8.0).xy;
displ = ((displ * 2.0) - vec2(1.0, 1.0)) * displ_amount;
vec3 displacement = vec3(displ.x, 0.0, displ.y);
VERTEX += displacement;
}
void fragment() {
vec2 displ = texture(displ_tex, UV - TIME / 8.0).xy;
displ = ((displ * 2.0) - vec2(1.0, 1.0)) * displ_amount;
float noise = texture(noise_tex, vec2(UV.x, UV.y / 3.0 - TIME / 4.0) + displ).x;
noise = floor(noise * 4.0) / 4.0;
vec4 col = mix(mix(top_dark_color, bot_dark_color, UV.y), mix(top_light_color, bot_light_color, UV.y), noise);
col = mix(vec4(1.0, 1.0, 1.0, 1.0), col, step(UV.y + displ.y, bottom_foam_threshold));
ALBEDO = col.xyz;
}
Can I use it as 2D waterfall???