文档

Unity Engine


User Manual

Script Reference

Unity Engine


Shader block in ShaderLab reference

Reference for the Shader block in ShaderLab.
阅读时间1 分钟最后更新于 1 个月前

A Shader object is a Unity-specific concept; it is a wrapper for shader programs and other information. It lets you define multiple shader programs in the same file, and tell Unity how to use them.
A Shader object has a nested structure; it organizes information into structures called SubShaders and Passes.
Inside the
Shader
block, you can:

Render pipeline compatibility

Feature name

Universal Render Pipeline (URP)

High Definition Render Pipeline (HDRP)

Custom SRP

Built-in Render Pipeline

ShaderLab: Shader blockYesYesYesYes

Syntax

Signature

Function

Shader "<name>"

{

    
<optional: Material properties>

    
<One or more SubShader definitions>

    
<optional: custom editor>

    
<optional: fallback>

}
Defines a Shader object with a given name.

Additional resources