Occluder Mesh
Occluder Mesh is an occluder which is based on an arbitrary mesh. Occluder Mesh is used to cull objects' surfaces, bounds of which are not visible behind it. The surfaces behind the occluder are not sent to the GPU, thereby saving performance.Occluder Mesh是基于任意网格的遮挡物。 Occluder Mesh用于剔除对象的表面,其后部的边界不可见。封堵器后面的表面不会发送到GPU,从而节省了性能。
- If any part of the bound of the object's surface is visible behind the occluder, the surface will not be culled.如果在遮挡物后面可以看到对象表面边界的任何部分,则该表面将不会被剔除。
- By default, shadows from the occluded objects remain visible. To disable shadows rendering, run the console command render_occluders_shadows 1.默认情况下,被遮挡对象的阴影保持可见。要禁用阴影渲染,请运行控制台命令render_occluders_shadows 1。
See also也可以看看#
- General information on Occluder有关Occluder的一般信息
- The WorldOccluderMesh class to manage mesh occluders via APIWorldOccluderMesh类,用于通过API管理网格遮挡物
- The sample <UnigineSDK>/data/samples/worlds/occluder_01样本<UnigineSDK>/data/samples/worlds/occluder_01
Creating Occluder Mesh创建遮挡物网格#
Before adding Occluder Mesh to a scene, you should prepare a mesh, on which this Occluder Mesh will be based. Such mesh is created separately and should be as simple as possible: it should contain the minimum number of polygons.在将Occluder Mesh添加到场景之前,您应该准备一个网格,该Occluder Mesh将基于该网格。此类网格是单独创建的,并且应尽可能简单:它应包含最少数量的多边形。
When the mesh is prepared, you can add Occluder Mesh to the scene via UnigineEditor:准备好网格物体后,可以通过UnigineEditor将Occluder Mesh添加到场景中:
- Run the project with UnigineEditor.跑步UnigineEditor的项目。
-
On the Menu bar, click Create -> Optimization -> Occluder Mesh.在菜单栏上,单击Create -> Optimization -> Occluder Mesh。
- In the file dialog window, choose a mesh (*.mesh), on which the occluder will be based.在文件对话框窗口中,选择遮挡物将基于的网格(*.mesh)。
- Place the Occluder Mesh in the world and specify the required parameters for it.将Occluder Mesh放置在世界上,为其指定所需的参数。
Example例子#
For example, if you have a building that occludes some objects' surfaces, you should prepare a simplified mesh to be used as a base for the Occluder Mesh instead of using the detailed mesh.例如,如果您的建筑物遮挡了某些对象的表面,则应准备一个简化的网格作为Occluder Mesh的基础,而不要使用详细的网格。
Editing Occluder Mesh编辑遮挡物网格#
In the Node tab of the Parameters window, you can adjust the following parameters of Occluder Mesh:在Parameters窗口的Node选项卡中,可以调整Occluder Mesh的以下参数:
Distance |
Distance between the camera and the bounding box of the occluder, exceeding which the Occluder Mesh becomes disabled.相机与遮挡物边界框之间的距离,超过该距离将禁用Occluder Mesh。 For example, you should disable the occluder at a certain distance if it stops hiding the objects and their surfaces, in order to increase performance.例如,如果阻塞器停止隐藏对象及其表面,则应在一定距离处禁用它,以提高性能。 By default, the inf value is used.默认情况下,使用inf值。 |
---|
Loading a New Mesh加载新的网格#
To load a new mesh on which Occluder Mesh will be based:要加载将基于Occluder Mesh的新网格,请执行以下操作:
- In the World Occluder Mesh section of the Node tab, press .在Node选项卡的World Occluder Mesh部分中,按。
- In the file dialog window that opens, choose the required mesh and press OK.在打开的文件对话框窗口中,选择所需的网格,然后按OK。
Saving the Current Mesh保存当前网格#
To save the current mesh on which the occluder is based:要保存封堵器所基于的当前网格,请执行以下操作:
- In the World Occluder Mesh section of the Node tab, press .在Node选项卡的World Occluder Mesh部分中,按。
- In the file dialog window that opens, specify a name for the mesh and press OK.在打开的文件对话框窗口中,为网格指定名称,然后按OK。