Learn Unity Shaders from Scratch

A complete guide to Unity ShaderLab, URP Shaders, Shader Graph and the HLSL Shading Language

4.21 (397 reviews)
Udemy
platform
English
language
Game Development
category
instructor
9,802
students
6 hours
content
Jan 2024
last update
$74.99
regular price

What you will learn

The mysteries of writing Unity shaders

You will be gently introduced to how to approach the problem of creating a custom shader.

You will learn the full details of the HLSL shader language.

You will learn to use the Surface Shader syntax to add custom shaders on top of Unity lighting.

You will start with simple unlit 2D shaders and work up to advanced effects such as volumetric shaders and clipping.

Learn to create shaders that work with the Universal Render Pipeline (URP)

Learn to use Shader Graph to create your shaders

Description

In this course we're going to look at Unity ShaderLab and the HLSL shading language to create amazing shaders.

Maybe you are

  • a developer struggling to bring to life a particular game feature because it needs a custom shader.

  • a developer who always wanted to create custom shaders but was too scared to start.

  • a developer wanting to add some custom post-processing effects to your 3d renders.

Unity ShaderLab is how you create custom shaders. It comes in 3 flavours, fixed function, vertex-fragment and surface shaders. We won't be looking at the fixed function route in this course as it is effectively a legacy option and you want to learn modern best practice. The code syntax is based on the C language, but fear not, we will assume you have literally no knowledge of this language at all and we will, as the course title states, learn this from scratch. A shader uses the GPU ( the Graphics Processing Unit) to handle multiple programs at the same time, so it is unbelievably fast.

We will start from really simple examples and progress slowly through each stage of developing a custom shader. You will be able to play with the shader code using Visual Studio, or another code editor if you prefer. You can experiment with different values to see the impact it has on the end result.

Unity shaders are split into vertex shaders and fragment shaders and we will focus initially on the fragment shader, working essentially in a 2d environment. With dozens of shaders in the course resources you will learn the language in gentle stages. Before moving on to use Unity's surface shader syntax to easily include complex lighting.

Once you're comfortable with simple shaders we will cover advanced effects such as tessellation, transparency, using the stencil buffer and post-processing.

Creating your own shaders means understanding the HLSL language and that is the aim of the course. You could search for a suitable shader on ShaderToy or ShaderFrog and then try to adapt the code. But without knowing the language you're going to find that difficult to do. To really be effective you need to know about the  language, shaping functions, tiling and lighting calculations. To do this you will need to follow along with the course and complete the many challenges suggested. At the end you will then be able to create any shader that you can imagine.


Now featuring sections on URP Shaders and Shader Graph


As usual there is a 30 day money back guarantee. So you have nothing to lose. Let's get shading today!


What students say about the course

"Great course. Took this as a refresher to get back into shaders. Everything you need is provided. Both starting scenes for each lecture and also completed ones if you get stuck with code errors. Nice learning curve. Everything is well explained. No long boring slideshows. Also plenty of challenges, which I like and find very useful in assisting your learning. Very clear audio and code. So no problems following along and plenty to take in. Also Nicholas is very helpful with your Q&A’s. Highly recommended."

"The information presented in this course is fantastic. The tutor has a great personality, and I can’t stress enough how enjoyable he makes this course."

"It is fantastic. You need a little bit of math to understand it better but with attention and repetition it will be easy to anyone. Thanks a lot professor!"

"Exceptional good structured step by step course. Background knowledge is provided on spot when necessary. Nik has a special encouraging attitude and he is fun to listen to. Thanks!"

"The best shaders instructor I've seen so far. His lessons are clear, practical, and the way he talks keeps the student motivated with the right amount of humour but without losing focus! I'm glad I've found this course."

"I would say that this was the best course I have bought on Udemy so far."

Content

Introduction

Welcome to the course
Introduction
Parallel Processing
Cg is not C#
What have you learned?

First Steps

Your first shader
Working with vectors in Cg
Using the Properties section
Blending colours
Using step and smoothstep
What have you learned?

Shaping Functions

Drawing a circle
Drawing a square
Moving our shape
Moving the square with the mouse
Moving the shape over time
Rotating the square
Changing the rotation centre and scaling
Tiling
Drawing circles
Drawing lines
Combining lines
Showing a polygon
Creating a brick pattern
What have you learned?

Noise

What’s all that noise?
Using noise to create a fire shader
Using noise to create wood and marble
What have you learned?

Textures

A simple use of a texture image
Ripple the image
Blend between textures.
What have you learned?

Vertex shaders

Turning a box into a sphere
Using the Unity lighting - Lambert
Creating a ball of lava
What have you learned?

Surface Shaders

ShaderLab Surface Shaders - an introduction
Bump mapping
Fresnel shading
Environment mapping
Adding a bump map to a reflective surface
Blinn Phong lighting
Custom lighting
Standard lighting
Adding a vertex function to a surface shader
What have you learned?

Advanced effects

Lighting in a vertex, fragment shader
A position location shader
Drawing a cross on the floor
Tessellation
Using the stencil buffer
Clipping the output
What have you learned?

Transparent shaders

Alpha transparency in a surface shader
Space Pirate turns to glass

Volumetric Shaders

Volumetric Rendering
Using textures in the render

Post Processing

Preparing for post processing
Night goggles effect
What have you learned?

Conclusion

Summary
Useful links
Bonus lecture

Screenshots

