Rasagar/Library/PackageCache/com.unity.render-pipelines.universal/Documentation~/shaders-in-universalrp.md
2024-08-26 23:07:20 +03:00

2.5 KiB
Raw Permalink Blame History

uid
urp-shaders-in-universalrp

Shaders and Materials

URP provides the following Shaders for the most common use case scenarios:

Shader compatibility

Lit and custom Lit shaders written for the Built-in Render Pipeline are not compatible with URP.

Unlit shaders written for the Built-in Render Pipeline are compatible with URP.

For information on converting shaders written for the Built-in Render Pipeline to URP shaders, refer to the documentation on Converting your shaders.

Choosing a shader

The Universal Render Pipeline implements Physically Based Rendering (PBR).

The pipeline provides pre-built shaders that can simulate real world materials.

PBR materials provide a set of parameters that let artists achieve consistency between different material types and under different lighting conditions.

The URP Lit shader is suitable for modeling most of the real world materials. The Complex Lit shader is suitable for simulating advanced materials that require more complex lighting evaluation, such as the clear coat effect.

URP provides the Simple Lit shader as a helper to convert non-PBR projects made with the Built-in Render Pipeline to URP. This shader is non-PBR and is not supported by Shader Graph.

If you dont need real-time lighting, or would rather only use baked lighting and sample global illumination, choose a Baked Lit Shader.

If you dont need lighting on a Material at all, you can choose the Unlit Shader.

SRP Batcher compatibility

To ensure that a Shader is SRP Batcher compatible:

  • Declare all Material properties in a single CBUFFER called UnityPerMaterial.
  • Declare all built-in engine properties, such as unity_ObjectToWorld or unity_WorldTransformParams, in a single CBUFFER called UnityPerDraw.

For more information on the SRP Batcher, refer to the documentation on the Scriptable Render Pipeline (SRP) Batcher.