Godot 3D Spatial Shaders: Getting Started

Поділитися
Вставка
  • Опубліковано 5 лип 2024
  • Godot shaders aren't so scary! This quick intro will hopefully get you over your fear of them, and you can start making something awesome! Link to docs below ↓↓↓
    0:00 Intro
    0:19 Add a material
    0:51 Convert spatial to shader material
    1:06 Simple shader material
    1:46 Animating color with sine function
    2:14 Modifying vertices
    2:44 Ripples of colors
    2:55 Saving shaders and materials
    3:21 Setting variables externally/from script
    4:19 Setting a texture on a custom shader
    4:56 Using texture colors to mask
    5:52 Modify UV coordinates.
    6:11 render mode - unshaded/add/multiply
    6:22 Shader documentation
    6:40 Patrons
    Spatial shader reference page: docs.godotengine.org/en/3.4/t...
    Consider supporting me on Patreon if you found this useful. I get nothing from UA-cam! / jitspoe
    #GodotEngine #Shaders #GameDev
  • Ігри

КОМЕНТАРІ • 108

  • @homelessbag
    @homelessbag Рік тому +26

    came for the shaders, stayed because of the moustache, and subbed because i learned how to pronounce godot :)

  • @WuCSquad
    @WuCSquad 3 місяці тому +7

    Love all the different pronunciations of Godot.

  • @akienK
    @akienK 2 роки тому +6

    Really nice format, that was really fun and packed with good tips. Goodoo...

  • @BastiaanOlij
    @BastiaanOlij 2 роки тому +4

    Great stuff Jits!!

  • @jburtson
    @jburtson 2 роки тому +3

    This absolutely made me less afraid of shaders, I’ll definitely be gettin’ silly in Gootdoot

  • @MrEliptik
    @MrEliptik 2 роки тому +5

    Really cool! Super dynamic and packed with information, awesome!

  • @kitastro
    @kitastro 9 місяців тому +14

    saying godot different each time XD

  • @Quandinis
    @Quandinis 2 роки тому +3

    i think my favourite part isn't the knowlage i now have about shaders in godot, but that the pronunciation of godot changes everytime. by far the best injection of humor in a tutorial!

    • @jitspoe
      @jitspoe  2 роки тому +3

      I've discovered at least 64 possible permutations. Should be able to keep this gag going for a lot of tutorials!

  • @J_A_C023
    @J_A_C023 Місяць тому +5

    I think you covered every single pronunciation of the engine for us all, thank you :P That was EPIC

    • @jitspoe
      @jitspoe  Місяць тому +1

      Nah, still around 60 more to go.

    • @J_A_C023
      @J_A_C023 Місяць тому

      @@jitspoe true story

  • @crabsoft
    @crabsoft 2 роки тому +3

    Tried a lot of tutorials, this was the first one that didn't abruptly fly off the rails with crazy math. I made a shader. Thanks, yo.

  • @PhilGorley
    @PhilGorley Рік тому +5

    In all seriousness, this is a succinct intro to 3D spatial godot shaders. Much of the learnings are transferred to canvas shaders too, so, this tutorial was a tremendous help for getting me to understand shaders. I've kept the tab open to this video for the past two weeks while I've done some shader work. Thanks for the content and cheers!

  • @nowherebrain
    @nowherebrain 2 роки тому +3

    I love how your pronunciation for godot keeps changing...I get it...greatintro to shaders vid...short, simple and to the point...yet full of info.

  • @user-gj6nq1nn1u
    @user-gj6nq1nn1u Рік тому +5

    very informative. i like how you made me question my sanity everytime you pronounce godot so that the brain gears dont get rusty

    • @jitspoe
      @jitspoe  Рік тому +3

      What? I just said "Godot".

  • @Obeah111
    @Obeah111 2 роки тому +4

    Great Gerdoot tutorial! I have don't several game jams, and have still been intimidated by shader---this video presents it in a very approachable manner!

  • @jeremiahlampkey3137
    @jeremiahlampkey3137 5 місяців тому +1

    I googled for godot shader tutorials. Saw one that was 22 mins long and then this one for ~ 7 minutes.
    Absolutely pleased with how much, how fast, and how concise the information was presented in this video!

  • @SwagGaming87
    @SwagGaming87 6 місяців тому +3

    best godot tutorial I've ever seen please keep making these

  • @mr._gear
    @mr._gear 10 місяців тому +3

    "Scary, black magic and voodoo" was epic😂

  • @sigterm_
    @sigterm_ Рік тому +2

    This was really excellent. The fun step-by-step examples really distilled how to break down the basics for me. Off to experiment!

  • @the-guy-beyond-the-socket
    @the-guy-beyond-the-socket 10 місяців тому +4

    dude your videos are hidden gold.

    • @jitspoe
      @jitspoe  9 місяців тому +3

      Hopefully the gold becomes more discovered in the future! :)

  • @wisconsinwintergreen6296
    @wisconsinwintergreen6296 2 місяці тому +1

    Very well done video. It managed to give just the right amount of information in under 7 minutes. Other videos would have spent well over half the length of this video just regurgitating random boilerplate knowledge about shaders that anyone could guess.
    Much thanks from a beginner and you have earned a subscriber!

  • @CaptainCarrotzz
    @CaptainCarrotzz 6 місяців тому +2

    Best intro to shader video I've seen. Thanks.

  • @microdavid7098
    @microdavid7098 2 роки тому +2

    jits tutorials? Hype!

  • @Gizrah
    @Gizrah Рік тому +3

    I haven't heard someone say godot as godot in so many different ways.
    Thanks for demistifying some of the shader voodoo for me!

    • @jitspoe
      @jitspoe  Рік тому +2

      I just called it "Godot".

    • @_-_o-o_-_
      @_-_o-o_-_ Рік тому +4

      @@jitspoe Weird. I always pronounce it "Godot"

  • @JulezChilluminati
    @JulezChilluminati Рік тому +1

    Finally, a godot shader video that makes sense to me! Thank you so much, funny beard man!

  • @spimortdev
    @spimortdev 2 роки тому +3

    That's awesome! Thanks for that tutorial 🙂

  • @craniummatter
    @craniummatter Рік тому +2

    this video is gold. thanks!

  • @Paruthi.618
    @Paruthi.618 Рік тому +2

    one of the best godot shader tutorial

  • @sinecure5
    @sinecure5 2 роки тому +1

    Great tutorial, thanks for making this!

  • @sakari.niittymaa
    @sakari.niittymaa 3 місяці тому +1

    Instant sub after watched this video! Really well explained!

  • @jeffreystephens2658
    @jeffreystephens2658 2 місяці тому +2

    This video contained the answer I needed. Thank you very much. Liked, subscribed, saved.

    • @jitspoe
      @jitspoe  2 місяці тому

      Awesome! Glad it helped!

  • @Nickname-lm7ch
    @Nickname-lm7ch 6 місяців тому +3

    Thank you man what a cool thing. I am quite keen on the gada engine

    • @jitspoe
      @jitspoe  6 місяців тому +2

      Yeah, gudoot is pretty neat!

  • @Failfer
    @Failfer 6 місяців тому

    Really good explanation and I apprecaite the wave thing as I was able to replicate it before but still don't fully understand how and this helped, thank you

  • @adrinuk_gamedev
    @adrinuk_gamedev 2 роки тому

    I really liked this video :D Thanks a lot for the help!

  • @D.E.Nicolas.Goncalves
    @D.E.Nicolas.Goncalves 7 місяців тому +2

    You made it simple for me! thanks!

    • @jitspoe
      @jitspoe  7 місяців тому +2

      Glad I could help!

  • @herrwoland3500
    @herrwoland3500 2 роки тому

    Thank you so much for this!

  • @4.0.4
    @4.0.4 8 місяців тому +1

    I was worried this tutorial would be too outdated but it's still valid!

    • @jitspoe
      @jitspoe  8 місяців тому +1

      Fortunately not TOO much has changed regarding shaders between Godot 3 and 4. Godot 4 has a lot of new nice things like includes, defines, and other preprocessor stuff, too!

  • @moffwings
    @moffwings 7 місяців тому +1

    thank you! very fun

  • @michaelorlev9925
    @michaelorlev9925 11 місяців тому +4

    Dude, you're like the Ian hubert of Godot..! Just found your channel, subbed liked, and now commented

    • @jitspoe
      @jitspoe  11 місяців тому +1

      Haha, that's the best complement I could receive! That's definitely what I'm going for. Bothers me when people take 10 minutes to explain something that could be done in 15 seconds! Just wish I had the time to make more tutorials.

  • @PenguinMaths
    @PenguinMaths Рік тому +1

    perfect tutorial

  • @fahadhasn
    @fahadhasn Рік тому +2

    Gruda, Garuda, Grudo. I am groot. XD Nice Tut Mate

  • @mch43856
    @mch43856 Рік тому +1

    thank you, amazing!

  • @SLSat
    @SLSat Рік тому +1

    This was a really helpful

  • @GameFactsSpecial
    @GameFactsSpecial 6 місяців тому +1

    thanks even though I'm using godot 4 this was still helpful

  • @davidmurphy563
    @davidmurphy563 2 роки тому +1

    Could I request a further tutorial to get me over the fear of your mustache? ;))
    Great little tutorial, thanks!

  • @thundermark3d
    @thundermark3d Рік тому +2

    I would like it twice if I could!

  • @ClokworkGremlin
    @ClokworkGremlin 9 місяців тому

    One of the things I love about shaders is they're INCREDIBLY powerful for procedural asset creation. Because the shader runs on the GPU, ideally entirely within the span of a single frame, you can set some parameters as Uniforms which the Godot UI will let you play with in the editor and see the results of those tweaks in realtime, instead of having to wait for the CPU to process your changes and send them to the GPU (which can sometimes take a few seconds, especially with very large datasets)

    • @jitspoe
      @jitspoe  9 місяців тому +1

      Material Maker basically takes that to the extreme. 😁

  • @ruthmoreton6975
    @ruthmoreton6975 7 місяців тому +2

    I'm glad you pronounce it correctly - "Godot" as in the Samuel Becket play "Waiting for Godot" to which the name is a reference ( Developer stated this ) and not "G'doh" as some people pronounce it.
    Ahh crap. Seriously dude? Gadoot and Go Dot? I will assume you are trolling people and I just fell for it.

  • @crispyghoul
    @crispyghoul Рік тому +1

    Wow, this was a great tutorial. I could think of a way to use the uv method to make a moving gore texture for creatures in my.project.

    • @jitspoe
      @jitspoe  Рік тому

      You can create a lot of cool effects by simply animating UV's!

  • @Combine7355
    @Combine7355 2 роки тому +1

    Goodness gracious... 6:11

  • @NonUnknownDev
    @NonUnknownDev 2 роки тому +2

    what a tutorial bro, what a tutorial.....

  • @ez1170
    @ez1170 Рік тому +1

    epic

  • @PaperMouseGames
    @PaperMouseGames 4 місяці тому

    This is absolutely fantastic. I wonder if there's any way to create more than 3 color masks though. Rather than using rgb from a texture could you specify certain colors to be identified by the shader and then changed to new colors?

    • @jitspoe
      @jitspoe  4 місяці тому +1

      Technically you can do 4 with RGBA textures. You could potentially use ranges of colors, like first half of red maps to one color and the second half of red to another, but keep in mind you'll have less precision with this (unless using a high precision image format, but that takes more memory), and you might run into some poor quality or glitches, especially if you're using texture compression.

    • @PaperMouseGames
      @PaperMouseGames 4 місяці тому

      @@jitspoe Thanks much for the reply! I'm working with pixel art textures, so each color is very clearly defined and I think it could work, but what I need to figure out is if there's a way to pick up a texture's individual pixel color in 3D the way you can in 2D, I'll keep experimenting 🤞

    • @jitspoe
      @jitspoe  4 місяці тому

      @@PaperMouseGames Shouldn't be a problem, but keep in mind that, by default, the albedo texture gets converted from sRGB to Linear, then everything gets converted from linear to sRGB back in the end, so you might not get the exact values you expect. You could take the texture value and multiply it by 255 and round it to an integer to pick exact values, though.

  • @JRHainsworth
    @JRHainsworth 9 місяців тому +2

    Has the spacialmaterial been replaced with StandardMaterial3D in godot4?

    • @jitspoe
      @jitspoe  9 місяців тому +1

      Yep! The also added another one called ORMMaterial which reads ambient occlusion, roughness, and metallic all packed into a single texture to be more optimal.

  • @lucazfc
    @lucazfc 2 роки тому

    Hi.
    Do you know how to simulate lighting using a spatial shader?
    For example, f I'm using 'render_mode unshaded' or 'render_mode ambient_light_disabled' and then I want to simulate the effects of a directional light using only the shader. How can I achieve that?

    • @jitspoe
      @jitspoe  2 роки тому +3

      In short, you need to do the dot product of the surface normal with the direction to the light, make sure it's not less than 0 (ex: max(0.0, dot(light_dir, normal)) and multiply that by the albedo to get some super basic lighting. If you want parts of the shader to be lit and other parts unaffected by light, though, you're probably better off not using unshaded and using EMISSION for the parts you don't want impacted by lighting instead.

  • @nyuh
    @nyuh 2 роки тому

    nice moustache
    oh and nice vid too i guess :^)

    • @jitspoe
      @jitspoe  2 роки тому +3

      Thanks, I grew it myself!

  • @fahrulrozy7838
    @fahrulrozy7838 9 місяців тому +2

    Shader in godot use glsl or hlsl?

    • @jitspoe
      @jitspoe  9 місяців тому +2

      GLSL, but with a bit of a Godot wrapper so there's some built-in functionality.

  • @perfredelius
    @perfredelius 2 місяці тому +1

    I love the condensed format! The next thing I'd want to learn here is how to bend the mesh along a 3d curve or something like that. I.e. how to use a bit more complex external "non-mesh" data in the shader. And then see how the mesh changes as the curve is interacted with.

    • @jitspoe
      @jitspoe  2 місяці тому

      In the end, it's all math! Just have to figure out what the math is to generate the curve you want. Alternatively, you can actually use an image if you want to do something more elaborate. You can read a texture within the vertex() function and use that to alter the vertex positions. Great for making leaves rustle in the wind and such with a noise texture.

    • @perfredelius
      @perfredelius 2 місяці тому

      ​@@jitspoe Ah, yeah that's true. I suppose you only need to send in the control points and then calculate the curve from inside the shader. That's probably how to do it.

  • @ClaudioCavalcanteTonha
    @ClaudioCavalcanteTonha 9 місяців тому +1

    Does someone knows the difference set color by using COLOR or ALBEDO?

    • @jitspoe
      @jitspoe  9 місяців тому

      COLOR is used for 2D canvas item shaders and can include alpha. ALBEDO is just the diffuse color (lighting and such will be applied if it isn't unshaded).

    • @ClokworkGremlin
      @ClokworkGremlin 9 місяців тому

      COLOR is used for Canvas shaders, and Vertex shaders if you want to set the vertex color. ALBEDO is used for Fragment shaders. Basically that's the whole thing, ALBEDO is the pixel color, COLOR is the vertex color.
      Godot will yell at you if you try to set COLOR in the Fragment shader, so it's not a mistake you're likely to make for long.

    • @jitspoe
      @jitspoe  9 місяців тому

      @@ClokworkGremlin Oh, right, forgot about the vertex color!

  • @x1expert1x
    @x1expert1x 9 місяців тому +1

    with the final downfall of Unity at least your channel will get a lot more attention. I am not gonna lie, I loved Unity and spent a lot of time learning it. But I love open source more. Like my dad always says, there's a pony under that pile of sh*t!

  • @7fantasy7
    @7fantasy7 4 місяці тому

    Thank you! This video made me believe, I can do complex shaders one day... After losing confidence from another tutorials

  • @jonmoore3486
    @jonmoore3486 7 місяців тому +1

    waiting for guh-dough

  • @Arthur-jg4ji
    @Arthur-jg4ji Рік тому

    do you know how to have shadow with the shader in 3D ?

    • @jitspoe
      @jitspoe  Рік тому

      Just don't put "unshaded" in the render_mode and it should have lighting and shadow applied.

    • @Arthur-jg4ji
      @Arthur-jg4ji Рік тому

      @@jitspoe thx you for the reply. But i have found a solution with the scatter plugin.

  • @user-nd9qj8pm4d
    @user-nd9qj8pm4d 8 місяців тому +1

    You actually spooked me at 6:11 haha

    • @jitspoe
      @jitspoe  8 місяців тому

      😆 Forgot I even had that in there.

  • @mineralbrewer2289
    @mineralbrewer2289 Рік тому

    is it possible to add shaders to a glb file?

    • @jitspoe
      @jitspoe  Рік тому

      I'm not sure if the glb specification allows for that. I'm pretty sure you can store basic materials in them, but I don't know if you can do any sort of programming with them.

  • @creationsmarko
    @creationsmarko 2 роки тому +6

    Great video but it kills me when he says "Godoot" lmao

  • @bobsondugnut4179
    @bobsondugnut4179 2 роки тому +1

    gadort

  • @ChristopherYabsley
    @ChristopherYabsley 7 місяців тому +1

    It's pronounced Godot.

  • @moonlightblue9196
    @moonlightblue9196 8 місяців тому +1

    voodoh lol

  • @computer9764
    @computer9764 2 роки тому +4

    Almost didn't watch because the mustache.
    You're lucky I did 😉

    • @jitspoe
      @jitspoe  2 роки тому +7

      *Whew* I'd hate to think of what might happen if you didn't.

  • @decqyd
    @decqyd Рік тому +12

    its pronounced godot smh

  • @MrDoboz
    @MrDoboz 7 місяців тому +1

    it's still black magic. you can make pointless unsensible whacky things in a few minutes, but making anything realistic or actually useful will take a shitton of time and knowledge

    • @jitspoe
      @jitspoe  6 місяців тому

      Fortunately, the way Godot shaders are set up with the PBR (physically based rendering), really all you have to worry about is setting things like ALBEDO, ROUGHNESS, METALLIC, etc. It's typically just a matter of scrolling UV's or blending different textures together. You don't have to do all the math to make a realistic looking render.
      Is there something specific you're struggling with?

  • @everlastingmedia
    @everlastingmedia 9 місяців тому +3

    gadoot... stahp it