SNOW in Unity - SHADER GRAPH

Поділитися
Вставка
  • Опубліковано 13 січ 2025

КОМЕНТАРІ • 294

  • @PanCave
    @PanCave 5 років тому +160

    Just a quick math note: 3:47 "And because the dot-product of two parallel vectors is 1"
    That is not generally true. This is only true, if the product of the lengths of these vectors is 1.
    Typically, normal vectors have a length of 1, as well as automatically initialized direction vectors, so in this scenario it's true. But it could yield to some strange effects in other circumstances.
    Edit: A general solution to this would be to normalize the vectors. As stated by Small Pixel, changing the direction, whiteout changing the length is pretty hard. So by changing the direction, the intensity would also be changed. Solution: Normalize the vectors

    • @junpeiiori4720
      @junpeiiori4720 5 років тому +7

      yeah he should have said "unit vectors"

    • @smallpixel6874
      @smallpixel6874 5 років тому +3

      There is another thing - on 7:47 he changed the SnowDirection vector and it stopped being a unit one, so the dot product is not going to be 1 in this case and the snow will have more opacity than it should have on the sides.

    • @esben181
      @esben181 5 років тому

      I literally just learned about vectors today so I picked that up too

    • @Joacim-A
      @Joacim-A 5 років тому +3

      I reacted on the fact that he, at 4:59 used a clamp node to clamp the dot product between 0 and 1, this is incorrect but doesn't matter as long as the vectors are normalized. The correct procedure would be to first normalize both vectors and used the dot product of those.

    • @Brackeys
      @Brackeys  5 років тому +29

      This is very true. Thanks for pointing it out! :-)

  • @GabrielAguiarProd
    @GabrielAguiarProd 5 років тому +29

    It's quite an interesting shader isn't it? Thanks for the credit. Great video.

    • @GabrielAguiarProd
      @GabrielAguiarProd 5 років тому +10

      Here's my version just in case: ua-cam.com/video/Q43XBychCEY/v-deo.html

    • @PolyToots
      @PolyToots 5 років тому +7

      Be nice if he mentioned you in the actual videos though. This isn't the first time he's used your stuff.

    • @Xadness22
      @Xadness22 5 років тому

      Bro your channel have really cool shader tutorial
      Thanks bro!I also watch your shader tutorials.:D

  • @sambojinbojin-sam6550
    @sambojinbojin-sam6550 5 років тому +1

    Thanks Brackey. Loving your shadergraph tutorials. Always simple enough and well explained enough so that we know what you're doing, but also complex enough so I feel I can take the next step on my own with the basics I've learned to expand such effects into other areas or tweak them to be how I want.

  • @harrytaylorj
    @harrytaylorj 5 років тому +5

    Brackeys! One thing that I noticed in your video is when you changed the shader for all of the materials in the full environment, it changed the Base Map of all the floor!! Look closely at 13:34, all the floor has the 'dungeon_set_02_atlas_01' texture instead of their pre-existing texture. You have to change the base map manually afterwards to get the snow on the floor tile textures

  • @Jabrils
    @Jabrils 5 років тому +13

    tight

    • @Cortus
      @Cortus 4 роки тому +4

      It's wild that it's been a year and no one thumbed up or geeked out that Jabrils commented!

  • @Lost1nTranslation
    @Lost1nTranslation 5 років тому +1

    Your videos keep getting better and better! (and they were already fantastic!)

  • @past874
    @past874 5 років тому +34

    Snow in a mayan temple? A conspiracy I say.

    • @humanbeing9140
      @humanbeing9140 5 років тому +1

      It never happened in Assassin's Creed 4

  • @Definitely_a_Fox
    @Definitely_a_Fox 5 років тому +11

    I was kinda hoping you'd use vector displacement to allow the snow to actually pile up, but this is a great video anyway!

  • @leak5005
    @leak5005 5 років тому

    I watch his videos and I don't even code anything I just find it super relaxing to watch him code.

  • @bbugarschi
    @bbugarschi 5 років тому +52

    nobody:
    Barckeys: "XML in general is very fun and easy to work with"...

  • @ChaosCreations0
    @ChaosCreations0 5 років тому

    I just wanted to say a thank you for your explanation of Dot Product, it was very concise and finally helped me to understand its purpose for future applications!

  • @tsukuyomin
    @tsukuyomin 5 років тому +47

    That's a lovely blackthornprod t-shirt you have there.

  • @thehuggz-i9k
    @thehuggz-i9k 5 років тому +20

    Should have named that variable "Snowpacity" Great video!

  • @raigallino
    @raigallino 3 роки тому +1

    I miss u brakeys

  • @factoberplay
    @factoberplay 3 місяці тому

    Hey Brackeys, this is a useful resource even in 2024.

  • @romisflasher
    @romisflasher 5 років тому

    Thank you so much! Your videos aren't the first time they are helping me out. By the way, here you can add a TilingAndOffset after the NormalVector to adjust the height of the snow cap and adjust along the "Y" axis

  • @omri_st4046
    @omri_st4046 5 років тому +14

    Hi
    I realy liked this video but I think you should do more series about creating a game (many videos about the same game), you did this before and you improved your Unity skils so much sience you started uploads videos into youtube.
    This is so important because every video that you upload is so helpful for me personatly.

  • @albarnie1168
    @albarnie1168 5 років тому +1

    a good idea is to factor in the normals and ambient occlusion for snow

  • @robertmcdonell831
    @robertmcdonell831 4 роки тому

    Loving that BlackThornProd shirt

  • @looserdev
    @looserdev 5 років тому +2

    Hi Sebastian!
    i just wanted to say i love your videos, and you give me a smile every day,
    i really love the way you're teaching and it just sucks to see your tutorials then see someone else's tutorials.. :P
    anyways, thanks for making all of those tutorials over the years, and i hope you would continue doing it for a long time :)

  • @derulan6111
    @derulan6111 5 років тому +3

    The forecast is a chilly 10 degrees with heavy lambertian snow

  • @Oxmond
    @Oxmond 5 років тому +1

    ❄️Let it snow!!! Great tutorial as usual! 👍🤓

  • @Welnianyy
    @Welnianyy 5 років тому +6

    The half of the may... you know.. spring.. about... 68°F/20°C outside...
    Brackeys: HMM LET'S MAKE A SNOW SHADER!

    • @guilleacq
      @guilleacq 5 років тому

      Well, I mean; the world has plenty of countries with different seasons, you know?

    • @Welnianyy
      @Welnianyy 5 років тому

      @@guilleacq oh, u are totally right.. i didn't think of that..

  • @cameronschiralli3569
    @cameronschiralli3569 5 років тому +1

    Wonderful tutorial.
    Also, nice shirt there

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

    If all materials use this shader, how to make the surface of the blocked object free of snow, such as indoor, tunnel?

  • @BJ-wz2mu
    @BJ-wz2mu 5 років тому

    Is that blackthornprod merch, its so wholesome for you to be wearing it. Love the unity community! Great video brackeys.

  • @JulioCesarCruzaltaNarvaez
    @JulioCesarCruzaltaNarvaez 3 роки тому +1

    Thank you very much!!! :)

  • @kennethvedder
    @kennethvedder 10 місяців тому

    Man, I miss this dude

  • @softandsgame4874
    @softandsgame4874 5 років тому +24

    The winter is comi... Sorry it's finish :(
    Good effect brackeys !

  • @GameSupporterBen
    @GameSupporterBen 5 років тому

    I was just wanting to do something with snow he other day in Unity! Thanks, Brackeys!

  • @hermesdavidms
    @hermesdavidms 5 років тому +2

    great stuff, i love this kind of tutorials.
    on a side note, yeah sure, mayan ruins covered in snow, instead of the usual scorching heat they are usually in

  •  5 років тому

    It's a bit of a trick but I think it works wonders! Very nice!

  • @toluyole
    @toluyole 4 роки тому +1

    *PETITION TO BRING BRACKEYS BACK*

  • @mahamed100100
    @mahamed100100 5 років тому +15

    Me:I wanna goto my house
    school's director:why
    Me:brackeys published a new video
    school's director:take my car

  • @melonheadwt
    @melonheadwt 5 років тому +3

    nobody :
    brackeys : uses a country flags image as a texture

  • @Deepankarsingh1993
    @Deepankarsingh1993 5 років тому +14

    Barkeys, can you make shader graph tutorial for making LWRP shader for speedtrees

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

    You are really good in this. Thank you for making this video too ^^

  • @stigmamax9996
    @stigmamax9996 3 місяці тому

    ton tuto m'a bien aidé !😊

  • @johnnydalvi3978
    @johnnydalvi3978 5 років тому

    nice, you could add some vertex displacement on the y axis too btw

  • @johndeleon8741
    @johndeleon8741 5 років тому +1

    You still have to apply the material to every object you want snow on which will affect performance. Also what if you wanted to add footsteps or skid marks? This needs to be converted into a post-process shader, I think.

  • @justinwhite2725
    @justinwhite2725 5 років тому

    Omg I’ve been wanting to do this awhile but for sand (which is similar) thanks!

  • @NarTheNecromancer
    @NarTheNecromancer 4 роки тому +15

    Is there a way to do this without having to go in and manually change the base map for each material?

    • @Atezian
      @Atezian 3 роки тому +1

      Im thinking that right now. :-( its not uncommon to have 100s of materials in a project

  • @TimeInRain
    @TimeInRain 3 роки тому

    It really helps a lot! I love it so much!!!

  • @rashiddev7545
    @rashiddev7545 5 років тому +9

    How about next video about Character footprints? I can't find any videos about this topic anywhere!

    • @joshpeace2673
      @joshpeace2673 5 років тому +3

      You could instantiate a footprint "decal" with a deep hight and normal map at your foot position while walking
      Public bool isRightFoot;
      Public game object Footprint;
      Game object right foot bone;
      Game object leftfootbone;
      Void walking ()
      [
      Movement code here ;
      SpawnFootPrint ();
      ]
      Void SpawnFootPrint ()
      [
      IsRightFoot == ! IsRightFoot
      If (isRightFoot==true)
      [
      Instantiate Game object Footprint(footboneRIGHT.transform.position.location)
      ]
      Else
      [
      Same as above but for left foot bone
      ]
      ]
      Hope this helps also put a destroy timer script on your decals for clean up

    • @curranh.8328
      @curranh.8328 5 років тому +1

      @@joshpeace2673 the hero we need, but dont deserve...

    • @joshpeace2673
      @joshpeace2673 5 років тому

      @@curranh.8328 have you tried the code I haven't used unity in a while and have forgotten some of the unity spacific syntax and structure so I hope this works for you

    • @curranh.8328
      @curranh.8328 5 років тому +1

      @@joshpeace2673 I haven't tried it myself, yet, its 3 AM 😂
      But you basically accomplished most of the legwork from what I can see, I greatly appreciate it! I'll come back for this soon, and I'll let you know when I do

  • @arzifactstudios2146
    @arzifactstudios2146 5 років тому +7

    Making it easy again Brackeys 🤪
    Next video mud on a tank driving?
    Thanks Brackeys!

    • @ashpats2
      @ashpats2 5 років тому

      Same as this, but take normal direction Vector3.down instead of up and change color from white to muddy

    • @pekame
      @pekame 5 років тому

      @@ashpats2 is not coding you don't have vector3.down and in this he uses normal vectors not vector 3

  • @sophiasun817
    @sophiasun817 5 років тому

    Oh my god. Thank you so much!!! It is so wonderful and useful!

  • @JohnWeland
    @JohnWeland 5 років тому

    It would be really neat to control the snow direction from wind direction over time. so on a map, if its snowing and the wind is coming from the north the snow builds up more on the north, likewise over time if the wind changes to coming from the east snow would pile up more on the east.

  • @MizoxNG
    @MizoxNG 5 років тому

    I made something similar to this in shaderforge at one point, but with more values, it chose between 3 different textures depending on the geometry normal, then set the texture coordinates based on the world space

  • @StaredownGames
    @StaredownGames 5 років тому

    this stuff blows my mind, lol It's why I subscribed in the first place. Good job Brackeys! Can you do a modern road tutorial? I can't figure it out.

  • @muncheybobo3772
    @muncheybobo3772 5 років тому

    Rain puddle shader next please. :)
    Loving the shader graph tutorials. Keep it up!

  • @brodakarat6340
    @brodakarat6340 3 роки тому +1

    10:30 how are all the materials changed without the base map resetting to the default?

  • @esben181
    @esben181 5 років тому

    I did not know that about the dot product, thanks

  • @walterwhite42068
    @walterwhite42068 5 років тому

    Just what i needed alongside your water tutorial and grass sway to create an awesome level.

  • @fardinmoqamzada2771
    @fardinmoqamzada2771 5 років тому

    thanks From you Great Services dear Absjorn

  • @okaybenji
    @okaybenji 5 років тому +1

    thanks so much for this and all your wonderful videos!
    would you please expand on this to add the *sparkle* you’d see in snow or sand in games like journey and uncharted? the sparkles appear in randomized positions based on the position and angle of the camera, which simulates the individual grains/snowflakes having random angles and catching the light from the sun as you move around.
    also, since snow adds some volume/puffiness, it would be nice to see how we could smoothen and expand the scale of the models slightly where the snow shows up!

  • @Vimerum
    @Vimerum 5 років тому +7

    LWRP is great, until you need two directional lights

    • @Lost1nTranslation
      @Lost1nTranslation 5 років тому

      Whats the issue? I haven't used it too much

    • @Vimerum
      @Vimerum 5 років тому +1

      @@Lost1nTranslation It only uses the directional light with the highest intensity, so you can't have two or more at the same time :(

    • @Lost1nTranslation
      @Lost1nTranslation 5 років тому

      @@Vimerum oh I see, is this a bug or intended? I'm new to Unity also so I don't know why two directional lights would be used either.

  • @BeardedCatDad
    @BeardedCatDad 5 років тому

    Great tutorial! I would love something similar but with wetness :)

  • @komamon5566
    @komamon5566 5 років тому +4

    Can you make a video about animation state behaviours?

    • @magnusm4
      @magnusm4 5 років тому

      I'd love a more detailed video on the animation and animator and ways to have it interact with scripts. Like executable code in Scriptable Objects and calling methods in the animation.
      Like for example a method being called right when the animation of a gun pulls back the hammer which reloads the gun, so no need to program in the time it takes for the animation to finish or based on it's length

  • @KimboKG14
    @KimboKG14 5 років тому

    you should add the normal map to the world space position before calculating the dot product.
    than the mold between the bricks would become snowy too

  • @gameexplorer4963
    @gameexplorer4963 5 років тому

    Very nice. It would be interesting to see this applied with a nice mask, to better define the borders.

  • @zentergames1622
    @zentergames1622 5 років тому +3

    Snow is easier with you, good video

  • @sudhanshlone8284
    @sudhanshlone8284 5 років тому +1

    Could you please make a tutorial on how to use a render pipeline and probuilder together

    • @CaseyHofland
      @CaseyHofland 5 років тому

      Did you upgrade all your project materials? (Under Edit > Render > Upgrade all project materials to HDRP / LWRP). That way ProBuilders default materials will change to be compatible with your new render pipeline (though I don't know what to do if writing your own RP.)
      Unfortunately, the 1m albedo maps aren't exported and the materials also don't support vector colors, though I guess if you really wanted you can modify it yourself. This should help you get started (though I can't validate its success.)
      answers.unity.com/questions/1516854/probuilder-default-material-with-lwrp.html
      When he says Material Editor, I think he means the Window from ProBuilder but not sure.
      Good luck!

    • @sudhanshlone8284
      @sudhanshlone8284 5 років тому

      Yeah

    • @sudhanshlone8284
      @sudhanshlone8284 5 років тому

      The object only shows the default color

    • @CaseyHofland
      @CaseyHofland 5 років тому

      That's what I mean, they don't have vector colors so they revert back to the default settings. Like the post specifies, you need to set your own default material that you can then shape and customize, like adding the albedo map. If you want to use the vector colors I'm afraid you will have to build your own shader that utilizes this, but you would have to know how ProBuilder applies it and I'm afraid I can't help you there.

  • @fecoramirez
    @fecoramirez 5 років тому

    Right on time ♥ Thank you guys.

  • @gigos2
    @gigos2 5 років тому

    AMAZING! YOU ARE SIMPLY AMAZING!

  • @Mantajochem
    @Mantajochem 5 років тому

    As always, great tutorial! Do you have any plans on a new Tutorial Series on how to create an Online Multiplayer Game (FPS) with Unity, since UNet is deprecated now? Would really like to see something like this! Thank you.

  • @nonyabiness4838
    @nonyabiness4838 5 років тому +2

    Quick question... Why would you use XML instead of JSON? JSON is smaller, faster, and I feel like it's easier to learn and write than XML. Genuine question.

    • @nochtans342
      @nochtans342 5 років тому +1

      It is pretty normal to use XML for UI. properties and children are written in different ways, creating more structure.

    • @nonyabiness4838
      @nonyabiness4838 5 років тому

      @@nochtans342 I suppose that's true. It's quite easy to differentiate between a property and a node in XML making use of xpath queries.
      hmm... Thanks for the response!

  • @Dante4F8
    @Dante4F8 5 років тому +3

    Is the Base Map suposed to get swapped automatically?
    I tried to do this with the base LWRP scene but I ended up needing to swap the map manually.

  • @DarkLightBoy
    @DarkLightBoy 5 років тому +2

    You have to blockthornprod Merch 😂

  • @davidmoll7250
    @davidmoll7250 5 років тому

    Short question: At 8:00 you show that we can change the Vector3-value to change the direction the snow comes from. If I make a snowstorm moving to a random position, could I change that value to the Vector3-value of my snowstorm so it always looks like my objects get covered from the right angle? How could I do that?

    • @vornamenachname5267
      @vornamenachname5267 5 років тому

      I think that would look weird, because the surfaces that were covered in snow would just become clear again.
      If you want to try it though, you would have to set the snow direction from a script according to the direction of your particle system. Just look up how to set shader values from a script.

    • @Sagaan42
      @Sagaan42 5 років тому

      David Moll you can access shader property values in script from the materials. (materials.setVector("nameOfProperty", value))

  • @YulRun
    @YulRun 5 років тому +1

    Does this automatically take the previous base map? or would you have to manually add them for every single texture?

  • @NinjatoBlade
    @NinjatoBlade 5 років тому

    I’m kinda confused how you created the template on one material but you can apply them to all? Does it override the base?
    Anyway, amazingly comprehensive video, thank you!

  • @pixboi
    @pixboi 5 років тому

    What about normal vectors that are under normal vectors? Eg. places that are covered with roofs, etc.

  • @pekame
    @pekame 5 років тому

    I think if you would add a bit of emission would give a nicer effect

  • @tranceemerson8325
    @tranceemerson8325 5 років тому +1

    that's nice.. how about stacking the snow up?

    • @miknios
      @miknios 5 років тому

      Take those dot products calculated in video and mess with displacement using them

  • @muteryu273
    @muteryu273 5 років тому +1

    I wonder if I could use this for rain puddles

  • @erikvas2558
    @erikvas2558 5 років тому

    Can we get a tutorial on IK animation sometime in the future? There are some tutorials for foot placement, but I need Brackeys quality tutorial for this ;)

  • @jojobee228
    @jojobee228 5 років тому

    Is it possible to add thickness for the snow? Add round dome shape some sorts by using shader graph?

  • @zachsimons9334
    @zachsimons9334 5 років тому

    I know this probably won't get seen but a tutorial on 3d grappling hooks/line renderers would be nice. There aren't many tutorials on those topics out there.

    • @sirstrik7402
      @sirstrik7402 5 років тому

      the hook is too apex for me but a line rendering tutorial would be awesome to learn for rope, electrical lines etc

  • @protivasarmah2873
    @protivasarmah2873 5 років тому +8

    Is he wearing blackthornprod designed line of code merch

  • @OdemGeek
    @OdemGeek 4 роки тому

    Thanks, i modified this to work also with normal map, for stones on walls)

  • @ScorgeRudess
    @ScorgeRudess 5 років тому +5

    This channel is not about game dev anymore. Is a shadergraph tutorial channel 😂

    • @djdomain
      @djdomain 5 років тому +2

      I like the shadergraph stuff, I think of it as the front-end for adding visual effects to make a game pretty, whereas the vids about game mechanics are back-end. Maybe make some suggestions on what you would like them to cover.

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

    Is this dynamic like will the snow still be on top if you rotate objects

  • @Feyhua
    @Feyhua 5 років тому

    recently i got to look at a game called the Last Night, any idea how to recreate the "2d in 3d effect"? It seems very liberating for pixel art games, and I wanna try playing around with it, but have no idea where to start.

  • @BrainSlugs83
    @BrainSlugs83 5 років тому

    Can you show us how to do an eyeball material with shader graph? Doesn't have to be super photo realistic, just a cool cartoon / anime eyeball effect.

  • @arthurdsjrjbr
    @arthurdsjrjbr 5 років тому +7

    Can you make a tutorial on Shader Graph high Grass/mud/dirt/snow that gets stomped/crushed/deepened when you step on it?

  • @benjaminfrank4597
    @benjaminfrank4597 5 років тому +2

    Can you make a video to falling snow?

    • @zentergames1622
      @zentergames1622 5 років тому

      You can use a particle system, or spawn snowballs in the sky

  • @danielbrazell
    @danielbrazell 5 років тому

    What about getting footsteps in the snow?

  • @allex3842
    @allex3842 5 років тому

    Awesome. Best unity channel out there.

  • @thedarkside0007
    @thedarkside0007 5 років тому +1

    what about dynamic snow ? leaving tracks of cars of footsteps in snow

    • @MichaelGGarry
      @MichaelGGarry 5 років тому +1

      That could be added on top of this, using something like decals or similar.

  • @marcospires8350
    @marcospires8350 5 років тому

    I'm very happy when I get a notification of your video

  • @ghostinteractive
    @ghostinteractive 5 років тому

    Can you please make a video on zoom / magnification shader with shader graph.. thanks in advance

  • @random_precision_software
    @random_precision_software 5 років тому +3

    Can modify it in a script?..so it get more snow over time

    • @LahceneBelbachir
      @LahceneBelbachir 5 років тому +3

      Yes just modify the Snow Opacity variable, like this: renderer.material.SetFloat("SnowOpacity", 0.5f);

  • @mohammadrezaheidari5944
    @mohammadrezaheidari5944 5 років тому

    This is better than GOT last season

  • @TubeGuy1
    @TubeGuy1 5 років тому

    pls if you can, It would be really awesome of you if you made a parallax shader or a tesllation shader. all the shaders that I have found are old and they dont work or the texture isn't posible to multiply or add other details. thank you for this videos they are pretty sweet and they help a lot of people.

  • @leogcavalli
    @leogcavalli 5 років тому

    3min he's talking about the vectors and all I can think is holy fuck what a motherfucking good content

  • @magnusm4
    @magnusm4 5 років тому

    With so many videos on the new lightweight pipeline which allows dumb non shader code gods like me to get great effects and visuals to my game.
    Can we do a video on another great visual feature regarding light, the light probes?
    It's a very interesting method of getting high quality light and reflection from other objects and the surroundings to get a baked light quality to moving objects instead of just static.
    The tutorials i've seen make it remind me of old school shooters like Blood where the light is cut diagonally and when you enter and leave it darkens or brightens you weapon and enemies the same way I see light probes work in these tutorials.

  • @dark_3253
    @dark_3253 5 років тому

    which is the best software for making video game unity or unreal engine beacause i am a beginner in developing game and i am new in your channel please tell me please

  • @kodsxtreme.1359
    @kodsxtreme.1359 5 років тому

    Can you try and make a tutorial on how to make a bounce pad
    Something that will launch you up to another platform, I need to find out how to bcs I can’t find it anywhere and I was making a platform game that had a block that boosts you in the air to another block
    When I type launchpad it does come up with the right thing

  • @TheRealLimerock
    @TheRealLimerock 5 років тому

    @Brackeys Adding vertex displacement on the snow might give some cool results... *pun intended* ;-)

  • @TheSpacecraftX
    @TheSpacecraftX 5 років тому

    This only works for scenes where they all use the same texture atlas though right?