Version: Unity 6.1 Alpha (6000.1)
Language : English
Shader in ShaderLab reference
Properties block reference in ShaderLab

Shader block in ShaderLab reference

A ShaderA program that runs on the GPU. More info
See in Glossary
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 objectAn 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
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 block Yes Yes Yes Yes

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

Shader in ShaderLab reference
Properties block reference in ShaderLab
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961