We may earn an affiliate commission when you visit our partners.
Course image
Penny de Byl and Penny Holistic3D

Now Updated for Unity 2017 to Unity 6.

This course presents a comprehensive guide to programming with Cg and High Level Shader Language in Unity's Shaderlab, to create your own visual surface effects for colouring and lighting game objects. It covers the mathematics of light and surfaces and steps you through the recreation of some of the most popular shaders. Many computer graphics concepts will be presented to help you understand the graphics pipeline and provide you with an essential toolkit of rendering knowledge, that will have you developing your own transparent, animated and texturised shaders in no time.

Read more

Now Updated for Unity 2017 to Unity 6.

This course presents a comprehensive guide to programming with Cg and High Level Shader Language in Unity's Shaderlab, to create your own visual surface effects for colouring and lighting game objects. It covers the mathematics of light and surfaces and steps you through the recreation of some of the most popular shaders. Many computer graphics concepts will be presented to help you understand the graphics pipeline and provide you with an essential toolkit of rendering knowledge, that will have you developing your own transparent, animated and texturised shaders in no time.

In this course, Penny teaches all the invaluable skills you will require to program the computer graphics pipeline in Unity from scratch using her internationally acclaimed teaching style and knowledge from over 25 years working with games and graphics.  But hold on tight as you'll be taken on a journey across the computer graphics realm as it is taught to post-graduate university students. Through detailed descriptions and hands-on workshops examining all you need to know about rendering queues, vector mathematics, graphics buffers, colour theory, 3D meshes, texture mapping, lighting models and much more.

Learn how to program and work with:

  • variables and packed arrays

  • meshes, vertices and UVs

  • the mathematics for working with objects in 3D and 2D spaces

  • a variety of lighting models from creating flat shaded objects to highly reflective shiny surfaces

  • bump maps for adding extra depth and dimension to surface textures

  • special effects such as holographic, scrolling textures and surface deformations

  • the variety of graphics buffers used in the rendering pipeline

  • forward and deferred lighting

  • surface, vertex and fragment shaders written in CG/HLSL

  • volumetric rendering

Contents and Overview

After diving right in and creating your very first shader from scratch, we will begin the lessons by examining how 3D models are structured and how that is used within shader code to colour and display the surface in computer graphics. You'll discover all the properties of a shader and how they can be controlled in code and via values fed in through Unity's Inspector.

Following this, we will examine a variety of lighting models and how lights and surface textures can influence the final look of a render. Included here, an overview of the buffers involved in the rendering queue will be given with practical examples for creating special effects that require more than one draw call. Students will also be exposed to the power of vector mathematics and especially the dot product and its role in creating beautiful effects such as outlines, rim lighting and holograms. In addition, issues surrounding transparency and blending will be discussed along with many practical hands-on workshops in which students can flex their newfound skills to interrogate the code they write for better understanding.

The next section brings together all the skills learned throughout together, to develop some of the more popular complex shaders including animated plasma and animated water with waves.

Finally volumetric shaders are covered in which you will follow along to create special effects such as fake geometry, fog and clouds.

What students are saying about this course:

  • This is the best course I've ever taken. It is perfect for me. I worked for 15 years in feature animation. A large part of my career was spent developing shaders for a proprietary renderer. This course has already helped me to bring the value of my previous experience into Unity.

  • Best shader course I've come across. There are enough and more tutorials on youtube to teach you how to develop your own shaders, but nothing falls into the class of Penny's tutorials. They are clear and to the point. Really happy about this one.

  • Wow. Thank you so much. If there were 10 stars - this course would deserve it. Going from absolutely knowing nothing about Shader writing to have a profund understanding about it.

  • I wanted to let you know that I just finished your shader course and thought it was fantastic. It was a pleasure to take the course and finally get a grasp on a topic that seemed so foreign to me not so long ago. Your teaching style and personality really worked for me and made learning a breeze.

Enroll now

What's inside

Syllabus

In this section you will get aquainted with some basic shader code and the general formatting as well as learn about what to find in the course.
Read more

