We may earn an affiliate commission when you visit our partners.
Jenny Hide

Learn the basic concepts and language you will need to program your own shaders and image effects for Unity's built-in render pipeline, for Unity 5 or above. 

Learn and Understand Shaders with this Unity Course.

  •  Learn about the different properties of a mesh that can be accessed and changed via a shader.

  •  Write your own vertex and fragment, and surface shaders.

  •  Create your own image effects.

  • Write custom lighting models.

  • Understand ShaderLab and CG/HLSL.

Make your game look unique using shaders.

Read more

Learn the basic concepts and language you will need to program your own shaders and image effects for Unity's built-in render pipeline, for Unity 5 or above. 

Learn and Understand Shaders with this Unity Course.

  •  Learn about the different properties of a mesh that can be accessed and changed via a shader.

  •  Write your own vertex and fragment, and surface shaders.

  •  Create your own image effects.

  • Write custom lighting models.

  • Understand ShaderLab and CG/HLSL.

Make your game look unique using shaders.

In this course, you will learn the basics of programming shaders, from simple colour changes to whole screen image effects. We'll go through the different types of shader, Unity's quirks and in-built functions, and the different bits of code that make up a shader, before writing a full surface shader with a texture, normal map, metallic and emissive effects. We'll also look at writing a custom inspector for your shader. Once we've covered these basics, we'll look at creating an number of image effects, custom lighting models including cel shading, a sprite shader with a sway effect, and a dissolve effect.

A common criticism of Unity is that games made with the engine all have a similar look. Combat this by writing your own shaders rather than relying on Unity's inbuilt ones - learn how to improve the look and feel of your game.

By the end of this course, you will understand the basics of shader coding and will be able to create your own shaders. Source code is included to help you on your way.

This course is designed for people who can already use Unity and can program in C#, but who have no previous experience of programming shaders.

I present examples of increasing difficulty for each type of shader (surface, vertex/fragment and image effect) designed to help you to understand how shaders work so that you can be confident in creating your own effects. 

For extra support, you can ask questions in the Q&A section, and I’ve provided the completed code examples for download in each Section. You’ll receive a certificate of completion once you finish the course.

Enroll now

What's inside

Learning objectives

  • Program surface shaders - unity's approach to making it easier to write lit shaders.
  • Code lower level fragment and vertex shaders.
  • Program post-processing images effects.
  • Use your new knowledge to create your own, unique shaders and game feel.
  • Understand unity's shaderlab and cg/hlsl.
  • Write your own shaders for unity's built-in render pipeline.
  • Create your own custom lighting

Syllabus

Introduction

What are shaders? Get a basic understanding!

An introduction to vertex and fragment shaders.

An introduction to surface shaders.

Read more

Learn when you should use a surface shader and when you should use a vertex and fragment shader.

Using .cginc files for a modular approach.

A note on the render pipeline.

Understand the structure of shaders

Learn about the shared base code both types of shader use - naming, properties and subshaders.

Learn what pragma directives are and how to use them.

Examples of the properties a shader can have: 2D, CUBE, Range(a, b), Color etc - all here: https://docs.unity3d.com/Manual/SL-Properties.html

The different options for Tags.

Blender

A first look at a surface shader.

A first look at a vertex and fragment shader.

An introduction to co-ordinate systems that are useful when writing shaders.

An introduction to adding Unity's lighting models to shaders.

A note on code ordering.

Full Surface Shader

Adding a texture to your simple surface shader.

Adding a normal map to your simple surface shader.

Adding occlusion to your simple surface shader.

Adding a metallic texture to your simple surface shader.

Adding an emissive map to your simple surface shader.

Writing a custom inspector GUI for the emissive shader.

Test your knowledge so far

Inverted Image Effect

An overview of the Inverted Image Effect section.

What is the Blit method and how do we use it in image effects?

Learn about culling and depth testing.

Writing the invert shader.

Writing the C# Blit script to make the shader work.

Image Effects

Learn how to write an image effect that can fade the screen to black and back.

Understand what Lerp does via a graph.

Learn how to write an image effect that can fade the screen to any solid colour and back.

Learn how to write an image effect that can desaturate the screen with a slider going from greyscale to normal saturation.

Understand what parametric equations are via a graph.

