剔除是确定不绘制哪些内容的过程。通过不浪费 GPU 时间绘制最终图像中不可见的内容,剔除可以提高渲染效率。
默认情况下,GPU 执行背面剔除;这意味着它不会绘制远离观察者的多边形。通常,越能减少渲染工作负荷越好;因此,你应仅在必要时更改此设置。
Shader "Examples/CommandExample"
{
SubShader
{
// The rest of the code that defines the SubShader goes here.
Pass
{
// Disable culling for this Pass.
// You would typically do this for special effects, such as transparent objects or double-sided walls.
Cull Off
// The rest of the code that defines the Pass goes here.
}
}
}