How To Shader (Fast) - using Godot Engine

Sdílet
Vložit
  • čas přidán 23. 04. 2022
  • Shaders have always scared or confused you? I get it. And I'm here to help you write them. This is an introduction where I show you the basic concepts of 2D and 3D shaders and what effects you can do with them. Examples are done using Godot Engine, but can be applied to Unity or Unreal as well.
    We made part 2! • How To Shader. (using ...
    Playlist with all our VFX videos: • Godot VFX Tutorials
    Blackhole tutorial where we use screen reading + distortion: • EASY Black Hole (also ...
    Resources used:
    trixelized.itch.io/starstring...
    luizmelo.itch.io/fantasy-warrior
    --
    Wishlist our action roguelite Furcifer's Fungeon: store.steampowered.com/app/17...
    Join our discord server: / discord
    Follow us on twitter to stay updated on Furcifer news and tutorials:
    / tweetfurcifer

Komentáře • 258

  • @Blockmaster987
    @Blockmaster987 Před 2 lety +425

    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 Před 2 lety +95

      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 Před 2 lety +7

      Get to Heaven is so dope!

    • @iidoyila
      @iidoyila Před 2 lety +2

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

    • @foobars3816
      @foobars3816 Před 2 lety +9

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

    • @bonniefinleyanimation
      @bonniefinleyanimation Před 2 lety +10

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

  • @FadedPatchwork
    @FadedPatchwork Před 8 měsíci +50

    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*

  • @lorgarmor5886
    @lorgarmor5886 Před 2 lety +250

    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  Před 2 lety +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 Před 2 lety +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.

  • @mahyellaw
    @mahyellaw Před 2 lety +72

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

  • @suicraft8395
    @suicraft8395 Před rokem +7

    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 Před 20 dny

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

  • @asdaaaaaaaaaaaaaasd
    @asdaaaaaaaaaaaaaasd Před 2 lety +37

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

    • @Jakub_13
      @Jakub_13 Před 2 lety +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  Před 2 lety +2

      Totally agree with you Jakub :)

    • @plantsvs.zombies-gameplay4812
      @plantsvs.zombies-gameplay4812 Před 2 lety

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

  • @SwagGaming87
    @SwagGaming87 Před 4 měsíci +3

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

  • @foobars3816
    @foobars3816 Před 2 lety +25

    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.

  • @keithwinget3450
    @keithwinget3450 Před 2 lety +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.

  • @nauthic3p0
    @nauthic3p0 Před 2 lety +2

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

    • @PlayWithFurcifer
      @PlayWithFurcifer  Před 2 lety

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

  • @benjaminswee-shaders
    @benjaminswee-shaders Před 2 lety +1

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

  • @eboatwright_
    @eboatwright_ Před rokem +3

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

  • @KillerGameDev
    @KillerGameDev Před 7 měsíci

    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!

  • @jex8885
    @jex8885 Před rokem

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

  • @KyleMendes0
    @KyleMendes0 Před 2 lety +3

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

  • @AlexandraErin
    @AlexandraErin Před rokem

    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.

  • @FelskiTV
    @FelskiTV Před 4 měsíci +1

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

  • @judsonhester1407
    @judsonhester1407 Před 2 lety +1

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

  • @RialuCaos
    @RialuCaos Před 2 lety

    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.

  • @ruix
    @ruix Před rokem

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

  • @saultoons
    @saultoons Před 2 lety +1

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

  • @Malcx1
    @Malcx1 Před 2 lety +1

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

  • @V8sim
    @V8sim Před 2 lety +1

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

  • @vidvad
    @vidvad Před 2 lety

    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!

  • @timberjustinlake
    @timberjustinlake Před 2 lety +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!

  • @tristanvandansik8889
    @tristanvandansik8889 Před 2 lety +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  Před 2 lety +4

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

  • @Uns1gnedINT
    @Uns1gnedINT Před 2 lety

    3 seconds in and it's already awesome!

  • @mvolkankarakas
    @mvolkankarakas Před 2 lety +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 😄

  • @sheepcommander_
    @sheepcommander_ Před 9 měsíci

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

  • @MRxRadex
    @MRxRadex Před rokem +1

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

  • @ItzNero69
    @ItzNero69 Před 2 lety +2

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

  • @tonybrownlowe2272
    @tonybrownlowe2272 Před rokem +1

    These tips are great will be using them all!

  • @WMIIIProduktions
    @WMIIIProduktions Před 2 lety +2

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

  • @StanleyKubick1
    @StanleyKubick1 Před 2 lety +1

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

  • @mediopalodev
    @mediopalodev Před 6 měsíci

    Brilliant stuff! thanks for sharing this 👊

  • @Noita_
    @Noita_ Před rokem +1

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

  • @everybodyants
    @everybodyants Před 2 měsíci +2

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

    • @PlayWithFurcifer
      @PlayWithFurcifer  Před 2 měsíci +1

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

    • @everybodyants
      @everybodyants Před 28 dny

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

  • @LongestYardstick
    @LongestYardstick Před 2 lety +6

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

  • @TheRobertoCarbonell
    @TheRobertoCarbonell Před 7 měsíci +1

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

  • @VoyivodaFTW1
    @VoyivodaFTW1 Před 2 lety +1

    PART 2! WE NEED A PART 2!!!

  • @myjourneyhaartransplantati1589

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

  • @soleypas
    @soleypas Před 2 lety +2

    Really nice explanation, subbed!

  • @ukrsolid
    @ukrsolid Před 2 lety +2

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

  • @AdredenGaming
    @AdredenGaming Před 2 lety

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

  • @cloudwolf3972
    @cloudwolf3972 Před 2 lety

    Great video. Waiting for part 2.

  • @SuperQuwertz
    @SuperQuwertz Před 2 lety +2

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

  • @HyperEpicGames
    @HyperEpicGames Před 2 lety

    Genuinely informative. Thx!

  • @Magnogen
    @Magnogen Před 2 lety +1

    This was incredibly helpful, thank you!

  • @bencepaul3497
    @bencepaul3497 Před 9 měsíci

    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 🙂

  • @affensind
    @affensind Před 2 lety

    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!

  • @mikecu2249
    @mikecu2249 Před 7 měsíci

    That must be the best shader tutorial there is

  • @PlayWithFurcifer
    @PlayWithFurcifer  Před 2 lety +44

    Have you used shaders? What's your experience?
    Edit: Part 2 is up now! czcams.com/video/KVTa2xkly1g/video.html

    • @Relivino
      @Relivino Před 2 lety +1

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

    • @Jakub_13
      @Jakub_13 Před 2 lety +2

      First pain..
      Then joy, eternal

    • @AV-qr4kl
      @AV-qr4kl Před 2 lety

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

    • @Byron_Vega
      @Byron_Vega Před 2 lety

      Never have but now I will. Thanks for the video

    • @centdemeern1
      @centdemeern1 Před 2 lety +1

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

  • @SetimoRei
    @SetimoRei Před 2 lety +2

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

  • @user-un4ks9dy9l
    @user-un4ks9dy9l Před 2 lety

    Thankyou for your video
    circle Distortion 5:05

  • @godotShaderBoy
    @godotShaderBoy Před měsícem

    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!

  • @jacksontriffon5064
    @jacksontriffon5064 Před 2 lety +1

    Beautifully explained in 7 mins

  • @yell9140
    @yell9140 Před 2 lety +1

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

  • @Pierogo
    @Pierogo Před 2 lety +1

    Really nicely explained, thanks!

  • @orkmaedchen
    @orkmaedchen Před 2 lety +2

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

  • @TuncTurel
    @TuncTurel Před 8 měsíci

    Amazing! Thank you so much!

  • @xyour_momx391
    @xyour_momx391 Před 2 lety

    The best vidos I've seen bro ??

  • @cvillian098
    @cvillian098 Před 2 lety +1

    This helped a lot, thanks for this!

  • @ukrsolid
    @ukrsolid Před 2 lety +1

    Great info, thanks for sharing!

  • @ngoctamnguyen2580
    @ngoctamnguyen2580 Před 2 lety +2

    explaint very clear. Thank you very much

  • @jsn4591
    @jsn4591 Před 2 lety +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 :)

  • @tralchee0354
    @tralchee0354 Před 2 lety

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

    • @PlayWithFurcifer
      @PlayWithFurcifer  Před 2 lety

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

  • @IvarDaigon
    @IvarDaigon Před 8 měsíci +1

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

  • @thomlaurent
    @thomlaurent Před 2 lety +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!

  • @alvarorodriguez1592
    @alvarorodriguez1592 Před 8 měsíci

    Thank you very much!

  • @alperg1142
    @alperg1142 Před rokem +1

    Very Thank you.

  • @dayw81
    @dayw81 Před 2 lety +2

    I heard "part two" I click like.

  • @brunch1572
    @brunch1572 Před 2 lety +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.

  • @brandonjacksoon
    @brandonjacksoon Před 2 lety +1

    Liked and subscribed! Thanks for video.

  • @francomasip
    @francomasip Před rokem

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

  • @KekLuck
    @KekLuck Před 2 lety +3

    Einfach so gut erklärt, perfekt!

  • @MilMike
    @MilMike Před 2 lety

    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.

  • @frogman1
    @frogman1 Před 2 lety

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

  • @toatrika2443
    @toatrika2443 Před 15 dny

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

  • @ReflectiveLayerFilm
    @ReflectiveLayerFilm Před 2 lety

    Yes Part 2!

  • @hidemat5141
    @hidemat5141 Před 2 lety +3

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

  • @thanatosor
    @thanatosor Před 2 lety

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

  • @shadamethyst1258
    @shadamethyst1258 Před 2 lety

    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

  • @osx8227
    @osx8227 Před 3 měsíci

    Hey thank you for hte video. I have a question. If I have multiple textures in a scene and I want the shader to effect all those textures is there a way to pass those all into the shader as a single texture? Kind of like a texture render

  • @TommyLikeTom
    @TommyLikeTom Před 2 lety +1

    youtube suggested the perfect video for me

  • @SW-vy4he
    @SW-vy4he Před 2 lety +1

    Very helpful

  • @martinl6790
    @martinl6790 Před 2 lety +1

    this made shaders a lot less intimidating! :D

  • @diegofelipere
    @diegofelipere Před 2 lety

    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

  • @NekotoArts
    @NekotoArts Před 2 lety +1

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

  • @AURORAFIELDS
    @AURORAFIELDS Před 2 lety

    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!

  • @thomasmarkle8480
    @thomasmarkle8480 Před 2 lety +1

    thats a very good code

  • @TheBoxyBear
    @TheBoxyBear Před 2 lety

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

  • @iridelombardi
    @iridelombardi Před 2 lety +1

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

  • @Chevifier
    @Chevifier Před 2 lety

    Ive been loving every moment of learning shaders. Thanks for this video. I didnt know exactly how to achieve grayscaling. I still dont fully understand how to smoothly blend between 2 colors. Think of a terrain where the grassy planes transition to snowy mountains. How would I smoothly blend between the 2? 🤔

  • @BlendFin
    @BlendFin Před 2 lety +1

    Thankyou!

  • @NPCsz
    @NPCsz Před 8 měsíci

    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?

  • @alecburmeister8884
    @alecburmeister8884 Před 2 lety

    at the 5 minute mark, you show the images you used for the distortion. Where can i download those? :)
    Great videos as always!

  • @jlewwis1995
    @jlewwis1995 Před 2 lety

    Won't making a shader local to scene cause every sprite that uses that material to have a separate draw call? Or can godot batch sprites that use the same material even if that material is local to the scene?

  • @jatoxo
    @jatoxo Před rokem +2

    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  Před rokem +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.

  • @iR0CKt
    @iR0CKt Před 2 lety

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

  • @WistrelChianti
    @WistrelChianti Před 2 lety +1

    My head does hurt a little but I get what they are vaguely doing now at least