[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
  • ИгрыИгры

Комментарии • 40

  • @dolichomps
    @dolichomps 5 лет назад +28

    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!

    • @sergioortiz3d
      @sergioortiz3d 5 лет назад +1

      thank you very much I was desperate

  • @TechnicallyHarry
    @TechnicallyHarry 5 лет назад +23

    Wow, looking good! So nice to see the effect being used so well in other engines too ^^

    • @Miziziziz
      @Miziziziz  5 лет назад +5

      Thanks! And thanks for all your tutorials as well

  • @Crisisdarkness
    @Crisisdarkness 5 лет назад +3

    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

  • @MasonDavies74
    @MasonDavies74 6 месяцев назад

    Another banger, cheers Miziziziz 👍 Very useful for those of us who still have projects on 3.x

  • @ardavardar105
    @ardavardar105 3 года назад +1

    I could not find any good 3d shader tutorials thanks to you i learned a lot about shaders. :)

  • @michaelthelen5297
    @michaelthelen5297 5 лет назад

    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.

  • @MoKaLu
    @MoKaLu 5 лет назад +2

    great video + godot 3D = a great mix. Thank you for sharing.

  • @Peter-lg7mc
    @Peter-lg7mc 5 лет назад +1

    Great video! Awesome effect.

  • @arielgimenez_95
    @arielgimenez_95 5 лет назад +1

    thank you I was looking for this a long time ago

  • @ChefMarius
    @ChefMarius 5 лет назад +1

    Great work, thank you so much for this content.

  • @NOPerative
    @NOPerative 4 года назад

    Fascinating stuff.
    Good vid.

  • @originaltenka5545
    @originaltenka5545 5 лет назад

    this exactly what I was looking for...danke

  • @Cyclone94
    @Cyclone94 4 месяца назад

    bone attachment. sick. thank you

  • @EvilVitJoker
    @EvilVitJoker 4 года назад +2

    Just when I need it. I want to do a canoeing simulator for Oculus Quest, and thought about the way of stylization for water

  • @jwerlley
    @jwerlley 5 лет назад

    awesome!!!! good job

  • @david_peter
    @david_peter 5 лет назад

    Thank you! Great!

  • @jasonfanclub4267
    @jasonfanclub4267 3 года назад

    Pretty good

  • @slimebuck
    @slimebuck 5 лет назад +2

    im taking this concept, but making it red, and putting into my diablo styled game

  • @kierancarden3473
    @kierancarden3473 4 года назад

    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!

  • @RafaelHernandez-mc5rf
    @RafaelHernandez-mc5rf 5 лет назад +1

    This looks great . Could the same shader be applied to a 2d waterfall ?

    • @Miziziziz
      @Miziziziz  5 лет назад +2

      Definitely, would need to change it from a spatial to canvas type shader

  • @me2beats313
    @me2beats313 5 лет назад

    Subbed)

  • @root4098
    @root4098 3 года назад +1

    the water edges aren't working for me, the displacement texture is scrolling across the entire mesh

  • @AtelierMorph
    @AtelierMorph 4 года назад

    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.

  • @catafest
    @catafest 5 лет назад

    Why you use ALBEDO and not a regular color output? Good tutorial.

    • @Miziziziz
      @Miziziziz  5 лет назад

      COLOR is only settable in vertex(), it's read-only in fragment()

  • @ernielpilapil
    @ernielpilapil 2 года назад

    can this be applied to 2d also?

    • @ernielpilapil
      @ernielpilapil 2 года назад

      nvm, i tried it. just replace ALBEDO to COLOR.rgb and set shader_type to canvas_item;

  • @hanzx1309
    @hanzx1309 5 лет назад

    how do you make it transparent?

    • @Miziziziz
      @Miziziziz  5 лет назад

      Make what transparent? Just set the ALPHA value

    • @hanzx1309
      @hanzx1309 5 лет назад

      @@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.

    • @Miziziziz
      @Miziziziz  5 лет назад

      @@hanzx1309 you need to add transparent to the render_mode

    • @hanzx1309
      @hanzx1309 5 лет назад

      @@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.

  • @liamflanagin7134
    @liamflanagin7134 Год назад

    disolve was wonky, HELP!!!!!!!

  • @wqb_amidi
    @wqb_amidi Год назад

    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)

    • @CombineProduct
      @CombineProduct 8 месяцев назад +1

      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;
      }

  • @t3du
    @t3du 2 года назад

    Can I use it as 2D waterfall???