使用替身图
When the scene contains a lot of objects that should be visible at large distances, the application performance suffers. To reduce the number of such objects, impostors are used. They allow speeding up geometry rendering while saving visual fidelity: each impostor repeats transformation and appearance of the original object.当场景包含许多应在远距离可见的对象时,应用程序性能会受到影响。为了减少此类对象的数量,使用了冒号。它们可以在节省视觉保真度的同时加快几何渲染速度:每个替身图都重复原始对象的变换和外观。
UNIGINE provides the Impostors Creator tool that allows generating impostors for a single object or for objects baked into a Mesh Clutter.UNIGINE 提供了Impostors Creator工具,该工具可为单个对象或烘焙到Mesh Clutter中的对象生成替身图。
For example, you can replace the distant trees with impostors to optimize forest rendering:例如,您可以使用替身图替换远处的树木,以优化森林渲染:
1. Grabbing Impostors1.抢夺替身图#
To grab impostor with the Impostors Creator tool, perform the following:要使用Impostors Creator工具抓住替身图,请执行以下操作:
- In the Menu Bar, choose Tools -> Impostors Creator. The Impostors Creator tool will open.
在菜单栏中,选择Tools -> Impostors Creator。的Impostors Creator工具将打开。 - In the World Hierarchy window, choose a single mesh or a clutter, for which an impostor should be created.
注意Impostors can be generated only for Mesh Clutter objects, World Clutter isn't supported.在里面World Hierarchy窗口中,选择要为其创建替身图的单个网格或杂波。Impostors can be generated only for Mesh Clutter objects, World Clutter isn't supported.Impostors can be generated only for Mesh Clutter objects, World Clutter isn't supported.注意Impostors can be generated only for Mesh Clutter objects, World Clutter isn't supported.伪造者只能为Mesh Clutter个对象生成,不支持World Clutter。
-
In the Impostors Creator window, specify the required textures and settings.在里面Impostors Creator窗口中,指定所需的纹理和设置。
We recommend selecting the Octahedral impostor type as a more advanced approach to creating impostors.我们建议选择Octahedral类型的替身图,作为一种更高级的生成方法。
注意If you are going to generate the impostors for vegetation, you should specify For Vegetation option for textures (where available).如果要生成植被的替身图,则应为纹理指定For Vegetation选项(如果可用)。 - Click Create and specify a name for textures in the file dialog window that opens.单击Create,然后在打开的文件对话框窗口中为纹理指定名称。
The generated impostor(s) will be added as a child node to the original mesh/clutter:生成的替身图将作为子节点添加到原始网格/杂波中:
-
For objects baked into the clutter, the Mesh Clutter object with the <node_name>_impostor_material will be added. All required settings will be copied from the original Mesh Clutter automatically.对于烘焙到clutter中的对象,将添加一个带有<node_name>_impostor_material材质的Mesh Clutter对象。所有所需设置将自动从原始Mesh Clutter对象复制。
Real Clutter Objects and Its Impostors in Scene场景中的真实杂物及其伪装者Objects and Impostors Wireframes对象和假名线框 -
For a single object, the Mesh Static object with the material inherited from <node_name>_impostor_material will be added.对于单个对象,将添加一个Mesh Static对象,并继承<node_name>_impostor_material材质。
Real Object (left) and Its Impostor (right) in Scene场景中的真实对象(左)及其伪装者(右)Object and Impostor Wireframes对象和假名线框
2. Setting Up Impostor Material2.设置替身图材质#
All textures specified in the Impostors Creator are generated in the data folder and applied in the material automatically. The impostor material may require additional set up: Impostors Creator中指定的所有纹理均在data文件夹中生成,并自动应用于材质中。冒充者的材质可能需要其他设置:
- If you grab only the Albedo and Normal textures, you will have to manually set up the other shading parameters of the impostor material (Specular, Translucence, etc.), so that the impostor visually match the original object. However, if the original object has several surfaces with different shading, the impostors may significantly differ (so it is better to grab all textures in this case).如果仅获取Albedo和Normal纹理,则必须手动设置替身图材质的其他着色参数(Specular, Translucence等),以便替身图在视觉上与原始对象匹配。但是,如果原始对象的多个表面具有不同的阴影,则替身图可能会显着不同(因此,在这种情况下最好抓取所有纹理)。
- For vegetation impostors, the Specular parameter should be set to 0 to avoid unnecessary specks on trees.对于植被替身图,应将Specular参数设置为 0 ,以避免在树上产生不必要的斑点。
- If you simply want to improve visual representation of impostors, you can adjust shading parameters (for example, increase Translucence for trees impostors and so on).如果您只是想改善替身图的外观,则可以调整阴影参数(例如,为树木替身图增加Translucence等)。
本页面上的信息适用于 UNIGINE 2.20 SDK.