Intro to Shader Coding in Unity - An Improvised Live Course

Поділитися
Вставка
  • Опубліковано 7 сер 2019
  • 🔽 Click for Timestamps & Info
    This is a several hours long improvised live introductory course to shader coding in Unity! It has been slightly edited in the beginning to remove useless info and me messing around with the mic. The rest is the stream in its fullest!
    Timestamps available below!
    💖 Patreon ❱ / acegikmo
    🐦 Twitter ❱ / freyaholmer
    📺 Twitch ❱ / acegikmo
    💬 Discord ❱ / discord
    🌸 Instagram ❱ / freya_holmer
    2:00 - Pre-stream chatting
    Part 1: The Basics
    28:53 - Shader vs Material
    35:27 - Anatomy of Shaders
    58:32 - Shader Code
    1:09:20 - UV Coordinates
    1:34:00 - Normals
    Part 2: Diffuse Lighting
    1:48:05 - Lambert Shading & Dot Product
    2:15:05 - Tonemapping & HDR
    2:21:33 - Properties & Surface Color
    Part 3: Specular Lighting
    2:30:30 - View Vector & World Position
    2:48:38 - Phong BRDF & View Reflection
    3:00:58 - Gloss & Interpolators
    Part 4: Manipulating Values
    3:26:36 - Cel Shading & Thresholding
    3:31:40 - Lerp, Inverse Lerp & Posterization
    3:55:13 - Passing Data to Shaders
    4:07:30 - Waves & Time
    Part 5: Showcase
    4:31:29 - Water in Garden of the Sea
    4:37:03 - SDF Raytracing in Garden of the Sea
    4:41:53 - SDF Raytracing of a Fractal
    4:48:40 - Flowstorm Gameplay
    4:50:24 - Flowstorm Level Editor
  • Наука та технологія

