Shader Basics, Blending & Textures • Shaders for Game Devs [Part 1]
Welcome to my three part lecture on shader coding for game devs 💖 I hope you'll find this useful in your game dev journey!
If you are enjoying this series, please consider supporting me on Patreon!
🧡 / acegikmo
00:00:00 - What are shaders?
00:03:00 - Case study/screenshots from FFXIV, Overwatch & more
00:37:42 - The Structure of a Shader
00:42:49 - Vertex shader
00:47:09 - Fragment shader
00:49:32 - Shader vs Material
00:51:29 - A first look at shader code
01:02:17 - Vertex Normals
01:06:17 - Interpolators
01:15:59 - Data types (fixed vs half vs float)
01:21:32 - Fragment shader output
01:24:31 - Swizzling
01:33:48 - Passing data from vertex shader to fragment shader
01:42:04 - Space transformation w. Matrices
01:47:07 - UV coordinates & manipulation
01:53:34 - Gradients
02:01:06 - Values outside of 0 to 1
02:09:20 - Triangle waves using math
02:12:04 - Preprocessor constants
02:25:28 - Pattern manipulation
02:31:48 - Blending Modes
02:39:42 - Depth buffer & depth testing (ZTest)
02:56:40 - Waves, ripples & vertex offsetting
03:12:07 - Textures
03:20:33 - World space coordinates
03:28:04 - Texture masking
03:37:33 - Isotropic mip maps
03:42:17 - Anisotropic mip maps
03:44:36 - Point vs bilinear vs trilinear filtering
03:49:54 - Final questions
Project Download & Assignments: docs.google.com/document/d/1h...
Originally streamed as a course for students at futuregames.se/, who were super kind to let me both stream this live as well as upload it here! so massive thanks to the people at FutureGames!!
💖 Patreon ❱ / acegikmo
🐦 Twitter ❱ / freyaholmer
📺 Twitch ❱ / acegikmo
💬 Discord ❱ / discord
🌸 Instagram ❱ / freya_holmer
✫ Video Production by Higher Vision:
➥ / highervision1
➤ Edited by Stelly: / stelly47050876
Who else woke up to this?
Um… me…
Me:/
No way me too!
😮😮
Me… Do you have any idea why?
This is the most epic "developer" content ever. The style of delivery is only possible for those who live and breathe their material. Freya knows her stuff, and how to teach. Emphasizing what matters. Integrating feedback and questions, while willing to say no, to honor your course intentions. I always learn new details, and deeper understanding of the things I thought I knew. Thank You!
Absolutely
I completely agree With You, Mr. Matt!🤍
god level tutorial
YUy b😮
This > College courses I’ve taken. Freya is awesome; also THANK YOU for editing these down from the original stream, this is utterly invaluable stuff.
Everything I ever wanted to know about shader is condensed here. You somehow managed to transform an aspect of game dev that seemed scary and shaddy at first into something actually fun and pretty simple :)) Thank you so much!
Shady lol
Shaders aren't shady
@@Corn0nTheCobb they're scary tho when you don't know a single thing about it.
shaders shady lmao
😊😊😊😊 U
Just canceled my University application. Got all the info I need right here.
Haha having finished college I should have done that
I'm in first year for software engineering wanting to be a game developer and I may have made a mistake... XD
I took two semesters of computer graphics at college. While this series is nice it doesn't even cover what we went through in a single week of the course. The professor was a fluid physicist who had worked on computer graphics since the 80s. Needless to say he understood the deep inner workings of OpenGL and Vulkan. This video is alright if all you ever intend to do is write basic shaders in Unity. If you want to seriously be considered for a career in the game industry it's better you take an accredited college course. Shaders can be extremely powerful if you know what you're doing, in fact the entirety of Minecraft is generated inside a geometry shader, which I guess if you don't know what that is by watching this video then I guess that proves my point.
hahahaha :D well I am still confused should i pursue masters degree or learn on my own 🤷♀️
@@nadaelnokaly4950 Good luck getting a job with "I learned on my own" on your resume.
Heres a fact: you woke up from a deep sleep and this was playing
I know I’m late to the party but I just wanted to let you know that everything about this video is perfect. My university graphics class didn’t give us any hands-on experience with shaders and this totally filled the gap. Your pacing, explanations and visualizations were on point. Thank you so much for making this!!
- I don't have the words to express my gratitude for sharing such a detailed course for free. The university i'm studying to be a game developer at, which charges $1,500 a year, didn't even teach me the basics like C# interfaces and importing assets into Unity, let alone shaders. As a non-native english speaker i had no problems undertanding you, nor was i bored - I am insanely happy i've stumbled upon your channel and this video specifically. Perhaps my career will be built through you and what you do. Thank you in advance :)
Sorry to say this, but if you are paying 1.5k a year and they don't even teach you how to use your engine or the language, you are wasting your money. I would look into a different university and perhaps a different major. Just getting a pure CS degree will make sure you have the fundamentals you need for gamedev. Before you learn shaders it's infinitely more important to have your fundamentals down.
⚠⚠⚠ATTENTION⚠⚠⚠ : do NOT change the input names of the vert and frag functions, let v be v, let o be o, let i be i, because in a later episode, one of the Unity Macros will rely on the single letter names, for example : [PART3] light Attenuation : Unity will expect you to have "v" as your meshdata / appdata, if you rename your mesh data as something else, Unity will say "Undeclared identifier 'v'" and because of this, I have been depressed for the last 48 hours (not exaggerated)
Never change the syntax even if someone who teaches you does it. why make your code harder to read when you can use the same naming everywhere? Use the standards
Also read and learn from the error message. It’s always a hint.
48 hours? Thats all ... I have been depressed for 5 years trying to learn shaders ...
As a newcomer I must admit that I was at first put off by the length of the video, and wondered why she wouldn't just cut it into parts and upload them individually. But when I did start watching, I got completely hooked. I don't know what kind of wizardry this is but the content just flows so incredibly smoothly and naturally that cutting the video into parts would ruin it. Watching great videos like this makes me want to quit my daily job to have virtually unlimited uninterrupted time so I could watch them anytime I want and focus on making a game myself.
Jump on the NFT millionaire art creation to have the time to do what you want.
@@redone823 This comment aged like a finely spoiled milk
@@petlemons I've been craving milk yogurt since I got home from work.
@@redone823 hopefully not 3 year old yogurt!
I've been watching this sporadically through the week. I've never understood the fundamentals so well before! Excellent explanations.
I've read the documentation, books, and other videos BUT this is the first time shaders have made any sense. Thank you!
Just found this in my recommended feed and did NOT expect this much depth and detail. Earned my sub
This was truly amazing. I learned so much, even after reading all of the docs I could find on Unity shaders
I fell asleep and the last thing I watch was this 💀
What an amazing resource. Just recently I had started learning shaders from your previous video on the topic so it's a godsend that just now you're starting an in depth shader series. Thank you so much!
i love how questions get answered so nicely like someone asks a thing and freya doesn't just go "oh it's that" but really explains it like "oh it's that, it's used here and there, it's this type of thing, etc." very epic
Thank you so much for this! I have been dealing with anxiety for few weeks and everytime I feel super stress or a panic attack is on the line, I just watch your streams and it so relaxing and full of knowledges! 💆♂️ Thanks a lot :D
You're amazing Freya! This is incredible, thanks for taking the time for explaining everything in such great detail! Btw, I love the many tangents you go on when explaining things. You always seem to bring up something interesting I didn't know before.
I can't even begin to explain how thankful I am for this! Thank you so much
I've been looking for sources to educate myself on this subject for weeks, and this is EXACTLY what I was looking for. Thank you so much!!!!
You know it’s a good video when every comment is a paragraph long
I love how she makes everything so easy to understand. Freya is awesome ❤🥰
@@goyimshekelstein4826 What? I don't really see the point of your comment...
@@mason4163 What do you mean? She looks very real to me?
You're so skilled at distilling information on the fly, organized into a logical flow appropriate for listeners who may not be familiar with the subject, explaining jargon as you go rather than assuming everyone knows it, etc. That's an extremely valuable set of abilities! Thank you for taking the effort to create this content and share it!!
This absultly the longest video I ever watched start to finish on the same day. Great and to the point.
This video is rich with knowledge. It was very interesting to see how you analyzed the popular games to figure out how they might have built the effects using different elements. Total awesomeness!
This is what every Game Dev channel should strive to be. Unadulterated well-communicated actually useful information. You are appreciated.
So awesome to get such a complete lecture for free on the web 🤯 Thank you so much for the great work!
The way you teach and communicate information is outstanding. I've seen so many "professionals" and tutorials fail at that first hurdle. Super nice voice, very in depth and easy to understand and very thorough. I loved it
I've watched this video through twice and I still refer back to it to refresh myself. An absolutely perfect intro to shaders!
I watched through the entire 4 hours, typed out + ran all the shaders in Unity, and learned SO much. Excited to dig into the exercise! Thanks a bunch for everything, Freya! This course will be invaluable for many shader beginners to come.
I plan to do this, and this comment makes me even more excited for it. On my first watchthrough rn, but will eventually as I work on my game engine. I'm already learning so much!!!
You explain things very well! What most people miss out when making videos about subjects is they explain topics and then jump to another topic right after. You bring up a topic, give examples, explain it, reiterate what it is with references to real world items, THEN move on. Well done!
I realized this when I was watching a (live) presentation a few months back. The presenter would start talking about a process and half way through, I'd realize "oh, this is really useful, what did she say this was called?" And then she would move on to the next thing @__@
This was the only tutorial on writing shaders that made sense to me. Thank you.
Your content and tutorials are unbelievably comprehensive and complete! You have veryyyyyyy deep understanding of what you teach and you teach them very well that everybody at every level can be beneficial from that. No one is comparable to you! There is no such good content all over the Internet as the ones you share! Thank you so much!
Just finished watching and thank you so much Freya for the content you're making. It was quite easy for me to understand many of esoteric (at first) concepts with your explanations!
Freya you're a godsend... you teach all this technical stuff with such intelligence and grace, it makes learning all of it so easy and intriguing! not to mention your gentle approach is super comforting. Thank you, I'm looking forward to learning a ton from your videos
I've been trying to understand shaders for years and it finally clicked for me after watching this video. Fantastic job!
This has been the absolute best source for learning Unity shaders. Thanks for explaining this all so well. The blackboard style drawings are great too, especially when trying to visualize vectors and dot products. Keep being awesome 🤘🤘
just finished this video, recently started learning about shaders and this video is so complete, direct, and efficient. Thank you so much for sharing!
I've been deconstructing and recreating certain FFXIV effects into After Effects as a hobby, and I find a lot of the initial explanation with the FFXIV examples extremely helpful! Thank you!
You have an amazing ability to communicate complex content. Thank you so much for these Freya, they have helped me fill all the gaps that I had after going through numerous texts!
Girl, your way to explain things is great! I watched just 2h of this video and I'm not annoyed, i don't even need a break.
I hope you'll find this useful - 12 mins in and I never thought twice about subbing on patreon. You're doing amazing work!
Thank you so much, I work as gamedev profesionally, but I've always had a problem with shaders. Your style, clear explanations made me not fear about writing and understanding shaders - all the best!
This is absolutely fascinating - so many things I have come up against while working on games make so much more sense now! I wish I had watched this video a year ago. Thank you Freya
Tried Finding Content like this for a long time ! amazing video, thank you so much for sharing this with us ! you just gave some more hope to keep going and be a game dev, much love from Algeria
You are very good at explaining things very well. Not just by showing stuff on screen but also by speaking about some of the matter or theory behind it. That's a gift. Thanks for making these video's.
I cant believe this is actually for everyone! Thank you so much for sharing your knowledge in a smooth way!
I am halfway through and this is _exactly_ the information, presentation, and tone I was missing to make it finally click. I don't use Unity, but laying out the core concepts and all the white-boarding was super valuable and universally applicable! Thank you, thank you, thank you!
You're just a perfect teacher, thanks for everything! I was really surprised to see such a content
i'm very glad i watched the video all the way through, i've learned more in 4 hours than i would have gotten with any course
This is absolutely amazing stuff. I had lost my fear of shaders in less than an hour or so. Mrs. Holmér does a great job of explaining - extremely competent and likeable. I'm looking forward to the other parts of this masterpiece.
I paused at 1:03:57 Started searching what the hell are float2, float3, float4. After digging for quite a while, assumed based on what I found that these are for storing multiple floats (float3 position has x,y,z, a float4 color has r,g,b,a etc...). Unpause the video, bam, explanation. Either way, amazing video! I'm completely new and following very nicely and with excitement to learn more through the whole series!
This woman knows her math and her art. Please keep the magic coming Freya! Cheers from Argentina!
thank you so much, love the way you teach, I'm gonna follow along this series, and probably watch all your other interesting courses related to gamedev as well.
Incredible lecture. Thanks! Everything magnificently explained. This video gathers all you need to start playing with shaders
This is a great master class but also the best way of teaching. I can feel how you love what you do. Thank you so much for this content.
You definitely have a talent for explaining things in a helpful, easy to understand way. Great tutorial!!😄
Never have I had such a big gap in my knowledge filled in so effectively! Thank you so much!!
Thank you, your content is awesome. Especially I appreciate good calm diction (English is not my native but I understand everything) and the absence of sharp loud sounds. Thank you! It's a pleasure to watch your videos. Fixing my stress after working day.
Finally got started with this course, really enjoying it so far! Can't believe you're giving this away for free, huge thank you.
Haven't watched it yet but i know this is another gold video
agreed
yes
I am so far away from being able to learn this stuff at the moment (I love the programming aspect of things so I would love to implement some of these things for fun lol) but I am absolutely loving the content I'm seeing! This was incredibly informative and the fact that you don't just say "Hey, this is how you accomplish 'x' in this software" and instead go in depth of the actual concepts and ways to apply them is very much appreciated! Thank you for this video lol I'm not sure how I never watched any videos by you before this but definitely following your channel now 😂
Thanks, Freya. It's a very clear exposition about shaders. I'm learning lots of things on your channel and I'm grateful for that.
are u Turk ?
Wow! I just have 20mins here and all my family moved to another room, while I am still hooked with full joy with this video, the way you explain how it is done, how to achieve it and that you will explain it later in more detail 🤯 Thanks for this, excuse me, now I have to pause the video and charge my phone lol
I keep coming back at this video, it's so incredibly well taught. Stuff that are usually way too complicated for my two brain cells somehow become tangible and understandable. Many thanks for your content, it's absolutely brilliant :)
Yo thanks! I made a squiggly rainbow ball. Very proud. I was completely lost on shaders and I watched this video all the way through and I plan to watch a bunch of others of yours, you explain things very thoroughly but not overwhelmingly. Very good way to grasp concepts that I've been struggling with. Keep it up :)
This is the best intro to this stuff I've yet found on here, thanks. ✨
57:50 the w component of the vector4 is used for storing the linear z after the projection to homogenous space. It helps with figuring out depth, projection, near plane clipping, and texture mapping.
wow, I'm 17 minutes in, and I can already tell this is incredibly awesome. I have sooo much to learn! I just jumped on your channel and saw that you have so many helpful topics that are not often covered. subscribed! also, you're game showcased at 26:00 looks sick! If one day I have half of your knowledge, I would be happy!
Awesome video!!! This is such a good introduction to shaders. They were black magic to me and other tutorials always left questions open like how can I pass data from the vertex shader to the fragment shader when verticies and fragments don't correspond one to one. Thanks to you I now understand how it all works. Thank you very much!!! Watching this felt like sitting in a really good course at university!
Hey, Freya this was very interesting and informative. Thank you so much!
I watched like 10 minutes so far and I already realize there is such a wealth of knowledge that I have to come back with a college block and take notes. Thank you in advance for what I will learn here.
utterly interesting ! simple basic concepts very well interconnected and well presented for stunning results ! thank you very much
I've been fumbling in shaders for the past 3 weeks- this has come at the perfect time, Freya!
This is the best thing I've seen when it comes to learning about shaders.
Finally I understand how shaders, materials and textures relate and how they work. Thank you.
What an incredible clarity in thought and explanation. Respect.
wow, what a great rundown :) this covers my first yr as a graphics programmer pretty well
by far the best tutorial on shaders I have encountered.! Thank you
I learned so much in one video. I was so confused with what Shaders are, how they works... Thank's so much !
"Oh Look, i made a Triangle" Holy damn shots fired :D
Revising a huge number of video tutorials, I realized that this is the best video from all other video tutorials on shader.
This is unbelievable.. Founding the one who knows math, art's aesthetic, coding's aesthetic with the teaching skill and putting all together on KZhead. Thank you so much for this!
Everything I'm supposed to know about shader for now is here. Just amazing!
After years of doing great stuff in Unity shaders via Amplify editor and Shader Graph not knowing what I actually do, finally someone explained me what is happening behind the scene and how the things that work actually work :) Thank you for this free knowledge!
how about now ?? i feel like come to this way its rly hard ,some are used to learn 6 year to good at it // im new here :( 🥺
Thank you. Really well done. I have a lot of programming experience but none in shaders so this was really interesting for me.
Great teaching style. I will come back to this and watch it all. You're wonderful!
That was so great! I finally finished watching all of that. Thank you for this great resource Freya!
Happy you liked it!
Thank you so much for doing these lectures. You're an amazing teacher!
Wow this is GOLDEN!! I wish this existed when I started learning shadercode.
Thank you Freya for another gem, saving it for the weekend
You're welcome!
10 hours of top-tier knowledge? Yes please, don't mind if I do. Thank you so much for the lessons, Freya! :)
This is insanely good. Thanks a lot for posting this.
Thank for this video series, you make my week ! Best regards from France !
3 days trying to finish this video... almost!! I'm a web developer, trying to learn game dev as hobby and your content is pretty cleary, Thanks you!!
Great content! Learned so much from a single video. Keep up the good work! :)
wow ! I watched it continue 4 hours . Thankyou so much for that valuable knowledge. 😃✨
It's like THE place to go to learn BASICS about shaders ! Super explanations
best and most comprehensive shader tutorial! Love it!