T.TAO
Back to Blog
/2 min read/Technical Art

URP #1 Universal Lit & URP ShaderLab

#Unity#Shader#TechnicalArt
URP #1 Universal Lit & URP ShaderLab

#UnityEngine #UnityShader #GameEngine #TechnicalArt This note mainly covers how to upgrade Built-in RP shader files to URP files. Structure SubShader In Tags add new render pipeline...

#UnityEngine#ComputerGraphics#GameEngine#GameDevelopment#Shader

This series of blog posts is mainly about the URP (Universal Render Pipeline) in the Unity engine. Unity upgraded LWRP in version 2019.3, renaming it to URP, and has been promoting the use of URP for new projects. Although Built-in RP remains one of the mainstream render pipelines to this day, with the passage of time, URP—which offers greater flexibility—will eventually replace Built-in RP.

This note introduces Unity's URP pipeline in depth, starting from several built-in materials in Unity URP.

URP Built-in Shaders

In URP's material system, all built-in material shaders are now under the Universal Render Pipeline branch.

In this branch, we need to introduce four built-in shaders: Lit, Simple Lit, Baked Lit, and Unlit.

Lit

The Lit shader is the default shader used when creating a material in URP. The Lit shader handles lighting in a PBR (physically based rendering) manner and exposes a series of physical optical parameters to the user. It is the most user-friendly and fundamental shader in URP.

Simple Lit / Baked Lit

Simple Lit uses the Blinn-Phong model for shading; it is not physically based, but it requires fewer calculations and can therefore run on low-end devices.

Baked Lit is used when the project does not require real-time lighting and specular reflection effects. It is also not physically based—not even Blinn-Phong—but instead uses pre-baked lightmaps and light probes from Unity, so it does not support real-time lighting. It is faster than Simple Lit.

Unlit

Unlit does not interact with any lights, so it is the fastest Shader.

All of the above Shaders can be viewed in the project at Packages / Universal RP / Shaders, or you can click Edit in the Material's Inspector panel to view their internal details.

Lit Shader

We focus on understanding the structure of the Lit Shader, and we can also summarize the changes ShaderLab has made in URP through the Lit Shader structure.

Properties

SubShader

FallBack

URP ShaderLab

Include File Usage

In this series

Unity Shader →
  1. 01Unity Shader #0 Maths Basics
  2. 02Unity Shader #1 Render Pipeline
  3. 03Unity Shader #2 Code Basics
  4. 04Unity Shader #2.1 Basic Commands
  5. 05Unity Shader #3 URP Upgrade
  6. 06Unity Shader #4 Drawing Shapes on UV
  7. 07Unity Shader #5 Rim Light
  8. 08Unity Shader #6 Scan & Hologram
  9. 09Unity Shader #7 Anime Toon Shader
  10. 10Unity Shader #8 Dissolve
  11. 11Unity Shader #9 Raindrops on Lens
  12. 12Unity Shader #13 Post-Processing
  13. 13URP #1 Universal Lit & URP ShaderLab