Godot 4 Shader Tutorial for Absolute Beginners

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024

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

  • @uheartbeast
    @uheartbeast  10 месяцев назад +57

    A student of mine was asking about shaders, so I decided to make a Godot shader tutorial for absolute beginners. I hope you enjoy the video and find it informative!
    P.S. I'm running a fall sale on my 1-bit Godot 4 course and my LTS turn-based course.

    • @auawgamer3470
      @auawgamer3470 10 месяцев назад +1

      Loved this tutorial! Can you do more for shaders? Thanks!

  • @hawkfu
    @hawkfu 10 месяцев назад +115

    Oh my goodness I would LOVE a full series on Shaders…these have always terrified me

    • @brun3tto
      @brun3tto 10 месяцев назад +6

      +1!

    • @Snoows-bu4oi
      @Snoows-bu4oi 6 месяцев назад +1

      +1 too !

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

      +1 excellent explanation, would love to see more!

  • @will41n
    @will41n 10 месяцев назад +37

    BABE WAKE UP BEN JUST DROPPED A NEW AWESOME TUTORIAL

  • @eduardoddutra
    @eduardoddutra 10 месяцев назад +25

    Finally a shader tutorial i don't get lost 3 seconds in! Awesome tutorial! More shader tutorials following this one would be very appreciated!

  • @RedEyedJedi
    @RedEyedJedi 6 месяцев назад +8

    This must be the 20th video I've watched on shaders, and it's the first one that actually made sense, and I was able to follow along with. Please make some more advanced shader videos as this was very helpful.

  • @Floflox
    @Floflox 2 месяца назад +2

    Really good hands on introduction, thanks

  • @n__m
    @n__m 10 месяцев назад +5

    slightly more advanced, but instead of using an if to change the color a better approach would be using a mix with a smoothstep as the control parameter. this would let you transition from one color to another rather than have a hard cutoff which will tend to alias.

  • @DapperestDev-cy1pp
    @DapperestDev-cy1pp 3 месяца назад +1

    This was a great primer for shaders!! Thank you!

  • @yurinativo
    @yurinativo 10 месяцев назад +3

    Thank you for the tutorial, very nice.
    In the if conditions, you could only check the color_average or just one of the components RGB, instead of checking for all RGB components, since they all have the same value.

  • @jeffreystephens2658
    @jeffreystephens2658 4 месяца назад +1

    That is surprisingly intuitive.

  • @shibii
    @shibii 10 месяцев назад +3

    Ben, one of those creators you like the video 1st, watch second! Good job as always :) It's good to see you back on youtube :D

  • @Silentstrike46_
    @Silentstrike46_ 10 месяцев назад +3

    Awesome tutorial, thank you! Been very interested to see how you can do shaders in Godot.

  • @micahol69420
    @micahol69420 10 месяцев назад +1

    Excellent video. I would definitely watch more if you were to go deeper into shaders; I have had trouble trying to learn them due to lack of documentation and tutorials.
    Specifically, practical application of them in your games. How to apply a shader to an object for a specified amount of time, how to apply shaders to all objects in your viewport in a specific area, how to change the area the shader affects, etc.

  • @dreamhive3d
    @dreamhive3d 10 месяцев назад +1

    Thank you for this. I would really love to see a series that dives more in depth with shader usage, and tips on how to build your own customized ones.

  • @flashfreak62
    @flashfreak62 10 месяцев назад +1

    Wake up Babe, there's a new heartbeast tutorial

  • @IraKane
    @IraKane 9 месяцев назад +1

    Thanks a lot for the video Ben. Just in case it could be useful for somebody, there is another good introductory video on Godot shaders on the godotneers channel.

  • @Lexie_T
    @Lexie_T 6 месяцев назад +1

    a perfect introduction!

  • @MH-lr6ue
    @MH-lr6ue 6 месяцев назад +1

    This looks interesting. I’ll understand more when I try this for myself.

  • @brocklogan7373
    @brocklogan7373 7 месяцев назад

    this does a very good job of breaking down the basics. this finally made a lot of what happens in shaders make sense.

  • @betadyne9559
    @betadyne9559 10 месяцев назад

    Hey, I just wanted to thank you for everything you did for Godot ! I started a year ago and it's a blast, and I managed to keep learning thanks to your action RPG tutorial !
    It's absolutely vital to have quality resources like yours for beginners like I was and I always suggest your series to any newcomer !

  • @just_a_zombie6718
    @just_a_zombie6718 9 месяцев назад +1

    this is the first shader tutorial that i really learned! hope to see a whole series of fuctions in shaders!
    or guys you can recommend me a good shader tutorial

  • @jesuslugo1062
    @jesuslugo1062 10 месяцев назад

    I don't found any beginner tutorial for shaders before. Thanks you! I would love a series for this c:

  • @mushroomancer4407
    @mushroomancer4407 7 месяцев назад

    the GOAT of godot tutorials. keep up the great work my man

  • @mercantilistic
    @mercantilistic 7 месяцев назад

    Great tutorial, that was very helpful. Would love more videos like this going into other tutorials. You explaining the why and the how is huge.

  • @leonardoxavier1481
    @leonardoxavier1481 10 месяцев назад +1

    I was waiting this content! 😍

  • @thetiphon
    @thetiphon 7 месяцев назад

    You are very talanted at explaining things. You dont even need good graphics visualisation for it

  • @MagicWhale
    @MagicWhale 10 месяцев назад +2

    LETS GO

  • @Limited_Film_Works_
    @Limited_Film_Works_ 10 месяцев назад +2

    Thanks Ben. You are always so useful!!!

  • @mikefrom1974
    @mikefrom1974 4 месяца назад +2

    Completely unnecessary nitpick for this simple of a tutorial, but since you should always be thinking of optimization even at the beginner level:
    If you just set all 3 color values to the same value (color_average), you can save some typing and an eensy-teensy bit of processing time by just checking a single variable for the level. I.e. instead of the if statement (final code line7) could be reduced to just either:
    if (output_color.r > 7.0) {
    OR since you just set all 3 color channels to the color_average you could use that in your if statement:
    if (color_average > 7.0) {

  • @DrW1ne
    @DrW1ne 10 месяцев назад +2

    Yo, ben thank you for this tutorial!

  • @evanwatson2898
    @evanwatson2898 10 месяцев назад +1

    for the if statement in this video why did you check the r g and b of output_color? All 3 are the same value so you could have just checked one of them, alternatively you could have just checked color_average as it would have given the same result.

  • @paulbecket7399
    @paulbecket7399 10 месяцев назад +3

    I ran across a shader that scrolls and copied it but don't really understand it fully
    shader_type canvas_item;
    uniform float speed;
    void fragment () {
    COLOR = texture(TEXTURE, vec2(UV.x + TIME * speed, UV.y));
    }
    it makes a texture scroll in the "x" axis great for constant scrolling background

    • @uheartbeast
      @uheartbeast  10 месяцев назад +2

      It's setting the output color of the pixel to be the color of a pixel to the right of the current pixel based on the TIME that has passed in the game.
      Uniforms are kind of like export variables in gdscript. It just allows you to change values in the editor.
      Don't know if that helps you understand it better but thanks for sharing another great example of a basic fragment shader!

    • @paulbecket7399
      @paulbecket7399 10 месяцев назад +1

      @@uheartbeast that actually helped a lot , thanks

  • @DriftyG
    @DriftyG 8 месяцев назад

    Great video, simple and easy to follow.

  • @ukrsolid
    @ukrsolid 10 месяцев назад +1

    I will bi nice if you can do intermediate and advance after this video, nice work

  • @RogueEva
    @RogueEva 7 месяцев назад

    more parts would be greatly appreciated as i just spend an hour trying to somehow attach my water reflective shader to camera or player in order to work as i want to :)))

  • @2MARR8
    @2MARR8 10 месяцев назад

    This video was perfectly timed for my game jam project :)

  • @BloodyScythe666
    @BloodyScythe666 10 месяцев назад

    thank you benjamin!

  • @rremnar
    @rremnar 10 месяцев назад +1

    There are already plenty of Godot shader tutorials covering the basics. Are there any tutorials, that are intermediate to advanced, that cover topics such as using the screen buffer? Like I'd like to make an effect that warps the texture and the image behind the alpha channel within the confines of the UV of the object. I have tried to do this myself using what I could derive from shader toy shaders, but never could get it to work.

  • @agostres
    @agostres 10 месяцев назад

    This channel is in my " if I ever make any money I want to support this project" list. Do you have Patreon or any donation link?

  • @0Theory
    @0Theory 10 месяцев назад

    Could’ve easily simplify that if-statement, since the values are the same anyways. The effect would’ve been the same if you only compared the average you’ve calculated earlier with .8

  • @LinDahai88
    @LinDahai88 10 месяцев назад +1

    I want more shaders! ))

  • @Nicohamcg
    @Nicohamcg 10 месяцев назад

    I feel like I am being attacked with that title but thank you very much 💖

  • @user-no7id2gl6u
    @user-no7id2gl6u Месяц назад +1

    9:45 rbg man, xyz, uvw, hsv, etc...

  • @arystanfans
    @arystanfans 10 месяцев назад

    Finally 🔥🔥

  • @haydenap
    @haydenap 10 месяцев назад

    Ben?! What did you do with Benjamin!? :P Lovely first look into shaders for me, thanks!

  • @GodsAutobiography
    @GodsAutobiography 10 месяцев назад

    If you averaged all of the colors into each of the rgb values of output_color then do you really need to compare if each one is > 8? Can't you just check if one of them is greater than 8 since they are all the same for that given pixel?

  • @user-zq5dy3zr1e
    @user-zq5dy3zr1e 9 месяцев назад

    Hi, could you make a video about how to create a 3d maze/dungeon in Godot?

  • @brun3tto
    @brun3tto 10 месяцев назад

    that's excellent, thanks a lot!

  • @SamiO-si4mc
    @SamiO-si4mc 10 месяцев назад

    Thanks! :)

  • @johnedelmann6711
    @johnedelmann6711 9 месяцев назад

    What happened to the Wolfenstein 3D clone that you said you would postpone because of a card game tutorial series you said you would do?

  • @LinDahai88
    @LinDahai88 10 месяцев назад

    That is awesome!

  • @no-ld3hz
    @no-ld3hz 10 месяцев назад +1

    you could probably have used swizzling with the if statement, would've been good to demonstrate it as it is unbelievably useful

    • @n__m
      @n__m 10 месяцев назад +5

      the if could also just have checked color_average > 0.8 rather than test every rgb component

    • @no-ld3hz
      @no-ld3hz 10 месяцев назад

      ​@@n__mthat also would've worked

  • @bredlyboi
    @bredlyboi 7 дней назад

    Why when i type texture(TEXTURE, UV) it seas "Unknown indentifier in expresion 'TEXTURE' "?

    • @bredlyboi
      @bredlyboi 7 дней назад

      Nvm found out answer my self :) Thanks for good tutorial.

  • @dorara01
    @dorara01 10 месяцев назад

    Hi HeartBeast! I really like your tutorials and appreciate your work. I want to make a game based on your tutorials. I'd like to know if it's available if I recreate the assets based on your works (the pixel guy)? Sorry for messaging here; I couldn't find another way to contact you.

  • @guustavols
    @guustavols 10 месяцев назад

    please make this a serie :)

  • @wedge_one
    @wedge_one 10 месяцев назад

    are there any limitations of using the shader graphical editor instead of coding the shader? I mean, Godot does have a node based editor for shaders, why code by hand instead?

  • @jeanpablo1031
    @jeanpablo1031 10 месяцев назад

    nice one

  • @__Rizzler__
    @__Rizzler__ 10 месяцев назад +1

    nice. rizz accepts it😉

  • @cprn.
    @cprn. 10 месяцев назад +6

    It seems Godot devs finally came to their senses and decided to go with GLSL instead of coming up with yet another shader language. They wasted enough time reinventing the wheel with GDScript and a built-in code editor.

    • @cprn.
      @cprn. 10 месяцев назад +3

      @@sametcnlkr And I'm saying it's a sensible decision. What's your point?

    • @cprn.
      @cprn. 10 месяцев назад +7

      @@sametcnlkr I never said they used GDScript for shaders. I said it's a sane decision to *not invent* yet another shader language because they *did invent* yet another *scripting* language (a.k.a. GDScript), which was reinventing a wheel and an enormous waste of time because they could've gone with real Python or LUA or any of the hundreds of existing scripting languages that are also a valid resume entry (the implication here is GDScript isn't universal).

    • @schnitzelhannes6431
      @schnitzelhannes6431 10 месяцев назад +2

      GDScript is an awesome language with very good reasons for using it. If you dont see this youre just ignorant

    • @uheartbeast
      @uheartbeast  10 месяцев назад +3

      I love gdscript and the build-in code editor so for me their efforts on those fronts are very appreciated.

    • @cprn.
      @cprn. 10 месяцев назад

      @@schnitzelhannes6431 I am the opposite of ignorant. I have both, the expertize and experience with wide variety of programming languages and different complexity projects, to know wastage when I see it. GDScript is a very thin Python-like layer over the C++ internals of the engine. Even compared to the actual Python It's restrictive, slow, there's less resources teaching the language, way less libraries (there are some in Godot Assets Library but very few). The only good thing I can say about it is that it's easy to read and write, but that's because it's syntax is Python-derived and going with native Python from the beginning would've been as easy to use but easier to implement. And wouldn't be so specific - GDScript strongly depends on under-the-hood C++ implementations implicitly influencing things like memory management and working with different data types. I doubt anything changed on that regard over the last 5 years. I admit, it does have a very good documentation but manual isn't a course - it doesn't teach programming principles so prior programming knowledge is necessary (or at least makes a real difference) when starting to learn it. And someone who already speaks some flavour of C, Rust or other GDNative supported languages doesn't have any imperative whatsoever to switch to this weird incomplete version of Python with few extra magic keywords.

  • @tiant1813
    @tiant1813 10 месяцев назад

    Do moreeeeeeeeeeeeeeeee 🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏🙏

  • @Penguin_merchant
    @Penguin_merchant 8 месяцев назад

    Great another language i have to learn 😑