We may earn an affiliate commission when you visit our partners.
Nicholas Lever

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.

Read more

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

Enroll now

What's inside

Syllabus

Introduction
Welcome to the course
Parallel Processing
Cg is not C#
Read more
What have you learned?
First Steps
Your first shader
Working with vectors in Cg
Using the Properties section
Blending colours
Using step and smoothstep
A position location shader
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
Noise
#pragmas
What’s all that noise?
Using noise to create a fire shader
Using noise to create wood and marble
Drawing a cross on the floor
Textures
A simple use of a texture image
Ripple the image
Blend between textures.
Vertex shaders
Turning a box into a sphere
Using the Unity lighting - Lambert
Creating a ball of lava
Tessellation
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
Advanced effects
Lighting in a vertex, fragment shader
Using the stencil buffer
Clipping the output
A first example
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
URP Shaders
Migrating to URP
Converting a custom unlit shader to URP
Working with Properties and includes
More tips when updating shaders for URP
A Toon Shader
Using URP Lighting in a Shader
Post Processing using Renderer Features
Stencils
Shader Graph
Rim lighting
Reflections
Custom Functions
Refractive Glass
Conclusion
Summary
Useful links
Bonus lecture

Save this course

Save Learn Unity Shaders from Scratch to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Learn Unity Shaders from Scratch with these activities:
Review Linear Algebra Fundamentals
Solidify your understanding of linear algebra concepts like vectors and matrices, which are fundamental to shader programming and transformations.
Browse courses on Linear Algebra
Show steps
  • Review vector addition and scalar multiplication.
  • Practice matrix multiplication and transformations.
  • Understand coordinate systems and their conversions.
The Book of Shaders
Supplement your learning with a comprehensive guide to shader programming, covering fundamental concepts and advanced techniques.
Show steps
  • Read the introductory chapters on shader basics.
  • Experiment with the code examples provided in the book.
  • Try to recreate some of the shaders from the book in Unity.
ShaderToy Code-Alongs
Improve your HLSL skills by recreating shaders from ShaderToy, focusing on understanding the code and adapting it to Unity.
Show steps
  • Choose a simple shader from ShaderToy.
  • Analyze the code and understand its functionality.
  • Recreate the shader in Unity using HLSL.
  • Compare the results and debug any discrepancies.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Shader Breakdown Blog Post
Solidify your understanding by writing a blog post explaining the inner workings of a specific shader, targeting other learners.
Show steps
  • Choose a shader to analyze.
  • Deconstruct the code and explain each section.
  • Write a clear and concise blog post with code snippets.
  • Publish the post on a platform like Medium or a personal blog.
Create a Custom Post-Processing Effect
Apply your knowledge by developing a unique post-processing effect in Unity, such as a custom color grading or distortion effect.
Show steps
  • Define the desired visual effect.
  • Research existing post-processing techniques.
  • Implement the effect using HLSL and Unity's post-processing stack.
  • Test and refine the effect for optimal performance.
Unity Shaders and Effects Cookbook
Explore a collection of shader recipes and techniques to enhance your Unity projects with visually stunning effects.
Show steps
  • Browse the cookbook for interesting shader effects.
  • Follow the recipes to implement the effects in Unity.
  • Experiment with the parameters to customize the effects.
Contribute to a Shader Graph Project
Deepen your understanding of shader creation by contributing to an open-source project that utilizes Shader Graph.
Show steps
  • Find an open-source project using Shader Graph.
  • Identify areas where you can contribute, such as bug fixes or new features.
  • Submit your contributions to the project.

Career center