КОМЕНТАРІ • 222

  • @scottnelson1068
    @scottnelson1068 3 роки тому +65

    Nooo! Why did I have to find this right before bed? Now I have to watch it...

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

      Exactly me rn XD

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

      Neat, I'm not the only one

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

      @@game_developer_ He's been taking a dirt nap for 2000 years.

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

      Same but I am downloading video 😎

  • @RocketPunches
    @RocketPunches 4 роки тому +75

    For those coming to this on February 9, 2020 or later:
    _LightColor0 is declared in UnityLightingCommon.cginc instead of Lighting.cginc
    Also I started this in a shader fiddling sandbox project that's an HDRP project. Clearly it needs some other input in the shader to take lighting from _LightColor0, as that did nothing to the objects the shader was applied to in that project, but worked in LWRP and basic 3D projects exactly as intended. Just something to keep in mind. It produced flat lighting in HDRP but functioned as intended in the others. Too much of a noob to resolve that.

  • @seltonmc
    @seltonmc Рік тому +7

    Big respect for teaching something for 5 hours straight without any proper break. I'm surprised, that I watched this whole video. Thanks for doing this! It really helped me.

  • @MrTiras69
    @MrTiras69 4 роки тому +192

    This is the most complete "intro" I ever seen ! Coming from the creator of shaderforge it doesn't surprise me, it's amazing. I LOVE IT, I WANT MORE QUALITY CONTENT for the game dev community :D

    • @acegikmo
      @acegikmo  3 роки тому +16

      Now, a year later, I'll be teaching a new course on Shaders next week, and it will all be live on twitch!
      Jan 4th/7th/8th 9:00 CET at twitch.tv/acegikmo
      Feel free to come join! 💗

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

      @@acegikmo is it available on your youtube channel ?

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

      @@juliehelbecque4115 yeah, it's the Shaders for Game Devs series! it's on the home page of my channel

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

      @@acegikmo If I want to start to learn shaders suppose soon I will be or am Intermediate Unity dev just coding C#, should I start with this or the other one am

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

      I realy hope you release an advance shader course some day . Im dying for these courses you are the best teacher ...

  • @rendermangl
    @rendermangl 4 роки тому +19

    I love this video a lot.
    Thank you so so so much for this Freya !
    I am not even joking. This was genuinely a master class.

  • @ozancanacar8237
    @ozancanacar8237 3 роки тому +19

    This has been the most educative 5 hours of my life! Thank you so much, there are so little content about shaders on the net. Please we need more tutorials. Your teaching skills are amazing.

  • @suprecam9880
    @suprecam9880 4 роки тому +8

    Thank you .. SO freaking much! This is *so* thoughtful and hardworking.. I can't imagine how much time was put into making this video a reality, so again thank you Freya! This will help me immensely.

  • @ThefamousMrcroissant
    @ThefamousMrcroissant 3 роки тому +7

    This is a course of unprecedented quality for youtube. Extremely well done: well spoken, good demonstrations, good structuring. Not very fond of Patreon personally, but I'd definitely donate for publishing this. Excellent work. People like you make the world a better place.

  • @ptsg
    @ptsg 3 роки тому +3

    Just wanted to say that the beginning bit alone (with progress, subject and timestamps) is an incredible feature of the video that gives an amazing view on what the tutorial is about, what will be discussed, etc.
    Kudos!

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

    This is exactly what I was looking for! Thank you Freya for the work!

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

    Amazing!! Thank you so much for this Freya, you rock!

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

    This is the best stream tutorial i've ever found.
    It's hard to catch someone's attention, but not only showing an intro of each part and what you go through but also time stamp it is great for everyone.
    Wish I could've seen the stream when it came. Hope you reach over 100k viewers soon. You deserve it for the best complete tutorial on shading.
    This is everything i've wanted to learn in Unity shading through coding and can't wait to make practical examples of this.

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

    Thank you for this ! The visual approach, the clear explanations, the appeasing and calm delivery … you are an excellent tutor !

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

    Thank you for uploading. This is incredible helpful and the best course to find!

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

    I LOVE your content Freya! Thank you so much for this! :))

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

    This is probably the best explanation of shaders I'll ever see, thank you very much. I'll be keeping an eye on when you stream so I can catch more game dev knowledge.

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

    Thanks you. I always wanted to understand how shaders work and I really learned so much and had a lot of fun following along. Can't wait for the next one.

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

    This has to be the best class on shaders I've ever seen. THANK YOU so much for this Freya. I promise to donate as soon as my financial situation gets better. Content like yours is invaluable.

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

    Thanks so much for posting this. I have seen it before in my feed and avoided it because of the length, but now that I got around to watching it, I am actually learning what I want to know about shaders.

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

    Thank you @ Freya Holmér This was fantastic, I LOVE your content, and it's exactly what I needed now that I start working as a tech artist, you're a godsend!

  • @user-lz2oh9zz4y
    @user-lz2oh9zz4y 4 роки тому +4

    UA-cam recomendations is worthy sometimes. Please keep doing this

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

    Masterclass, indeed. Thank you, Freya!

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

    I'm so glad I found this video, thank you for this incredible information and teaching!

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

    Finally a good intro to shaders ! I've been trying to learn how to write one for a few days but couldn't understand the documentation because I didn't have the basics. Thanks for the help :)

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

    Freya I am a huge fan of your work coming from Twitter. Thank you for this video!

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

    Another underrated channel. Thank you for this!

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

    This has been unbelievably helpful to me, shaders seemed so unapproachable but after watching your video and following along it suddenly seems super easy.
    Just framing shaders as data manipulators in my head was all I needed to get started

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

    I've started to watch this video and I'm half way through now. Thanks to you, I understand shaders so much more and I actually get what you are doing. Part of my Bachelor's thesis is about writing an own shader and I had no idea how this worked. Now I think I actually got a chance haha

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

    Thank you so much this is really helpful and it's the most beautiful tutorial I've ever seen!

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

    I'm so glad I've found that. Great job!

  • @gwyn.
    @gwyn. 2 роки тому +2

    Woah wtf have I stumbled upon???
    This channel is a goldmine

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

    I watched the "Writing Your First Shader in Unity" tutorial made by Unity themselves. But I should've started with your video. Very well explained! thanks

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

    OH MY GOD! THIS IS WHAT I NEEDED! LOVE UUUUUUUU THANKSSS

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

    Thank you for 5 hours wow what a gem!

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

    Great tutorial! Loved every moment!

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

    Thanks 🙏🏻 Im already obsessed with all of your work. Good luck with flowstorm I hope it becomes popular.

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

    Thank you very much for this video. I just was looking for some stuff about shaders, and I'm here. New sub for you!😅

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

    Amazing, thank you for this.

  • @laislyra5512
    @laislyra5512 3 роки тому +4

    It's crazy that you are giving us this course for free
    Thanks

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

    Thank you very much. This is an invaluable resource for jumping into shader dev.

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

    This is great, I wish I had found this sooner. Probably the longest video I ever watched in one go

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

    Thank you for that! I'm sure you helped half of my class

  • @user-vt8ry6cn7w
    @user-vt8ry6cn7w 3 роки тому

    this was awesome!! my understanding of shaders really just went from nothing to can write one! tytyty^^

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

    Fantastic! Thank you so much for this.

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

    Just amazing! Love it! ;)

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

    Amazing! I learned a lot, thanks!

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

    Thanks so much for this great video!
    Really helps so much!

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

    Wow, awesome with a long comprehensive intro tutorial!

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

    Thanks for this tutorial. I might actually use this to get into shader coding.

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

    Wow, 5hs!! Thank you!

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

    42:20 No, you're not getting too theoretical, getting this base level understanding is REALLY helpful.

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

    Thanks for the great course!

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

    You are very good to explaining things. Thank you !

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

    MOOOM! I found a treasure!!! here this channel! I always was looking for a good shader mentor with good explanation, I think I found her, Thank you!

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

    Really helpful video! Thank you very much for your great educational contents!!! :D

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

    Epic video thanks for posting

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

    good tutorial
    you're my favorite developer

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

    You're such a great teacher!

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

    Great stuff! Didn’t expect to sit through 5 hours of shader.

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

      I see you aren't a member of the 1.25 x speed gang

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

    wow just wow , more pls!

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

    hey keep doing this Acegikmo the community is starting to use shader code even more

  • @MrFilming
    @MrFilming 4 роки тому +71

    at first I thought it's too fast for me to understand until I understood that it's just a small overview of the stream

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

    Very good, great presentation too. Subscribed 🙂

  • @V.Z.69
    @V.Z.69 3 роки тому

    I'm 2 minutes in and mesmerized how much you know... I'm so late to Unity... Stayed super bummed out of Flash for toooooo long. Trying to get back into the game.

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

    Thank you for that explaination on Materials. I know shaders, (from OpenGL 3.x/Vulkan), I just didn't quite understand what the material was other than "thing you drag 'n drop the shader to"

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

    yes!master class.thanks

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

    you are very kind and this clip is very very useful.
    goooood joooob

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

    Thanks Freya Great video :D

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

    Quality Content 100%

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

    Excellent! I'd love to see a video on blending.

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

    Wow, this is an awesome video. I learnt so many things, thank you very much for sharing so much. Is the flowstorm released?

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

    Love your channel, gonna watch this all tomorrow. Quick question, how did you get into shader programming?

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

    Your videos are awesome, but I simply haven't had the time to finish any of them. They are soooo long!

  • @sat.chid.ananda
    @sat.chid.ananda 4 роки тому +8

    gonna make some popcorn before watching this one

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

      Will need tons of popcorn and cola in proportion 1:2 for this one

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

    Awesome, thanks!!!!!

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

    When doing linstep between two "elevations" as a bumpmap, you get a linear constant normal between them - in normal map terms it would be a constant color. Using smoothstep (I prefer smootherstep for this) you get a constant change in curvature giving a much better bump effect, allowing specular highlights to be captured much nicer - in normal map terms it would be a gradient of colors. I'm not into game developing or Unity though, but I find the thinking interesting from a Blender shader authoring standpoint. I need to learn more about vector calculations and manipulations, even if light information is not available to us there.
    Edit: Oh, and that game takes me way back to Space Taxi (C64) and Gravity Force (Amiga). Easter egg gameplay opportunity right there, lol :)

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

    very nice!!

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

    awesome!!!

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

    1:28:10 at around that time when you were experimenting with the shader, you should divide the xyz coordinates by a number for example 100, do this since the xyz coordinates can be easily over but the colour is only between 0 and 1, if you divide by a number that will reduce numbers to between 0 and 1 for small values of xyz

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

    Hello, What extensions are you using for visual studio to have the proper (or even partial) syntax highlighting and autocomplete? Your lessons have been fantastic. I've been using them along with the art of code and inigo quilez for SDF's. I've just been going through all of the catlike code tutorials as a starter and switching to these lessons as well. However, doing it without the highlighting and autocomplete has definitely been a challenge.

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

    I think this is going to be useful :)

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

    Hiya, great video! How did you get syntax highlighting within the shader? I tried "Shader Unity Support" but it didn't seem to perform syntax highlighting.

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

    You're a goddess. Thank you!

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

      How can a man be a goddess dude?

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

    53:50 According to the OpenGL pipeline page, the Geometry Shader & Tessellation actually come after the Vertex Shader :
    www.khronos.org/opengl/wiki/Rendering_Pipeline_Overview

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

    Damn, this is gold mine. If you had udemy course I would buy all your courses.

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

    You are the best

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

    Nice!
    Is there a possibility to get automatic subtitles ? As a non-native english speaker this is something useful.
    Keep it up !

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

    Thank you so much for doing this T_T I've been running into walls with shaders for 5 years and now I can almost feel my mind expanding in a span of hours! YOU'RE AWESOME!
    Edit: Would it be possible to do a session for 2D shaders? I'm trying to apply techniques from this lesson but it seems like the Sprite Renderer has very different requirements.

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

    what can i say......just......thank you so much!!!

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

    You doing very interesting stuff

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

    creamed my pants when i saw the course overview, the content of this course is beyond good!

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

    Did you post the code somewhere? It would help me a lot!
    Thanx for the tutorial! It was amazing!!

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

    Pixel shader are the same of fragment shader, the name changes if you use hlsl (directX) or OpenGL

  • @Zicore47
    @Zicore47 3 роки тому +16

    59:38 aaaaand I'm out.
    Just kidding, great tutorial!

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

    Thanks for this Freya!
    Unity is now pushing the URP a lot. Does this mean that we need to only use Shader Graph to benefit for the URP improvements or do we still have better performance when coding our own shaders?
    It sounds counter-intuitive to me that they are asking everybody to just use Shader Graph.

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

    when you show your game at the end and you say: its very very basic... hahaha. Thanks for the video!

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

    Is there gonna be a 2nd part? This is so awesome!

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

      Maaaybe! I did do a part 2, but it wasn't as productive and informative. Although I do shaders almost every time I stream, and I'm always open for questions and showing stuff :)

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

    Hi Freya, this is amazing thank-you! Would you be able to show the example at 3:55:00 of how to make another object reflect on another. or even give idea of how i would get there in writing here?
    when a player moves past another player i want them to cast a shadow on the other.
    Hope all is well where you are, allo from sunny Belfast. I kid we have 26mph winds today! :D
    Cathy

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

      usually that's very complicated unfortunately! you often rely on pipeline support for things like raymarched screen space reflections to have dynamic objects show up, or baked reflection probes for static objects
      for things like dynamic shadows, it's also a pipeline thing rather than on individual objects, though there are some helpers in Unity that gets you there faster

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

    Great video!
    But i dont understand where to find materials about implementing principles of lightning, mesh forms changing(4:37), can someone recommend books/resources to do this?

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

    Freya is so elegant.