Intro to Shader Coding in Unity - An Improvised Live Course

  Рет қаралды 164,404

Freya Holmér

Freya Holmér

4 жыл бұрын

🔽 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
@s81n
@s81n 3 жыл бұрын
Nooo! Why did I have to find this right before bed? Now I have to watch it...
@saeedbarari2207
@saeedbarari2207 3 жыл бұрын
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 😎
@MrTiras69
@MrTiras69 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
@@juliehelbecque4115 yeah, it's the Shaders for Game Devs series! it's on the home page of my channel
@supertenchoo4271
@supertenchoo4271 2 жыл бұрын
@@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 ...
@seltonmc
@seltonmc Жыл бұрын
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.
@RocketPunches
@RocketPunches 4 жыл бұрын
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.
@d_ds8147
@d_ds8147 4 жыл бұрын
Thank you!
@MrKiraBR
@MrKiraBR 3 жыл бұрын
Thaaanks!!!!
@ozancanacar8237
@ozancanacar8237 3 жыл бұрын
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.
@rendermangl
@rendermangl 4 жыл бұрын
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.
@suprecam9880
@suprecam9880 4 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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!
@yvickmiossec6536
@yvickmiossec6536 2 жыл бұрын
Thank you for this ! The visual approach, the clear explanations, the appeasing and calm delivery … you are an excellent tutor !
@TheAntloo
@TheAntloo 4 жыл бұрын
Amazing!! Thank you so much for this Freya, you rock!
@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.
@nekrosarts2906
@nekrosarts2906 4 жыл бұрын
Thank you for uploading. This is incredible helpful and the best course to find!
@zellator
@zellator 4 жыл бұрын
I LOVE your content Freya! Thank you so much for this! :))
@erikkimsey3242
@erikkimsey3242 3 жыл бұрын
Masterclass, indeed. Thank you, Freya!
@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.
@user-lz2oh9zz4y
@user-lz2oh9zz4y 4 жыл бұрын
KZfaq recomendations is worthy sometimes. Please keep doing this
@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.
@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.
@shermenz
@shermenz 4 жыл бұрын
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!
@galenmolk5253
@galenmolk5253 3 жыл бұрын
I'm so glad I found this video, thank you for this incredible information and teaching!
@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.
@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
@oguzcanoguz6583
@oguzcanoguz6583 3 жыл бұрын
Another underrated channel. Thank you for this!
@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
@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 :)
@NounourSOAD
@NounourSOAD 4 жыл бұрын
Thank you very much. This is an invaluable resource for jumping into shader dev.
@simplegamer6660
@simplegamer6660 3 жыл бұрын
I'm so glad I've found that. Great job!
@gwyn.
@gwyn. 2 жыл бұрын
Woah wtf have I stumbled upon??? This channel is a goldmine
@chenni8759
@chenni8759 2 жыл бұрын
Thank you so much this is really helpful and it's the most beautiful tutorial I've ever seen!
@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
@TropicalCyborg
@TropicalCyborg 3 жыл бұрын
Great tutorial! Loved every moment!
@cb2818
@cb2818 3 жыл бұрын
Freya I am a huge fan of your work coming from Twitter. Thank you for this video!
@publicalias8172
@publicalias8172 4 жыл бұрын
Thank you for 5 hours wow what a gem!
@MorganLock
@MorganLock 4 жыл бұрын
You are very good to explaining things. Thank you !
@AllanPichardo
@AllanPichardo 3 жыл бұрын
Fantastic! Thank you so much for this.
@mattlegge8538
@mattlegge8538 2 жыл бұрын
42:20 No, you're not getting too theoretical, getting this base level understanding is REALLY helpful.
@vitorhugoferreira9559
@vitorhugoferreira9559 4 жыл бұрын
OH MY GOD! THIS IS WHAT I NEEDED! LOVE UUUUUUUU THANKSSS
@moishirand5324
@moishirand5324 4 жыл бұрын
Amazing, thank you for this.
@user-vt8ry6cn7w
@user-vt8ry6cn7w 3 жыл бұрын
this was awesome!! my understanding of shaders really just went from nothing to can write one! tytyty^^
@giorgichubinidze3756
@giorgichubinidze3756 3 жыл бұрын
Thanks 🙏🏻 Im already obsessed with all of your work. Good luck with flowstorm I hope it becomes popular.
@kira7683
@kira7683 4 жыл бұрын
This is great, I wish I had found this sooner. Probably the longest video I ever watched in one go
@laislyra5512
@laislyra5512 3 жыл бұрын
It's crazy that you are giving us this course for free Thanks
@JonathanMelnik
@JonathanMelnik 3 жыл бұрын
Amazing! I learned a lot, thanks!
@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!😅
@sabanburaknazlm1381
@sabanburaknazlm1381 3 жыл бұрын
Really helpful video! Thank you very much for your great educational contents!!! :D
@brlrblrb
@brlrblrb 4 жыл бұрын
Thank you for that! I'm sure you helped half of my class
@murrischcat9098
@murrischcat9098 3 жыл бұрын
Thanks so much for this great video! Really helps so much!
@MrFilming
@MrFilming 4 жыл бұрын
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
@INeatFreak
@INeatFreak 4 жыл бұрын
Same
@ivandavidtovarsiso8264
@ivandavidtovarsiso8264 4 жыл бұрын
Same, I was like OMG I'm so going to fail my exams
@Unrealaernu
@Unrealaernu 4 жыл бұрын
Yup, they coulda said that's what they were doing lol
@chrisaynewfarm5860
@chrisaynewfarm5860 4 жыл бұрын
Thanks for this tutorial. I might actually use this to get into shader coding.
@soulsteppe4358
@soulsteppe4358 4 жыл бұрын
Just amazing! Love it! ;)
@jasonwilliams8730
@jasonwilliams8730 3 жыл бұрын
Epic video thanks for posting
@svedjenaeva
@svedjenaeva 4 жыл бұрын
Wow, awesome with a long comprehensive intro tutorial!
@Cambesa
@Cambesa 3 жыл бұрын
Thanks for the great course!
@trissylegs
@trissylegs 4 жыл бұрын
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"
@RokyBanana
@RokyBanana 4 жыл бұрын
Great stuff! Didn’t expect to sit through 5 hours of shader.
@zak9399
@zak9399 4 жыл бұрын
I see you aren't a member of the 1.25 x speed gang
@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!
@CG_CAKE
@CG_CAKE 2 жыл бұрын
Thanks Freya Great video :D
@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.
@swishchee
@swishchee 2 жыл бұрын
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.
@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.
@akirawashere
@akirawashere 4 жыл бұрын
You're such a great teacher!
@Myrdov
@Myrdov 4 жыл бұрын
Wow, 5hs!! Thank you!
@XxLocodragonxX
@XxLocodragonxX 3 жыл бұрын
Love your channel, gonna watch this all tomorrow. Quick question, how did you get into shader programming?
@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?
@TwelveMieles
@TwelveMieles 4 жыл бұрын
hey keep doing this Acegikmo the community is starting to use shader code even more
@adrianshawuk
@adrianshawuk 3 жыл бұрын
Very good, great presentation too. Subscribed 🙂
@JustBitsAndPieces
@JustBitsAndPieces 4 жыл бұрын
wow just wow , more pls!
@flyegg7212
@flyegg7212 3 жыл бұрын
yes!master class.thanks
@seyedmortezakamali2597
@seyedmortezakamali2597 4 жыл бұрын
good tutorial you're my favorite developer
@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.
@MrKiraBR
@MrKiraBR 3 жыл бұрын
Awesome, thanks!!!!!
@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
@sat.chid.ananda
@sat.chid.ananda 4 жыл бұрын
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
@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?
@hesamsehat9
@hesamsehat9 4 жыл бұрын
you are very kind and this clip is very very useful. goooood joooob
@SajithGame
@SajithGame 4 жыл бұрын
Quality Content 100%
@robojackmu
@robojackmu 3 жыл бұрын
awesome!!!
@HaykAmirbekyanTKD
@HaykAmirbekyanTKD 4 жыл бұрын
Thanks Freya, I have a question. When altering the vertices of a mesh in a vertex shader, can we also update the collisoin data of the mesh to match?
@acegikmo
@acegikmo 4 жыл бұрын
unfortunately all collision data is on the CPU and can't be altered directly by the GPU
@frankverheyen344
@frankverheyen344 4 жыл бұрын
very nice!!
@jaycelee8453
@jaycelee8453 2 жыл бұрын
my visual studio would not color those reserved keywords such as normalize, max, UnityToClip... did i miss something?? thx
@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 :)
@saad_jumani
@saad_jumani 3 жыл бұрын
2:13:00 after adding the _WorldSpaceLightPos0 it gets the direction and shades accordingly. But it only works if rotation of object is 000. When you rotate the object, the lighting rotates with it even though light direction hasn't changed. How to resolve that?
@officialnickname
@officialnickname 2 жыл бұрын
Your videos are awesome, but I simply haven't had the time to finish any of them. They are soooo long!
@jaimehuesa5533
@jaimehuesa5533 3 жыл бұрын
Hello, can anyone explain me how to setup visual studio 2019 to code unity shaders?. The autocomplete feature, hightlight syntax and others doesnt work. Thanks.
@lkledu2
@lkledu2 4 жыл бұрын
Pixel shader are the same of fragment shader, the name changes if you use hlsl (directX) or OpenGL
@joanamota3403
@joanamota3403 3 жыл бұрын
How can I create something like you did at the end of the video, the fluid?
@bradstapleton8944
@bradstapleton8944 4 жыл бұрын
Excellent! I'd love to see a video on blending.
@DutchDinosaur
@DutchDinosaur 3 жыл бұрын
I dont know if anyone encountered this issue but when I rotated the objects with my shader the lighting rotated with it in a super weird way. After some thinking I figured its because all the lighting calculations are dependent on the normal directions witch come directly from the mesh and dont take object rotation into account. I managed to fix it by transforming the normal to world space in the vertex shader by replacing: o.normal = v.normal; by: o.normal = UnityObjectToWorldNormal(v.normal); hope this helps anyone,, took me a while to figure out
@Chamhyul97
@Chamhyul97 3 жыл бұрын
i was wondering why my sphere is doesn't have black when i just add ambient light & diffuse light, but I found out my light color isn't whitish enough and opposite side of fake light become black as soon as i made light color more white.
@SlayerDUDE1993
@SlayerDUDE1993 4 жыл бұрын
You're a goddess. Thank you!
@Sparclen
@Sparclen 3 жыл бұрын
How can a man be a goddess dude?
@kemaruproduction
@kemaruproduction 3 жыл бұрын
Freya is so elegant.
@AdredenGaming
@AdredenGaming 4 жыл бұрын
I think this is going to be useful :)
@Gmododo
@Gmododo 3 жыл бұрын
hope it's not too late to ask something. How did you set autocomplete with shader programming? basically intellisense/intellicode, and background compilation too! I can't figure out how to do it
@acegikmo
@acegikmo 3 жыл бұрын
I don't remember! rider is really good at this, visual studio can sometimes work too
@Dippps
@Dippps 3 жыл бұрын
You doing very interesting stuff
@vegitoblue2187
@vegitoblue2187 3 жыл бұрын
any guidance on making these shaders work on URP?
@pedroferreira5385
@pedroferreira5385 3 жыл бұрын
Did you post the code somewhere? It would help me a lot! Thanx for the tutorial! It was amazing!!
@GuillemPoy
@GuillemPoy 4 жыл бұрын
You are the best
@skinnyboystudios9722
@skinnyboystudios9722 3 жыл бұрын
Damn, this is gold mine. If you had udemy course I would buy all your courses.
Shader Basics, Blending & Textures • Shaders for Game Devs [Part 1]
3:53:11
Indian sharing by Secret Vlog #shorts
00:13
Secret Vlog
Рет қаралды 58 МЛН
ELE QUEBROU A TAÇA DE FUTEBOL
00:45
Matheus Kriwat
Рет қаралды 28 МЛН
How To Build An Event System in Unity
8:01
Game Dev Guide
Рет қаралды 405 М.
Getting Started with Compute Shaders in Unity
14:03
Game Dev Guide
Рет қаралды 191 М.
Outline Post Process in Unity Shader Graph (URP)
8:24
Daniel Ilett
Рет қаралды 37 М.
7 Examples Proving Shaders are Amazing
8:09
DesignCourse
Рет қаралды 31 М.
Coding Adventure: Compute Shaders
5:25
Sebastian Lague
Рет қаралды 778 М.
The Beauty of Bézier Curves
24:26
Freya Holmér
Рет қаралды 1,9 МЛН
Lerp smoothing is broken
57:19
Freya Holmér
Рет қаралды 95 М.
Unity in 100 Seconds
2:45
Fireship
Рет қаралды 1,1 МЛН
Introduction to Godot Shaders - Godot 4 Tutorial
6:08
Abra
Рет қаралды 35 М.
How charged your battery?
0:14
V.A. show / Магика
Рет қаралды 3,3 МЛН
What model of phone do you have?
0:16
Hassyl Joon
Рет қаралды 72 М.
Xiaomi Note 13 Pro по безумной цене в России
0:43
Простые Технологии
Рет қаралды 2 МЛН