How To Shader (Fast) - using Godot Engine

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

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

  • @Blockmaster987
    @Blockmaster987 2 года назад +516

    Quick note on grayscaling: averaging the three color channels does not result in an "accurate" grayscaled image. Because humans see some colors more intensely than others, we have to multiply the color channels by different weights to get an image that is truer to the original. For RGBA (which Godot uses), it's 0.299 * R + 0.587 * G + 0.114 * B.

    • @coyo_t
      @coyo_t 2 года назад +107

      fun fact, this is equivelent to a dot product operation, meaning you can do dot(colour.rgb, vec3(0.299, 0.587, 0.114))
      making it easier to swap out different blending amounts/source colour mixtures

    • @bonniefinleyanimation
      @bonniefinleyanimation 2 года назад +8

      Get to Heaven is so dope!

    • @iidoyila
      @iidoyila 2 года назад +2

      @@bonniefinleyanimation lol i literally had the same thought ! best rock album i've ever bought hahah

    • @foobars3816
      @foobars3816 2 года назад +9

      @@iidoyila are you both spammers or is this some reference I'm not getting?

    • @bonniefinleyanimation
      @bonniefinleyanimation 2 года назад +10

      @@foobars3816 Eli's Profile pic is the album cover for Everything Everything's - Get to Heaven (2015)

  • @FadedPatchwork
    @FadedPatchwork Год назад +106

    For people who are using the latest versions of Godot (idk the exact time this was changed):
    *hint_color* has been renamed to *source_colour*

  • @mahyellaw
    @mahyellaw 2 года назад +82

    i've always been confused with shaders. now this video's got me hyped 👀

  • @suicraft8395
    @suicraft8395 2 года назад +36

    just an update for the people who will be using Godot4 in the future and see this video: "hint_color" was renamed to "source_color" so if you have problems with this don't worry.

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

      With almost every tutorial I find myself searching through the comments for the updated names . . . . Thanks!

  • @lorgarmor5886
    @lorgarmor5886 2 года назад +262

    The most difficult thing about shaders is, that it is most often not straightforward to understand what action will have what effect (and vice-versa what effect needs what code) until you have played around enough to have a perfect feeling about it. For example I would have no idea how to implement a swirly distortion effect, though I know it's possible. Shaders are so powerful (and performant as they use the GPU) but so intimidating at the same time.
    At least I managed to write my own dissolve shader without sneak peeking the solution.
    What I did not get at all in the very beginning but I think is crucial to understand right away:
    The keywords (TEXTURE, ALBEDO, etc.) and the functions (fragment, vertex, etc.) are pre-defined. E.g. The fragment function is calculated for every pixel and the keywords provide the respective data about this particular pixel.
    When I was looking at other people's shaders to learn about the topic I was utterly confused, why were there variables written or read that were not defined etc.? How are these executed in the first place? One of your older videos was the one that gave me the final click in my head and now I'm trying my own stuff. Think I will rewatch the particle playlist once more.

    • @PlayWithFurcifer
      @PlayWithFurcifer  2 года назад +36

      Absolutely agree, it's a different mindset than the usual imperative programming.
      You may try the texture-based distortion shader we show in the video.
      Congrats! :)
      Yup, good point!

    • @toddzircher6168
      @toddzircher6168 2 года назад +6

      Indeed, I have a hard time 'thinking' in shader from scratch. I need a cookbook of shader solutions that I can then tweak. If the Furcifer team ever wanted to make a Godot specific version of that, I would be a happy coder.

  • @asdaaaaaaaaaaaaaasd
    @asdaaaaaaaaaaaaaasd 2 года назад +39

    I always wanted to get into shaders but never did. This might be it, this made me motivated.

    • @Jakub_13
      @Jakub_13 2 года назад +2

      Yeah, at first.. and second sight it looks hard. D: But when you wrap your head around it, it's so worth it! Fun and powerful at the same time

    • @PlayWithFurcifer
      @PlayWithFurcifer  2 года назад +2

      Totally agree with you Jakub :)

    • @plantsvs.zombies-gameplay4812
      @plantsvs.zombies-gameplay4812 2 года назад

      @@PlayWithFurcifer Sphere Matchers genre (like Luxor, Pirate Poppers...) with Godot please
      1. Getting Started
      2. Create Background
      3. Create Sphere
      4. Path Vertices, Map
      5. Tracing and Making Paths (Basic)
      6. Powerups (Reverse, Slow, Stop, Pointer, Multi Color, Color Bomb)
      7. Level Switch
      8. Tracing & Making Paths with Tunnels (Advanced)
      9. Double Path Levels
      10. Level Speed Variables
      11. Music and Sound Effects

  • @nauthic3p0
    @nauthic3p0 2 года назад +8

    I‘m overwhelmed as I have no clue what most words mean but I finally understand why shaders are ‚a thing‘

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

      I count that as a win!
      Do you have any specific questions?

  • @tristanvandansik8889
    @tristanvandansik8889 2 года назад +18

    Amazing work on this video! I'm getting pretty good at godot, but shaders are for me still super strange and a total different way of programming. Most turorials do only pure code or pure theoretical stuff, i like how you combined the two and show how the principles are actually applied. Please make a part two, i think you're doing amazing work and helping lots of starting developers!

    • @PlayWithFurcifer
      @PlayWithFurcifer  2 года назад +5

      Shaders are just *weird*, but you get used to it eventually. Thank you! We will start preparing part 2 :)

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

    This is the best shader examples video I've found. Thank you so much! I found I can compare different aspects and build a working knowledge by stepping back through the video to any part I'm unclear on since you have established context for each example so well. That's a very good way to teach. It's also rapid-fire enough to not bog down in details that can distract or confuse. It's important to learn fundamentals, and you have them in here in the most succinct fashion imaginable. I love that there's NO wasted time in this video at all. This one is getting added to my bookmarked links for sure.

  • @judsonhester1407
    @judsonhester1407 2 года назад +2

    This is the single most helpful video I have ever watched in helping understand shaders. This is incredible

  • @foobars3816
    @foobars3816 2 года назад +27

    If following along in Godot v4 (version 4) the mirror option has been moved from the import to the inspector under Texture -> Repeat -> enabled in the CanvasItem section. I think it actually makes a lot more sense to have it there that the import stage, so that's likely why it was moved.

  • @everybodyants
    @everybodyants 10 месяцев назад +4

    i didn't understand half of this, as i'm completely new to coding, but it was really entertaining.

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

      That's good :D
      Don't worry, shaders are kinda advanced

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

      I've actually got a really good idea gor a top down 2d survival game, somewhat simmilar to Astroneer. This knowlege is gonna be usefull.😅

  • @mvolkankarakas
    @mvolkankarakas 2 года назад +13

    You two have unique gift and talent. İn such a short time, you give all the idea and knowledge which increases the curiosity and courage. When the video finished, i was sad about where is more. Hope you continue to give efforts and time in order to publish New ones. İ believe i will be no disappointed for those. No correct words to explain. Simply Thank you 😄

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

    You are my absolute hero. Bare minimum I saw ways to do cool screen transitions and whatnot when loading menus, caves, indoor/outdoors, and battle scenes. Thanks!

  • @KyleMendes0
    @KyleMendes0 2 года назад +3

    This is excellent. Just seeing all the different things you can do very simply (and why that works) was a great overview!

  • @saultoons
    @saultoons 2 года назад +1

    Always hyped to see a new video from this channel! I always learn so much, thanks for sharing 😁

  • @timberjustinlake
    @timberjustinlake 2 года назад +10

    Yes! Please do a part 2 (and 3... and 4...). Can you talk about how to apply shaders to things in 2D that are not bitmap images? Things like Godot's Polygon2D, Line2D etc? And also how to apply a shader to a whole Godot scene which could be composed of multiple different parts - Polygon2Ds / UI Control nodes / bitmaps etc? Thanks, and keep up the great work!

  • @FelskiTV
    @FelskiTV Год назад +1

    Such a helpful video. The last part about converting shaders helped me so much! Thanks for these videos!

  • @Noita_
    @Noita_ 2 года назад +2

    ima have to watch this like 34k more times to even expand 1 pixel of my brain enough to understand

  • @eboatwright_
    @eboatwright_ 2 года назад +3

    THIS IS SO GOOD! You explained so much, in so little time, and so easy to understand!

  • @StanleyKubick1
    @StanleyKubick1 2 года назад +1

    I have no programming knowledge, but this actually helped me understand nodes in blender a lot better.

  • @LongestYardstick
    @LongestYardstick 2 года назад +6

    Love your vids dude, super interested in 2d shaders right now and this was awesome

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

    Thank you! This was the most helpful tutorial on writing and using shaders I have ever seen. Several things that weren't clear to me clicked into place nicely.

  • @PlayWithFurcifer
    @PlayWithFurcifer  2 года назад +44

    Have you used shaders? What's your experience?
    Edit: Part 2 is up now! ruclips.net/video/KVTa2xkly1g/видео.html

    • @Relivino
      @Relivino 2 года назад +1

      I've used shaders together with particles - you should definitely make a video on that topic!

    • @Jakub_13
      @Jakub_13 2 года назад +2

      First pain..
      Then joy, eternal

    • @AV-qr4kl
      @AV-qr4kl 2 года назад

      My experience is: copy, pasting, hoping it works... And if it does, I animate it via the animation player.

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

      Never have but now I will. Thanks for the video

    • @centdemeern1
      @centdemeern1 2 года назад +1

      I have been using shaders for years now, and all I can say is that they are very fun and powerful.

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

    Funny videos, your accent does the trick haha! I follow your channel for a long time, it even inspired me to create a Godot shader course on my own, keep it up!

  • @Malcx1
    @Malcx1 2 года назад +1

    Amazing amount of content in a clear video. Shaders just became much clearer to me - thanks!

  • @MRxRadex
    @MRxRadex 2 года назад +1

    Thank you so much for making videos about Godot especially about the Shaders!

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

    Ok, i never thought shaders were this cool. Amazing video gives the basics to build on.

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

    Whaaat 😮 My mind is blown, can't wait to play with this when I get home from work! Thank you!

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

    So much information in so little time, yet well explained and easy enough to understand. Great stuff!

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

    Shaders are super useful but it's intimidating. I usually go around and copy-paste what I see online without understanding so I never learn.
    Nice overview, I enjoyed it and it got me interested in understanding it more so I can use it more efficiently!

  • @benjaminswee-shaders
    @benjaminswee-shaders 2 года назад +1

    Love the way you broken down shaders, quick and simple!

  • @V8sim
    @V8sim 2 года назад +1

    This is so dense with good hints! Great video tutorial!

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

    3 seconds in and it's already awesome!

  • @jacksontriffon5064
    @jacksontriffon5064 2 года назад +1

    Beautifully explained in 7 mins

  • @VoyivodaFTW1
    @VoyivodaFTW1 2 года назад +1

    PART 2! WE NEED A PART 2!!!

  • @WMIIIProduktions
    @WMIIIProduktions 2 года назад +2

    Wow i did not know about the screen texture. This makes it so much easier! Thank you :D

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

    That must be the best shader tutorial there is

  • @soleypas
    @soleypas 2 года назад +2

    Really nice explanation, subbed!

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

    I was unfortunately never able to fully wrap my head around shaders and how to achieve the effects I want.... especially since I find them hard to debug (I usually use way to many print statements, which I can't do for shaders) and my math is sometimes a little bit off, let's put it that way.
    Coincidentally, I resently stumbled upon a video by Indigo Quilez - he "paints" beautiful images, just using math. He has great tutorials on that, and I found that trying to understand and replicate some of that helped me a ton with the math you need for shaders.
    I think this video is amazing for people who start out using shaders and I'd love to see a part two!

  • @ItzNero69
    @ItzNero69 2 года назад +2

    Great video, I thought I'd never try shaders out but it made me get started!

  • @ThomLaurent
    @ThomLaurent 2 года назад +1

    What surprises me the most is how easy it is to do that with Godot compared to Unity, plus the shader fields you can provide: generated textures, curves, wow it's the future xD Even gradients are not supported in Unity!

  • @SuperQuwertz
    @SuperQuwertz 2 года назад +2

    Man, this was cool. Thank you, great video!

  • @tonybrownlowe2272
    @tonybrownlowe2272 2 года назад +1

    These tips are great will be using them all!

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

    Man, this is *information dense* but as they say, it helps you understand what is available... I now know I need to do more research on shaders 🙂

  • @ukrsolid
    @ukrsolid 2 года назад +2

    Part 2 will be great! , thanks this is great!

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

    I'm fairly new to coding my own shaders so I didn't know how those distortion effects were made. Very neat! Thanks for this.

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

    this is a great crash course!
    (also hey i think i know you from dm's streams!)

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

    I don't do any of this stuff but i am still entertained by this for some reason.

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

      Thats cool, just look at the flickering lights and listen to the german guy :)

  • @YabDev
    @YabDev 2 года назад +2

    Awesome! Part 2 ASAP! kkkk Thanks for the video!

  • @jsn4591
    @jsn4591 2 года назад +1

    Oh man, I actually feel like shaders maybe arent so scary.. been avoiding them for a long time but you've made me feel like it's not as intense as it seems... Thanks :)

  • @peterirvin7121
    @peterirvin7121 3 месяца назад

    This is interesting. I would like to see a part 2

  • @wires22
    @wires22 Год назад +3

    After like a year of not understanding shaders this tutorial made it easy for me. thank you sooo muchhh

  • @yell9140
    @yell9140 2 года назад +1

    Thanks for the video, now I have to play around with shaders

  • @TheRobertoCarbonell
    @TheRobertoCarbonell Год назад +1

    Thank you!. And please more videos like this!!!!

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

    Brilliant stuff! thanks for sharing this 👊

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

    BROTHER, YOU ARE THE BEST!!! You oooh really helped me!! THANK YOU

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

    wow. This is... really good, thank you!

  • @brunch1572
    @brunch1572 2 года назад +2

    This video was great. I used the first shader to make my player and enemies flash when taking damage. The second shader was amazing because I previously didn't know how to make a shader that affects the whole screen or part of the screen. I'm working with a limited color palette in my game and I used the shader to make a color replacer which scans all the colors on the screen and changes them to a hue of your choice but only uses exact colors from the palette. I cant really explain it properly but it ends up being like gameboy color where you can choose between a bunch of color palettes.

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

    Great video. Waiting for part 2.

  • @이유나-z8w
    @이유나-z8w 2 года назад

    Thankyou for your video
    circle Distortion 5:05

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

    I've always had problems understanding shaders and how to actually program them. This simple video feels like its made me understand so many things that didn't quite click when I was last playing around with them. Might have to give it another chance now!

  • @IvarDaigon
    @IvarDaigon Год назад +1

    One of the simplest and easiest explanations of shaders that I have ever seen. thank you!

  • @Magnogen
    @Magnogen 2 года назад +1

    This was incredibly helpful, thank you!

  • @cvillian098
    @cvillian098 2 года назад +1

    This helped a lot, thanks for this!

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

    Jesus H Christ this is beautiful!!
    You got yourself a subscriber!

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

    Good stuff thanks
    working on this for our game so good to see more stuff on it

  • @dayw81
    @dayw81 2 года назад +2

    I heard "part two" I click like.

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

    this is exactly the video i hoped it would be when i clicked on it

  • @Pierogo
    @Pierogo 2 года назад +1

    Really nicely explained, thanks!

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

    Genuinely informative. Thx!

  • @orkmaedchen
    @orkmaedchen 2 года назад +2

    also interesting for the 3D folks... ah, ich seh gerade ein bissel 3d ist auch dabei :) Gute Arbeit btw!

  • @NekotoArts
    @NekotoArts 2 года назад +1

    You guys covered so much in 7mins!! Love your work!
    Also, I think you guys forgot to link the video from 5:26

  • @ukrsolid
    @ukrsolid 2 года назад +1

    Great info, thanks for sharing!

  • @ngoctamnguyen2580
    @ngoctamnguyen2580 2 года назад +2

    explaint very clear. Thank you very much

  • @KekLuck
    @KekLuck 2 года назад +3

    Einfach so gut erklärt, perfekt!

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

    Shader is pretty cool, actually.
    And this guy is turning me into Godot user.

  • @hidemat5141
    @hidemat5141 2 года назад +3

    Part 2 let's go! Also where is your fish mic?

    • @PlayWithFurcifer
      @PlayWithFurcifer  2 года назад +2

      Didn't have the camera set up, but it was in use :)

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

    Yes Part 2!

  • @clydejackson5188
    @clydejackson5188 3 месяца назад

    This was 2 years ago and you're still the goat, King Him 👑

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

    Amazing! Thank you so much!

  • @TommyLikeTom
    @TommyLikeTom 2 года назад +1

    youtube suggested the perfect video for me

  • @jatoxo
    @jatoxo Год назад +3

    What I'm a bit confused about is how the texture resolution matters. Does the fragment run for every pixel in the texture or every screen pixel?

    • @PlayWithFurcifer
      @PlayWithFurcifer  Год назад +1

      Great question! Basically, the texture gets streched to the same size. A UV of (0,0) is always the top left, and (1,1) is always the bottom right. If you reduce the texture resoltution, it will look more pixelated.
      So the fragment function runs for each screen pixel, and can sample texture pixel multiple times or not at all.

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

    interesting what can be donde with few lines of code, at least in godot. And these look amazing. And the 3D version: just wow! makes me want to try it.

  • @brandonjacksoon
    @brandonjacksoon 2 года назад +1

    Liked and subscribed! Thanks for video.

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

    Me acabo de encontrar un canal que vale oro puro 🎉🎉🎉

  • @martinl6790
    @martinl6790 2 года назад +1

    this made shaders a lot less intimidating! :D

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

    Thanks to you I made my first steps into shaders. How I can apply a shader to a scene transition? this is something that I cannot find it yet. Thanks for your great videos

  • @iridelombardi
    @iridelombardi 2 года назад +1

    i recommend freya's course on her channel even if its for unity! shes really good

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

    I've seen UVs outside of [0; 1], for instance when a texture is repeated or in townscaper, where the integer part describes the color of the building

  • @alperg1142
    @alperg1142 2 года назад +1

    Very Thank you.

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

    Grayscale is not an average btw. grayscale = dot(COLOR, vec3(0.21,0.67,0.12)); is more accurate, as the human eye responds differently to red, green and blue in terms of perceived brightness/value/luma.

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

      It really depends on what you want to do with it. We use it to index a gradient later in the video, where averaging makes more sense imo.
      ALL versions of calculating greyscale on RGB are inaccurate. RGB itself is a rough approximation and there is not *the* human eye we all have to share fortunately.
      The RGB-weights are WILDLY different if you use your grayscale to simulate an old camera for example. Just use the one fitting to what you want to achieve, there is no single *right* one.
      And you multiply a vec4 with a vec3.

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

    I'd like to see a part dedicated to compute shaders.

  • @codenottaken
    @codenottaken 2 года назад +1

    You are awesome. Can i ask where did u learn all this? I am a beginner in such things

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

      Having coding experience helps a lot. Apart from that: Mostly looking at breakdowns of specific effects. (We have a bunch of those on the channel)
      Shaders are weird but once you get used to them its not that hard.

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

    5:22 So this is basically how the art style of 11-11 Memories Retold was made

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

    Thank you very much!

  • @SW-vy4he
    @SW-vy4he 2 года назад +1

    Very helpful

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

    What about classic 2D effects like older games had? The simple waving effects.

  • @thomasmarkle8480
    @thomasmarkle8480 2 года назад +1

    thats a very good code

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

    Hi ! Love your tutorials btw.
    I'm a newbie in Godot
    I want to know, are there any tutorials about creating shader that outline all objects in screen?