T.TAO
Back to Blog
/2 min read/Others

URP #1 Universal Lit & URP ShaderLab

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