Learn how to write an image effect that distorts the screen using _Time.

Learn how to write an image effect that distorts the screen using a texture.

Learn how to write an image effect that shows chromatic aberration.

Custom Lighting Models

Understand what the dot product is.

Write a simple Lambert lighting model.

Write a cel shading lighting model.

Add lighting to a vertex and fragment shader.

Swaying Plant Sprites

Learn to program a simple sprite shader.

Understanding and adding Blend and transparency.

Understand what Step does via a graph.

Understanding the Step function.

Making the sprite sway using the vertex function.

Make this sprite shader work with non-directional lights.

Improve how the sprite sways and make each one sway at a different rate.

Dissolve Surface Shader

An overview of the Dissolve Surface Shader section.

Understanding and using the Clip function.

Adding the dissolve texture.

Understand what the Smoothstep function does via a graph.

Understand the Smoothstep function.

Understand what a ramped smoothstep function does via a graph.

Understand how the ramp works with the smoothstep function.

Add in the ramp contribution to complete the dissolve effect.

You'll be able to write a Triplanar surface shader

What is a triplanar shader and why would you want to use it?

Write a very simple version of a triplanar shader.

Learn how to improve the triplanar shader by adding a weighted element.

Add a second triplanar texture to the top of the object.

Improve the look by adding noise.

Bonus

A bonus lecture containing £9.99/$9.99 codes for my other courses.

Save this course

Save Coding in Unity: Introduction to Shaders 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 Coding in Unity: Introduction to Shaders with these activities:
Review C# Fundamentals
Solidify your understanding of C# syntax and programming concepts, as shaders in Unity are often written using Cg/HLSL, which share similarities with C#.
Browse courses on C# Programming
Show steps
  • Review C# tutorials and documentation.
  • Practice writing simple C# scripts.
  • Familiarize yourself with C# data types and control structures.
The Cg Tutorial
Study a book on Cg to gain a deeper understanding of shader programming concepts and techniques.
Show steps
  • Read the introductory chapters on Cg.
  • Work through the examples provided in the book.
  • Experiment with modifying the examples to understand the effects of different parameters.
Write a Simple Shader
Practice writing a basic shader that changes the color of an object to reinforce your understanding of shader syntax and structure.
Show steps
  • Create a new shader in Unity.
  • Write a shader that changes the object's color.
  • Apply the shader to a material and assign it to an object in your scene.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Follow Unity Shader Tutorials
Enhance your skills by following online tutorials that demonstrate various shader techniques and effects in Unity.
Show steps
  • Search for Unity shader tutorials on websites like YouTube or the Unity Asset Store.
  • Follow the steps in the tutorial to create a specific shader effect.
  • Experiment with modifying the shader code to customize the effect.
Create a Custom Image Effect
Apply your knowledge by creating a custom image effect, such as a blur or color correction effect, to deepen your understanding of post-processing shaders.
Show steps
  • Create a new image effect shader in Unity.
  • Implement the shader code to achieve the desired effect.
  • Write a C# script to apply the image effect to the camera.
  • Adjust the shader parameters to fine-tune the effect.
Real-Time Rendering
Consult a comprehensive book on real-time rendering to expand your knowledge of advanced shader techniques and concepts.
Show steps
  • Read the chapters on lighting and shading models.
  • Study the examples of advanced shader techniques.
  • Experiment with implementing these techniques in your own shaders.
Contribute to a Shader Project
Deepen your understanding and gain practical experience by contributing to an open-source shader project on platforms like GitHub.
Show steps
  • Find an open-source shader project on GitHub.
  • Review the project's code and documentation.
  • Identify a bug or feature to work on.
  • Submit a pull request with your changes.

Career center

