Learn Unity Shaders from Scratch
4.5 (19 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
312 students enrolled

Learn Unity Shaders from Scratch

A complete guide to Unity ShaderLab and the Cg Shading Language
4.5 (19 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
312 students enrolled
Created by Nicholas Lever
Last updated 6/2020
English [Auto]
Current price: $69.99 Original price: $99.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 4.5 hours on-demand video
  • 4 articles
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll 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 Cg 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.
Course content
Expand all 56 lectures 04:26:55
+ Introduction
4 lectures 12:43
Parallel Processing
Cg is not C#
What have you learned?
4 questions
+ First Steps
5 lectures 35:18
Working with vectors in Cg
Using the Properties section
Blending colours
Using step and smoothstep
What have you learned?
5 questions
+ Shaping Functions
13 lectures 01:17:39
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
Drawing circles
Drawing lines
Combining lines
Showing a polygon
Creating a brick pattern
What have you learned?
7 questions
+ Noise
4 lectures 13:50
What’s all that noise?
Using noise to create a fire shader
Using noise to create wood and marble
What have you learned?
3 questions
+ Textures
3 lectures 17:36
A simple use of a texture image
Blend between textures.
What have you learned?
3 questions
+ Vertex shaders
3 lectures 13:40
Turning a box into a sphere
Using the Unity lighting - Lambert
Creating a ball of lava
What have you learned?
3 questions
+ Surface Shaders
9 lectures 35:18
ShaderLab Surface Shaders - an introduction
Bump mapping
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?
7 questions
+ Advanced effects
6 lectures 26:18
Lighting in a vertex, fragment shader
A position location shader
Drawing a cross on the floor
Using the stencil buffer
Clipping the output
What have you learned?
5 questions
+ Transparent shaders
2 lectures 11:21
Alpha transparency in a surface shader
Space Pirate turns to glass
+ Volumetric Shaders
2 lectures 12:27
Volumetric Rendering
Using textures in the render
  • All you need is a copy of Unity, freely available for students.
  • A knowledge of the basics of using Unity is assumed, this is readily available by many online tutorials.
  • No knowledge of shaders is assumed.
  • A knowledge of a programming language would help but is not assumed.

In this course we're going to look at Unity ShaderLab and the Cg 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 Cg 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 Cg 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.

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."

and what students say about my GLSL Shader course

"A great course! Methodical, step by step explanations not only of the GLSL but also of the general theory behind shaders, usable with any shader system. Essential if you are into computer graphics or generative art. Thank you!"

"I've tried to pick up shaders in the past but found it quite difficult. Unlike other resources I've found, this course was the course that finally helped me get a much better grasp of glsl. It is well structured and very informative. I would recommend it to anyone looking to pick up glsl."

Who this course is for:
  • Unity developers who need to go beyond the shaders available on the platform.
  • Developers keen to learn the Cg shading language for other development platforms such as Unreal.