非常重要的一点是在创建你的物体时要随时注意,因为你需要在物体的尺寸和单元的尺寸间取得一个好的平衡.理想情况下, you shouldn't have cells that are too small in comparison with your objects but equally you shouldn't have objects that cover many cells.有时你可以通过将大的物体拆成几个部分来改进遮挡剔除效果.无论如何你仍然能够将小的物体合并为一体来降低draw calls,在它们都属于一些小的组件的时候, occlusion culling将不起作用.确定组件中那个是可视的组件的选集和可视信息被认为是PVS (潜在可视状态Potentially Visible Set).
Selecting Target (moving objects) or View (static objects)让你御览calculated data的运作.
Testing the generated occlusion
occlusion设置完毕后,打开Cull Geometry option (in the Occlusion Culling window)并在场景视窗移动Main Camera.
iScene View中的Occlusion View mode
当你在周围移动Main Camera (无论是否在Play mode下),你将会看到不同的物体disable.你在这里需要找出的是occlusion data中的任何错误.当你移动摄像机时你可能会发现会有物体突然出现在视野当中.如果这种情况发生, your options for fixing the error are either to change the resolution (if you are playing with target volumes), or to move objects around to cover up the error. To debug problems with occlusion, you can move the Main Camera to the problematic position for spot-checking.
网友评论