Learners who complete Learn Unity Shaders from Scratch will develop knowledge and skills that may be useful to these careers:
Shader Developer
A Shader Developer specializes in creating and optimizing shaders for various applications, including games, simulations, and visual effects. As a shader developer, you will find that this course directly addresses the core skills needed to create amazing shaders in Unity. The course's focus on Unity ShaderLab and HLSL provides a solid foundation for crafting custom shaders from scratch. Learning shaping functions, tiling, and lighting calculations enhances a Shader Developer's ability to create complex visual effects. Advanced topics such as tessellation and post-processing further hone the expertise needed to excel in this specialized area. For a shader developer, the URP shaders and shader graph parts of this course may be very useful.
Graphics Programmer
A Graphics Programmer specializes in developing and optimizing graphics rendering techniques, often working on custom shaders and visual effects. As a graphics programmer, you will find that this course presents a practical guide to creating shaders from scratch using Unity ShaderLab and HLSL and helps build a solid foundation in shader development. The course's content on vertex and fragment shaders, surface shaders, lighting calculations, and advanced effects like tessellation and post-processing are invaluable for a graphics programmer. Mastering these skills enables a Graphics Programmer to optimize the graphics pipeline and enhance visual fidelity.
Rendering Engineer
A Rendering Engineer focuses on optimizing and improving rendering pipelines for real-time graphics applications. This course helps Rendering Engineers gain a deeper understanding of shader creation and optimization within Unity. The course's in-depth coverage of Unity ShaderLab, HLSL, vertex shaders, fragment shaders, and surface shaders helps a rendering engineer. By mastering these skills, a Rendering Engineer can optimize rendering performance, implement advanced lighting techniques, and improve the overall visual quality of real-time applications.
Technical Artist
A Technical Artist bridges the gap between artists and programmers, using their technical skills to improve art pipelines and solve technical art challenges in game development. This course may be useful for aspiring Technical Artists, focusing on the creation of custom shaders using Unity ShaderLab and HLSL. Shaders are essential for creating visual effects and enhancing the aesthetic appeal of games. By learning to write shaders from scratch, a Technical Artist can efficiently customize the look and feel of game environments. The course's advanced topics, such as tessellation, transparency, and post-processing, are directly applicable to creating sophisticated visual effects.
Game Developer
A Game Developer is responsible for designing, coding, and debugging video games. This course helps Game Developers by enabling them to craft custom visual effects. With its introduction to Unity ShaderLab and HLSL, the course provides a foundation for creating optimized and visually appealing game environments. Game Developers can leverage the knowledge gained from this course to implement unique artistic styles and improve the overall player experience. Specifically, the exploration of vertex and fragment shaders, surface shaders, and advanced effects like transparency is something of direct use to a game developer.
Virtual Reality Developer
A Virtual Reality Developer creates immersive experiences for VR platforms, often requiring specialized visual effects and optimizations. This course helps Virtual Reality Developers craft custom shaders using Unity, which are vital for optimizing performance and creating stunning visuals within VR environments. The course's coverage of advanced effects, such as transparency and post-processing, enables VR developers to create more engaging and realistic experiences. The knowledge of HLSL gleaned from this course helps a Virtual Reality Developer.
Visual Effects Artist
A Visual Effects Artist creates compelling visual effects for games, film, and other media. This course may be helpful for Visual Effects Artists, providing them with the skills to create custom shaders within Unity for real-time visual effects. The course's emphasis on HLSL and ShaderLab empowers Visual Effects Artists to craft unique and optimized effects. Knowledge of shaping functions, tiling, and lighting calculations, combined with advanced effects like transparency and post-processing, contributes to creating stunning visual experiences.
Augmented Reality Developer
An Augmented Reality Developer designs and develops AR applications, blending digital content with the real world. This course may be useful for Augmented Reality Developers because it provides the skills to create custom shaders within Unity, enhancing the visual integration of virtual elements with real-world scenes. Understanding HLSL and ShaderLab enables AR developers to optimize graphical performance and create visually compelling AR experiences. Course topics such as transparency, post-processing, and tessellation may be used in the field of augmented reality.
Simulation Developer
A Simulation Developer creates realistic simulations for training, research, or entertainment purposes. This course may be useful to Simulation Developers, enabling them to create custom shaders within Unity to enhance the visual realism of simulated environments. By understanding Unity ShaderLab and HLSL, simulation developers can optimize performance and achieve visually accurate simulations. Topics such as vertex shaders, surface shaders, and advanced effects like tessellation and volumetric shaders are directly applicable to improving the fidelity of simulations.
Educator
An Educator teaches courses on game development, computer graphics, or related subjects. Educators may find this course useful as a resource for teaching shader programming using Unity. The course's structured approach, starting from scratch and progressing through advanced effects, makes it easy to integrate into a curriculum. Educators can leverage the course's many examples and challenges to provide students with hands-on experience in shader development.
Motion Graphics Designer
A Motion Graphics Designer creates animated graphics and visual effects for various media, including video, web, and interactive applications. This course may be useful for Motion Graphics Designers, providing them with the skills to create custom shaders within Unity to enhance the visual appeal of their animations. The course's coverage of shaping functions, tiling, and post-processing effects enables Motion Graphics Designers to create unique and dynamic motion graphics. In the context of motion graphics, the shader graph part of this course in particular may be useful.
Game Artist
A Game Artist creates the visual assets for video games, including characters, environments, and special effects. This course may be useful for Game Artists, enabling them to collaborate more effectively with technical artists and programmers by understanding the fundamentals of shader creation. The course's coverage of Unity ShaderLab and HLSL helps Game Artists appreciate the technical aspects of creating visually appealing game assets. A game artist will find the knowledge of shaping functions, texturing, and lighting useful.
Unreal Engine Developer
An Unreal Engine Developer creates games and other interactive experiences using the Unreal Engine. Though this course focuses on Unity, this course may be useful because many of the underlying shader principles are transferable. Understanding the HLSL shading language and general shader concepts taught in the course can aid in understanding Unreal Engine's material system. The course's comprehensive coverage of shaders may make it easier to adapt to Unreal Engine's shader workflow.
Software Engineer
A Software Engineer designs, develops, and tests software applications. This course may be useful for Software Engineers who want to expand their skills into graphics programming or game development. The course's introduction to Unity ShaderLab and HLSL provides a practical foundation for understanding shader programming concepts. By learning to create custom shaders, Software Engineers can enhance their ability to build visually rich and interactive applications. A software engineer may find the sections on volumetric shaders and post processing useful.
Web Developer
A Web Developer builds and maintains websites and web applications. This course may be useful for Web Developers who want to incorporate interactive 3D graphics and visual effects into their projects using Unity. The course's coverage of Unity ShaderLab and HLSL may allow Web Developers to create custom shaders for web-based 3D environments. Web developers may find the knowledge of shaping functions, tiling, and post-processing useful in certain contexts. The URP Shaders and Shader Graph sections may be very useful.

Featured in The Course Notes

This course is mentioned in our blog, The Course Notes. Read one article that features Learn Unity Shaders from Scratch:

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Learn Unity Shaders from Scratch.
Provides a gentle introduction to shader programming concepts. It covers a wide range of topics, from basic color manipulation to more advanced techniques like noise and procedural textures. It's a great resource for understanding the underlying principles behind shader creation and experimentation. This book is especially useful for visual learners.
This cookbook provides practical solutions and recipes for creating various shader effects in Unity. It covers a wide range of topics, including lighting, textures, and post-processing. It's a valuable resource for developers looking to quickly implement specific shader effects in their projects. is best used as a reference for specific effects.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser