剔除是确定不绘制什么的过程。剔除提高了渲染效率,因为不会浪费 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.
}
}
}