Example shaders
How you write custom shadersA program that runs on the GPU. More info
See in Glossary in Unity depends on the render pipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. Glossary in Unity depends on the render pipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary you use:
- For guidance and examples for the Built-in Render Pipeline, see Example shaders for the Built-in Render Pipeline.
- For guidance and examples for the the Universal Render Pipeline (URP), see URP: Writing custom shaders.
- It is not recommended to write your own shader programs for HDRP, due to the complexity of the code. Instead, use Shader Graph to create Shader objectsAn instance of the Shader class, a Shader object is container for shader programs and GPU instructions, and information that tells Unity how to use them. Use them with materials to determine the appearance of your scene. Shader Graph to create Shader objectsAn instance of the Shader class, a Shader object is container for shader programs and GPU instructions, and information that tells Unity how to use them. Use them with materials to determine the appearance of your scene. More info
See in Glossary without writing code.
- For an example of a simple vertex and fragment shader for a custom Scriptable Render Pipeline, see Creating a simple render loop in a custom render pipeline.