This lecture introduces the course and takes you through the content that will be covered showing demos of the effects that will be covered.

H3D has a bustling online student community.  Here's how to get involved.

How to contact us

More often than not when you are learning something new with software you will find it difficult to tell when you've done something wrong or the software is not working. Here are a couple of common issues you might come across when you start to develop shaders. Be sure to use these as a go to when debugging your own work.

This article explains how to get the shaders in this course to work with Unity 6.

In this lecture we will take a look at the graphics pipeline and the stages in taking a model from virtual to an image on the screen.

There's nothing like seeing your first shader program come to life. There's still much to discuss about the technical and programmatic specifications of shaders, but lets start with a simple example to get the ball rolling.

Shader code has a lot in common with regular C# but can sometimes look a little strange especially with respect to data types. In this lecture we will go over these types and discuss how they are used.

The structure of a model's mesh is crutial in determiing how a shader will affect its surface. Understanding all the 3D components of a mesh is a fundamental you should have under your belt before attempting to manipulate the look of its surface with shaders.

In this lecture we will examine in detail the properties block and investigate how external values and images can be used in shaders.

Before you can start writing more complex shaders an understanding of the way surface brightness is calculated based on the lighting model is necessary. In this lecture we will introduce the concept of lighting models and examine the simpliest: Lambert.

In this lecture normal mapping will be introduced. The method is a way to add detail and depth to a model when no geometric detail exists.

This lecture is a challenge on modifying the bumped and diffuse textures.

Sometimes it can be difficult to visualise mathematical concepts without models to support them.  In this article I will provide a tool for examining normals in Unity which will visualise them and how they change as their coordinates do.

In this section we will examine three illumination models from the history of computer graphics. Learning how each is applied across the surface of a polygon to give a resulting visual effect will give you a better appreciation for the role of the normal in developing shaders.

When you want to create an effect that involves multiple vectors, such as the world reflection and normals you need to mix these together in the shader so one affects the other before adding a texture. In this lecture you will learn how to effect a world reflection with a normal map.

At some point in the rendering pipeline a pixel ends up in a buffer or two. As you create more shaders and shaders containing multiple effects it becomes critical to understand exactly whats going on otherwise it becomes difficult to debug your code. In this lecture we will examing the roles of the frame buffer, z buffer and g buffer and touch on the processes of forward and deferred lighting.

Being able to tell where the part of a model is facing with respect to the viewer is critical for the production of numerous shader effects. The dot product function is "need to know" information for any shader writer.

Rim lighting demonstrates perfectly the use of the dot product, though it requires a little mathematical manipulation to get just the right results. In this lecture we will look at introducing other mathematical operations into the code to tweak the dot product.

When you want to vary the effect a shader has on different parts of a surface, logical statements are your friend. In this lecture we will explore the use of logical statements embedded in the code to turn parts of an effect on and off.

Thus far we've only used Lambert as the lighting model for our shader. To expand the possibilities of what you can do with shaders, we now examine the other lighting models available in Unity.

Lambert lighting cannot produce specular highlights. For that you need BlinnPhong. In this lecture we will employ the BlinnPhong lighting model to add glossy effects to our model.

In this lecture we take a look at the Unity Physically-Based Lighting Shaders and use the lighting models to investigate the metallic and specular features.

To the Standard PBR shader created in the last lecture add an emissive slider that makes the model glow in the same areas that are grey and white in the metallic gloss map. See the working example in this video. The solution is attached.

To the Standard Specular PBR shader created in the previous lecture reverse the glossiness effect so the black areas of the map are highly reflective and the grey and white much more diffuse. See the working example in this video. The solution is attached.

In this lecture we will explore the creation of custom lighting models through the development of our own Lambert, BlinnPhong and Toon Ramped lighting from scratch.

Many effects including particles and vegetation in games rely on textures which use the alpha channel. In this lecture we will explore the creation of shaders that manipulate this channel as well as discover how transparency works withing the rendering pipeline with respect to the Z buffer.

