包含此页的版本:
不含此页的版本:
ZWrite设置深度缓冲区 保存图像中每个像素的 z 值深度的内存存储,其中 z 值是投影平面中每个呈现像素的深度。更多信息
请参阅术语表内容在渲染期间更新。通常,ZWrite对不透明对象启用,对半透明对象禁用。
禁用 ZWrite 可能会导致深度排序不正确。在这种情况下,您需要对 CPU 上的几何体进行排序。
此示例代码演示了在 Pass 块中使用此命令的语法。
Shader "Examples/CommandExample"
{
SubShader
{
// The rest of the code that defines the SubShader goes here.
Pass
{
// Disables writing to the depth buffer for this Pass
ZWrite Off
// The rest of the code that defines the Pass goes here.
}
}
}
此示例代码演示了在 SubShader 块中使用此命令的语法。
Shader "Examples/CommandExample"
{
SubShader
{
// Disables writing to the depth buffer for this SubShader
ZWrite Off
// The rest of the code that defines the SubShader goes here.
Pass
{
// The rest of the code that defines the Pass goes here.
}
}
}