Learn Unity Shaders from Scratch - Screenshot_01Learn Unity Shaders from Scratch - Screenshot_02Learn Unity Shaders from Scratch - Screenshot_03Learn Unity Shaders from Scratch - Screenshot_04

Reviews

Gerardo
November 13, 2023
Per molto tempo ho cercato qualcuno che spiegasse lo ShaderLab, questo corso ha soddisfatto a pieno le mie aspettative
Miguel
August 21, 2023
So far yes, parts are going a bit fast but I can rewind. Explanations are good, a bit more exercise would be better, but I am only at section3. So far I understand and can achieve what is asked, the course is making the shaders a bit more friendly to me so far.
Galuh
June 26, 2023
What an amazing course, this course really encourage you to understand how shader works from scratch. Sure, sometimes I feel overwhelmed with the math, but the explanations are clear enough that I just need to repeat the video few times to understands it better. The pacing also "just right", not too long explanation that makes me sleepy, but not too quick either to make me pause every second. I highly recommend to apply to this course :)
Piotr
June 22, 2023
I wanted the conceise course because i am not a newbie and I dont have too much free time. This course is engaging, interesting and has brief lectures. It might be a bit hard if you are not very fluent in coding. But it will be still fun, the things you can do...
Chin
May 21, 2023
A good introduction to Shaders. This course really helped me understand the basics and I was a lot more confident in reading and writing my own shaders after taking this course. Thank you Nicholas for the great course!
Clancy
May 4, 2023
There is much use of magic hard-coded numbers and I think the C# structure sizes for compute buffers can be calculated with Marshal.Sizeof(typeof())) A few examples did not compile unless I modified the existing code. No complaints though. This course was gold and the instructor very thorough.
Michal
April 23, 2023
As an introductory course it is great. I had some experience with writing GLSL shaders and i have been working with unity for couple of years. For some reason the step from where i was to creating shaders in unity was not easy and this course helped a lot. I hoped some advanced topics like deffered rendering would be touched upon but as the course name states, it is an introductory course. The sections on URP and shader graph were excelent and actualy convinced me to upgrade my current project to URP.
Michał
April 17, 2023
Kurs zawierał dużo przydatnej wiedzy i przykładów. Udało mi się zdobyć wiedzę ogólną z shaderów oraz trochę wiedzy specjalistycznej z korzystania z nich w Unity. Niestety wiele materiałów pomocniczych udostępnionych przez prowadzącego nie działało lub wymagało poprawek. Sczególnie w sekcji URP, gdzie wyniku dwóch wykładów nie udało mi się powtórzyć. W wielu momentach wydawało mi się, że po prostu przepisuję kod bez zrozumienia.
Peter
March 20, 2023
I like how many practical examples he has provided and his manner of teaching/engaging the audience. The only negative is he only goes over a concept once, so if there is a later video that relies on old concepts he doesn't go over them again. I think certain concepts could use review.
Dink
March 8, 2023
Shaders can contain some complex mathematics and I really appreciate Nik's diagrams to illustrate what is going on in a specific formula. In the 'shaping functions' part of the course, each example was tweakable and I did some really creative things with some of them on my own. In the 'noise' section I felt like a door had opened and each point that was made was important. This is not the easiest material but if you follow closely and think about the math, you will take in powerful techniques in graphics programming!
ThunderCats
January 21, 2023
Terrible course, the worst part for me is that is that he is typing and reading a lot through the videos and then just going back to briefly explain a lot of math, I came here to learn shaders, not math, now I understand math is required, but this is not a math course! I want to learn about passes, alpha, clipping, etc, however the teacher provides good support. Edit: OFC shaders and math are inseparable, but it would be much more beneficial to learn of the shader structure, passes, how is rendering done, to understand all this would help much more than learning how to draw a circle with math on a quad, which is not bad, but that should not be a big part of the course, a math course should cover that, and since shaders are math, that information could be used here, what I'm trying to say is that for example, in one section he explains how to use mousePosition to interact with the shader, this required a C# script, now would it make sense to go and talk a lot about c# scripts since they are used in shaders? No, I could take a different course for that
Luke
January 20, 2023
I like the instructor provides several simplified shader codes, and we can try/test shader functions while we are progressing through the course. The course is really great shader introductory course. However, this course is definitely not for all skill levels. The course is quite heavily using Math. I do recommend to have fairly good understanding on Trigonometry (Sine, Cosine, Tangent, Dot product), and Linear Algebra (change of coordinate basis). Otherwise it'll be hard time following the course along.
Kwame
January 19, 2023
Great course. It's bit fast, but he points you to resources that can help if you're having trouble keeping up. To get the most out of this, take what you learn and make your own shaders, seperate from the course, as you go.
David
January 16, 2023
The course is very informative, the author gives usually clear explanations with visuals, however sometimes the visuals aren't enough to understand the math.
Batın
November 14, 2022
It starts good but as you progress, topics start being unclear, unexplained. It mostly explains how but rarely explains why... If you are looking for a refresher it's okay. but if you are a newbie you will only be introduced to shaders.

Coupons

DateDiscountStatus
8/25/2021100% OFF
expired
9/8/202386% OFF
expired

Charts

Price

Learn Unity Shaders from Scratch - Price chart

Rating

Learn Unity Shaders from Scratch - Ratings chart

Enrollment distribution

Learn Unity Shaders from Scratch - Distribution chart

Related Topics

2719674
udemy ID
12/24/2019
course created date
5/22/2020
course indexed date
Bot
course submited by