In this lecture we will use the alpha channel with rim lighting to create a holographic effect. Included in the lesson will be pointers on using mulitple passes to clear up z buffer issues arising from making models transparent.

Blending provides you with control over the way incoming colours are added to colours already in the frame buffer. Through a series of very simple blend statements you can create a plethora of effects. This lecture shows you how.

By default in computer graphics the reverse side of polygons are not shown to save on processing. However, in the case of billboards you might want to be able to draw on both sides. This lecture shows you how to turn on the drawing of the backfaces.

Sometimes you might want a shader that takes more than one image and then merges them together onto a single surface. In this lecture you will learn how to do this as well as dynamically turn one on and off at runtime.

In this lecture we will examine the use of another buffer called the Stencil Buffer. This is useful for masking certain pixels to create a variety of effects including XRay Vision and Drawing Holes in walls.

The best way to get to understand the stencil buffer is to try it out many different ways. In this lecture we will use the stencil buffer to create a fun optical illusion as well as a dynamic piece of stencil code to let you play with the stencil settings via the Inspector.

In this lecture we'll examine the structure of a vertex/fragment shader. I'll point out a few of the nuances in the code and then show you how to create your own.

Both the vertex shader and fragment shader both deal with vertices and they can both produce colours. In this lecture we will examine the differences.

V/F shaders, like surface shaders, are capable of processing materials to colour the surface of objects. In this lecture we will look at how UV values are processed in both the Vert and Frag functions. Towards the end I will show you how to take a screen grab of a scene and use that as a manipulatable material on a plane.

While lighting is best kept to surface shaders that handle them elegantly on your behalf, it is handy to know how they work in V/F shaders. This lecture examines how to add a lambert lighting model to create diffuse light.

There's no point in having light if you can't have shadows. So let's modify the lighting shader in this lecture to examine how shadows are cast and received.

In this lecture we will start writing the value noise algorithm.

In this lecture we will examine the use of a vertex shader with a surface shader. The vertex shader will be used to extrude the surface of a mesh for a ballooning effect.

Outline is a cool effect you can combine with toon shading to get a Borderlands rendered look. In this lecture we will examine two ways to achieve the look.

In this lecture we will create everyone's favourite glass. But this glass isn't simply a transparent pane. It includes bump mapping, a stained-glass pattern and light refraction.

Once you know how, modifying vertices with mathematical functions can create all sorts of interesting effects. In this lecture we will examine the sin function for producing waves on the surface of a plane.

In this lecture we will examine a simple way to change the UV values of a surface over time to create a texture that rolls over the surface.

In this lecture we will use more sine functions and lots of them, plus a cosine, pow and squareroot to create some old school plasma to warp across the surface of objects.

In this lecture we will learn about the basics of ray marching and use it to render a sphere inside a cube with shader code.

In this lecture we will explore further facets of the ray marching algorithm and also calculate per pixel lighting.

In this lecture we will begin looking at another way to mathematically represent a sphere and depth test in two places.

In this lecture we will create the function that calculates the fog density.

In this lecture we will use the fog calculating function in the vertex shader to render a ball of volumetric fog.

In this lecture we will look at the Value Noise algorithm that will be used to create clouds as well as begin setting up the cloud environment.

In this lecture we begin with an overview of programming predictable random values and write some random functions for the shader.

In this lecture we complete the writing of the 3d value noise and test out some of its basic functionality.

In this lecture we will put the final function together that will combine lighting and cloud density into the shader for your first view of simple clouds.

In this lecture we will look at mixing and matching map functions and multiple marches to create better clouds.

In this lecture we will begin modifying the clouds shader to work on the camera.

In this lecture we will complete writing the Clouds.cs script that bypasses the normal Unity drawing to render the clouds on the camera.

In this lecture we will finished adjusting the existing clouds shader to work when attached to a camera.

In this lecture the camera direction is corrected for the cloud movement and a challenge involving plasma is presented.

This article presents some extra reading and content on volumetric shaders.

This link provides further information on the courses you can look at taking based on your interests and skill level.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Updated for Unity 6, this course is highly relevant for those looking to create custom visual effects and enhance the graphical fidelity of their games within the Unity engine
Assumes familiarity with C# and basic programming concepts, which are essential for understanding and writing shader code in CG/HLSL
Explores the mathematics of light and surfaces, providing a strong foundation in computer graphics concepts applicable beyond just shader development
Covers advanced topics like volumetric rendering, deferred lighting, and custom lighting models, enabling developers to create sophisticated visual effects
Includes hands-on workshops and challenges, allowing students to apply their knowledge and develop practical skills in shader programming
Teaches CG/HLSL, which are older shading languages, so learners should be aware that newer rendering pipelines may use different languages

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Deep dive into unity shader development

According to learners, this course provides a deep and comprehensive understanding of shader development in Unity using Cg/HLSL. Many praise the instructor, Penny, for her exceptionally clear teaching style and ability to explain complex topics like mathematics and the graphics pipeline in an accessible way. Students appreciate starting from scratch and building knowledge incrementally, leading to a profound understanding of shader code. The course is highlighted as having high-quality content and enabling learners to create sophisticated visual effects and apply skills in professional contexts. Reviewers consistently rank it as the best course available for truly mastering shader programming in Unity, noting its recent update for Unity 6 compatibility.
Requires dedication and focus.
"...hold on tight as you'll be taken on a journey across the computer graphics realm as it is taught to post-graduate university students."
"This is not a beginner tutorial; it's a serious study of shaders."
"Sometimes I had to rewatch sections, but the effort is worth it for the understanding gained."
Updated for recent Unity versions.
"Now Updated for Unity 2017 to Unity 6."
"It's great that the course is kept up-to-date for the latest Unity engine."
"The Unity 6 compatibility ensures the code examples work as expected."
Includes workshops and challenges.
"...many practical hands-on workshops in which students can flex their newfound skills..."
"The challenges helped me solidify my understanding by applying the concepts."
"I enjoyed recreating specific shaders and seeing the effects come to life."
Highly recommended as a top resource.
"This is the best course I've ever taken. It is perfect for me."
"Best shader course I've come across."
"If there were 10 stars - this course would deserve it."
Covers math, pipeline, and effects.
"It covers the mathematics of light and surfaces and steps you through the recreation of some of the most popular shaders."
"Takes you on a journey across the computer graphics realm as it is taught to post-graduate university students."
"The course content is thorough, covering everything from basics to volumetric effects."
Instructor makes complex topics clear.
"Your teaching style and personality really worked for me and made learning a breeze."
"They are clear and to the point. Really happy about this one."
"Penny explains everything in a way that's easy to follow, even the math."
Develops a deep, fundamental grasp.
"Going from absolutely knowing nothing about Shader writing to have a profund understanding about it."
"Finally get a grasp on a topic that seemed so foreign to me not so long ago."
"It helped me understand the underlying principles, not just copy code."

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 Shader Development from Scratch for (Unity 6 Compatible) with these activities:
Review Vector Mathematics
Strengthen your understanding of vector mathematics, which is crucial for manipulating objects in 3D space and creating shader effects.
Browse courses on Vector Mathematics
Show steps
  • Review vector addition, subtraction, and scalar multiplication.
  • Practice calculating dot products and cross products.
  • Work through examples of vector transformations.
The Book of Shaders
Read 'The Book of Shaders' to gain a solid foundation in shader programming principles and techniques.
Show steps
  • Read the introductory chapters on GLSL syntax and basic shader structure.
  • Experiment with the interactive examples provided in the book.
  • Try to recreate some of the shader effects discussed in the book using Unity's ShaderLab.
Create a Simple Animated Shader
Develop a simple animated shader to practice manipulating vertices and UV coordinates over time.
Show steps
  • Create a new shader in Unity using ShaderLab.
  • Write code to modify the vertex positions based on a sine wave function.
  • Adjust the speed and amplitude of the animation using shader properties.
  • Apply the shader to a simple mesh and observe the animation.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Document Shader Creation Process
Create a blog post or video tutorial explaining the process of creating a specific shader effect covered in the course.
Show steps
  • Choose a shader effect from the course that you want to document.
  • Recreate the shader effect from scratch.
  • Document each step of the process, explaining the code and the underlying concepts.
  • Publish your blog post or video tutorial online.
Recreate Example Shaders
Practice recreating shaders from existing games or demos to improve your understanding of different techniques.
Show steps
  • Find examples of interesting shaders in games or online demos.
  • Analyze the visual effect and try to break it down into smaller components.
  • Recreate the shader effect in Unity using ShaderLab.
  • Compare your implementation with the original and identify any differences.
Unity Shaders and Effects Cookbook
Use the 'Unity Shaders and Effects Cookbook' as a reference for implementing common shader effects and learning new techniques.
Show steps
  • Browse the cookbook and identify shader effects that are relevant to your projects.
  • Implement the shader effects in your own Unity projects.
  • Customize the shader effects to fit your specific needs.
Contribute to a Shader Project
Contribute to an open-source shader project to gain experience working with a team and learn from other developers.
Show steps
  • Find an open-source shader project on GitHub or GitLab.
  • Fork the repository and set up a local development environment.
  • Identify a bug or feature that you want to work on.
  • Implement the fix or feature and submit a pull request.
  • Respond to feedback from other developers and revise your code as needed.

Career center

