包含此页的版本:
不含此页的版本:
要使用着色器在 GPU 上运行的程序。更多信息
请参阅术语表在递延渲染路径渲染管道用于渲染图形的技术。选择不同的渲染路径会影响照明和着色的计算方式。某些渲染路径比其他路径更适合不同的平台和硬件。更多信息
请参阅术语表,将UniversalGBuffer标记添加到您的ShaderLabUnity 用于定义 Shader 对象结构的语言。更多信息
请参阅术语表法典。Unity 在 G 缓冲区渲染通道期间执行着色器。
例如:
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalGBuffer"
}
// The rest of the code that defines the Pass goes here.
}
}
}
要在延迟渲染路径中使用着色器,请将UniversalForwardOnly和DepthNormalsOnly标签添加到 ShaderLab 代码中的 Pass 中。Unity 在 G 缓冲区渲染通道期间执行着色器。
例如:
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags {
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalForwardOnly"
"LightMode" = "DepthNormalsOnly"
}
// The rest of the code that defines the Pass goes here.
}
}
}
要将着色器光照模型指定为 Lit 或 Simple Lit,请使用UniversalMaterialType标记。例如:
Shader "Examples/ExamplePassFlag"
{
SubShader
{
Pass
{
Tags
{
"RenderPipeline" = "UniversalPipeline"
"LightMode" = "UniversalGBuffer"
"UniversalMaterialType" = "Lit"
}
// The rest of the code that defines the Pass goes here.
}
}
}