Learners who complete Coding in Unity: Introduction to Shaders will develop knowledge and skills that may be useful to these careers:
Shader Programmer
Shader Programmers specialize in writing and optimizing shaders for various rendering pipelines. They work closely with artists and engineers to bring visually stunning effects to life in games and other real-time applications. This course directly addresses the skills needed for this role, providing hands-on experience in programming shaders within Unity. The syllabus's coverage of surface shaders, vertex and fragment shaders, and image effects builds a strong foundation. Furthermore, the practical application of creating custom lighting models, a swaying plant sprite shader, and a dissolve effect provides invaluable experience. The course's emphasis on understanding Unity's ShaderLab and CG/HLSL ensures shader programmers can effectively integrate their creations into Unity projects.
Unity Developer
Unity Developers use the Unity engine to create games and other interactive experiences. A strong understanding of shaders is essential for creating visually appealing and performant projects. This course directly addresses the skills needed for this role, providing hands-on experience in programming shaders within Unity. The syllabus's coverage of surface shaders, vertex and fragment shaders, and image effects builds a strong foundation. Furthermore, the practical application of creating custom lighting models, a swaying plant sprite shader, and a dissolve effect provides invaluable experience. The course's emphasis on understanding Unity's ShaderLab and CG/HLSL ensures Unity developers can creatively integrate their creations into Unity projects.
Real Time VFX Artist
Real Time Visual Effects Artists create stunning visual effects that run in real-time, often for video games and simulations. Shaders are their primary tool for achieving these effects. This course is directly relevant to becoming a Real Time VFX Artist, as it teaches the fundamentals of shader programming in Unity. The course emphasizes practical skills, such as creating image effects, writing custom lighting models, and developing unique shaders. The syllabus includes hands-on projects like the dissolve effect and sprite shader, providing valuable experience in the techniques used by VFX artists. The course covers ShaderLab and CG/HLSL and helps a Real Time VFX Artist create visually impressive and performant effects.
Technical Artist
A Technical Artist bridges the gap between artists and programmers, optimizing art assets for game engines. They develop custom tools and shaders to achieve specific visual styles and effects. This course on coding in Unity helps build a foundation in shader programming, a core skill for technical artists. The course's focus on writing vertex and fragment shaders, creating image effects, and customizing lighting models directly translates to the tasks a technical artist undertakes. Understanding ShaderLab and CG/HLSL is also critical for creating optimized and visually appealing game experiences. Learning to write custom inspectors for shaders, as taught in the course, allows for better control and artist-friendly workflows, making this learning particularly helpful.
Graphics Programmer
Graphics Programmers specialize in developing rendering techniques and optimizing graphics performance for games and other applications. They work with shaders to create visually stunning effects and ensure smooth frame rates. This course builds a foundation in shader programming, which is essential for graphics programmers. The syllabus's coverage of vertex and fragment shaders, custom lighting models, and image effects directly applies to the tasks a graphics programmer undertakes. Understanding ShaderLab and CG/HLSL is also critical for optimizing shaders and integrating them into rendering pipelines. Developing custom lighting models and image effects, as taught in the course, helps graphics programmers create cutting-edge visual experiences.
Game Developer
Game Developers are involved in all aspects of game creation, from design and programming to art and audio. Understanding shaders can significantly enhance a game's visual appeal and performance. This course helps game developers learn how to write custom shaders to achieve unique aesthetics and optimize rendering. By learning to program surface shaders, create image effects, and customize lighting models, game developers can gain greater control over the look and feel of their games. This course's practical examples, such as the dissolve shader and swaying plant sprite shader, directly demonstrate how to enhance a game's visual elements, making this learning particularly helpful. The course helps game developers stand out by creating distinctive visual styles.
Creative Coder
Creative Coders use programming to create art, interactive installations, and other innovative experiences. Shaders are a powerful tool for generating unique visuals. This course provides creative coders with the skills to leverage shaders in Unity for artistic expression. The syllabus's coverage of vertex and fragment shaders, image effects, and custom lighting models offers a wide range of options for creating visually interesting effects. The course's emphasis on practical application, such as creating a swaying plant sprite shader and a dissolve effect, allows creative coders to immediately apply their knowledge to their own projects. Coding shaders may help creative coders stand out from the competition.
3D Artist
3D Artists create the models, textures, and environments that make up the visual world of games and other applications. While they don't typically write shaders themselves, understanding shader capabilities helps them create assets that work well within the engine. This course helps bridge the gap between art and code, giving 3D artists a better understanding of how their creations will be rendered. Learning about different shader types, lighting models, and image effects helps 3D artists create assets that are optimized for the engine and achieve the desired visual look. The course is targeted for those who wish to use shaders.
XR Developer
XR Developer create immersive experiences for VR, AR, and MR platforms. Shaders play a crucial role in optimizing performance and creating realistic visuals in XR. This course may be useful for XR developers, as it provides a comprehensive introduction to shader programming in Unity. The syllabus's coverage of vertex and fragment shaders, image effects, and custom lighting models is relevant to XR development. Creating optimized and visually appealing environments is essential for successful XR experiences, and this course gives developers the tools to achieve this. By understanding ShaderLab and CG/HLSL, XR developers can effectively tailor shaders to the specific needs of XR hardware and software.
Virtual Reality Developer
Virtual Reality Developers create immersive experiences for VR platforms. Shaders play a crucial role in optimizing performance and creating realistic visuals in VR. This course may be useful for VR developers, as it provides a comprehensive introduction to shader programming in Unity. The syllabus's coverage of vertex and fragment shaders, image effects, and custom lighting models is relevant to VR development. Creating optimized and visually appealing environments is essential for successful VR experiences, and this course gives developers the tools to achieve this. By understanding ShaderLab and CG/HLSL, VR developers can effectively tailor shaders to the specific needs of VR hardware and software.
Augmented Reality Developer
Augmented Reality Developers build interactive experiences that overlay digital content onto the real world. Shaders are important for AR applications, as they can be used to create realistic visual effects and seamlessly integrate virtual objects into real-world environments. This course may be useful for AR developers, as it provides a comprehensive introduction to shader programming in Unity. The practical examples, such as the dissolve shader and swaying plant sprite shader, could be adapted to AR environments. Understanding ShaderLab and CG/HLSL helps AR developers to optimize shaders for mobile devices and achieve a seamless blend of virtual and real-world elements.
Simulation Developer
Simulation Developers create realistic simulations for training, research, and entertainment. Shaders play a key role in creating realistic environments and visual effects. This course may be useful for simulation developers, as it provides a comprehensive introduction to shader programming in Unity. The syllabus's coverage of vertex and fragment shaders, image effects, and custom lighting models is relevant to simulation development. By learning to write custom lighting models and image effects, simulation developers can create more realistic and immersive simulations. The course's emphasis on understanding Unity's ShaderLab helps simulation developers create detailed environments.
Mobile Game Developer
Mobile Game Developers create games specifically for mobile devices, where performance and battery life are critical. Shaders must be optimized to run efficiently on mobile hardware. This course may be useful for mobile game developers, as it helps them learn how shaders can be crafted for mobile games. The syllabus's coverage of vertex and fragment shaders, image effects, and custom lighting models is relevant to mobile development. Understanding ShaderLab and CG/HLSL helps mobile developers to optimize shaders for mobile devices. By learning to write custom lighting models and image effects, mobile game developers can create visually appealing games that run smoothly on mobile hardware.
Game Designer
Game Designers are responsible for the overall vision and mechanics of a game. While they may not directly code shaders, understanding shader capabilities can significantly inform their design decisions. This course may give game designers insights into the possibilities of shader-driven visual effects, enabling them to create more compelling and visually rich game experiences. Seeing how shaders can be used to create unique lighting, image effects, and material properties can inspire new game mechanics and art styles. This knowledge can lead to more effective collaboration with programmers and artists, resulting in a more cohesive and visually appealing final product.
Software Engineer
Software Engineers design, develop, and test software applications. While not always directly involved with shaders, understanding graphics programming can broaden their skill set and open up new opportunities in game development or other visual applications. This course may be useful for software engineers, as it provides a comprehensive introduction to shader programming in Unity. The syllabus's coverage of vertex and fragment shaders, image effects, and custom lighting models can be valuable for those interested in graphics programming. The course's coverage of programming concepts helps software engineers understand different aspects of game development.

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 Coding in Unity: Introduction to Shaders.
Provides a comprehensive guide to Cg, a shading language closely related to HLSL. It covers the fundamentals of shader programming and provides practical examples. While slightly dated, it remains a valuable resource for understanding the core concepts behind shader development. It is especially useful for understanding the underlying principles of vertex and fragment shaders.
Comprehensive resource on real-time rendering techniques, including shader programming. It covers advanced topics such as lighting, shadows, and global illumination. It is more valuable as additional reading than as a current reference. This book is commonly used as a textbook at academic institutions and by industry professionals.

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