Learners who complete Shader Development from Scratch for (Unity 6 Compatible) will develop knowledge and skills that may be useful to these careers:
Shader Programmer
A Shader Programmer specializes in writing code that controls how graphics are rendered on screen. This course is valuable for aspiring Shader Programmers because it focuses entirely on shader development from scratch for Unity. It provides a comprehensive guide to programming with Cg and High Level Shader Language in Unity's Shaderlab. The course covers topics such as meshes, vertices, UVs, and various lighting models. It also delves into bump maps, special effects, graphics buffers, and volumetric rendering.
Rendering Engineer
A Rendering Engineer is responsible for developing and maintaining the rendering systems within a game engine or other graphics application. This course helps Rendering Engineers by providing a deep understanding of shader programming and the graphics pipeline. The course goes over meshes, lighting models, bump maps and special effects. It also covers advanced topics such as volumetric rendering and custom lighting algorithms.
Graphics Programmer
A Graphics Programmer writes code that renders images and animations on screen. This course helps those who want to be Graphics Programmers by delving into the computer graphics pipeline and providing an essential toolkit of rendering knowledge. The course covers variables, packed arrays, meshes, vertices, UVs, and the mathematics for working with objects in 3D and 2D spaces. It also covers a variety of lighting models, bump maps, special effects, graphics buffers, and volumetric rendering.
Technical Artist
A Technical Artist bridges the gap between art and programming. They often develop shaders and visual effects to enhance the look and feel of a game or application. This course helps those who want to be Technical Artists by teaching them to program shaders from scratch using Cg and High Level Shader Language in Unity's Shaderlab. The course covers the mathematics of light and surfaces. It also steps you through the recreation of popular shaders. Students get hands-on experience with rendering queues, vector mathematics, graphics buffers, and lighting models.
Real Time Rendering Specialist
A Real Time Rendering Specialist focuses on optimizing graphics for real-time applications, such as games and simulations. This course provides skills needed to improve rendering efficiency. The course covers the graphics pipeline, rendering queues, and different lighting models. Students will also explore surface, vertex, and fragment shaders written in CG and HLSL, providing the skillset to optimize performance.
Material Artist
A Material Artist creates realistic and visually appealing materials for 3D models. This course helps Material Artists learn how to write their own shader code and customize the appearance of materials. The course covers lighting models, bump maps, and texture mapping. Students will also learn how to create special effects such as holographic, scrolling textures, and surface deformations, providing them with a range of tools to create unique materials.
Visual Effects Artist
A Visual Effects Artist creates stunning visual elements for games, film, or television. This course helps those who want to be Visual Effects Artists by teaching the fundamentals of shader programming. The course covers a range of special effects, including holographic effects, scrolling textures, and surface deformations. It also covers volumetric shaders for creating effects like fog and clouds. Students will learn how to program and work with meshes, vertices, UVs, and the mathematics for working with objects in 3D and 2D spaces.
Creative Coder
A Creative Coder uses programming to generate art, installations, and interactive experiences. This course equips those who want to be Creative Coders with the skills to manipulate visuals at a low level. It teaches the fundamentals of shader programming. The course covers mathematical concepts and techniques to create visually appealing and interactive effects. Students will learn vector mathematics, color theory and how to program custom shaders.
Virtual Reality Developer
A Virtual Reality Developer creates immersive experiences for virtual reality headsets. This course helps Virtual Reality Developers by providing skills in shader programming. The course covers the mathematics of light and surfaces, which is essential for creating realistic virtual environments. The course also covers rendering queues, vector mathematics, graphics buffers, and lighting models. Students will learn how to develop transparent, animated, and textured shaders.
Game Developer
A Game Developer creates games for computers, consoles, and mobile devices. This course may be useful to Game Developers who want to enhance the visual quality of their games. It teaches students to program shaders from scratch using Cg and High Level Shader Language in Unity's Shaderlab. The course covers topics such as lighting models, bump maps, and special effects. Students will also learn about the graphics pipeline and how to develop their own transparent, animated, and textured shaders.
Motion Graphics Designer
A Motion Graphics Designer creates animated visuals for film, television, or web. This course helps Motion Graphics Designers by teaching the fundamentals of shader programming. The course covers a variety of special effects, including holographic effects, scrolling textures, and surface deformations. It also covers volumetric shaders which can add depth to design. Students will learn how to program and work with meshes, vertices, UVs, and the mathematics for working with objects in 3D and 2D spaces.
Augmented Reality Developer
An Augmented Reality Developer creates interactive experiences that overlay digital content onto the real world. This course may be useful for Augmented Reality Developers because it provides solid skills in shader development. The course teaches students about the rendering pipeline, meshes, textures, and lighting models. It also covers how to create special effects and volumetric rendering, which are essential for creating realistic and engaging augmented reality experiences.
Simulation Developer
A Simulation Developer creates software that simulates real-world scenarios for training or research purposes. This course may be useful for Simulation Developers who need to create realistic visual environments. The course teaches students how to program shaders from scratch and covers topics such as lighting models, bump maps, and special effects. Students will also learn about volumetric rendering, which can be used to simulate fog, clouds, and other atmospheric effects.
Pipeline Developer
A Pipeline Developer creates tools and workflows to streamline the content creation process in game development or visual effects. This course may be useful for Pipeline Developers by giving them skills to develop custom tools for shader creation and management. The course covers the graphics pipeline, shader programming, and different rendering techniques. It also explores topics such as surface, vertex, and fragment shaders which they can use to build custom shader tools.
Software Engineer
A Software Engineer designs and develops software applications. This course may be helpful for Software Engineers who want to specialize in graphics programming. The course teaches students how to program shaders from scratch and covers topics such as the graphics pipeline, rendering queues, and lighting models. Students will also gain experience working with Cg and High Level Shader Language in Unity's Shaderlab, adding a valuable tool to their skillset.

Featured in The Course Notes

This course is mentioned in our blog, The Course Notes. Read one article that features Shader Development from Scratch for (Unity 6 Compatible):

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 Shader Development from Scratch for (Unity 6 Compatible).
Provides a gentle introduction to shader programming concepts. It covers a wide range of topics, from basic GLSL syntax to more advanced techniques like procedural textures and ray marching. It is particularly useful for beginners who want to learn the fundamentals of shader development in a clear and accessible way. The book also provides interactive examples that allow you to experiment with different shader effects.
This cookbook provides a collection of ready-to-use shader effects for Unity. It covers a wide range of topics, from basic surface shaders to more advanced techniques like post-processing and special effects. It is particularly useful for intermediate users who want to quickly implement common shader effects in their projects. great reference for practical shader implementations and provides a good starting point for customizing existing shaders.

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