使用冒名顶替者
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中的对象生成冒名顶替者:
- In the first case, the billboards-based impostor will be rendered instead of the real object.在第一种情况下,将呈现基于基于广告牌的冒名顶替者,而不是真实对象。
- In the second case, the Grass object will be rendered instead of the Mesh Clutter.在第二种情况下,将呈现Grass对象而不是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.Impostors can be generated only for Mesh Clutter objects, World Clutter isn't supported.
- If you choose a mesh, a single impostor represented by the Billboards object will be generated.If you choose a mesh, a single impostor represented by the Billboards object will be generated.
- If you choose a clutter, impostors for all clutter objects represented by the Grass object will be generated.If you choose a clutter, impostors for all clutter objects represented by the Grass object will be generated.
Impostors can be generated only for Mesh Clutter objects, World Clutter isn't supported.伪造者只能为Mesh Clutter个对象生成,不支持World Clutter。- If you choose a mesh, a single impostor represented by the Billboards object will be generated.如果选择网格,则会生成由 将生成由Billboards对象表示的单个冒名顶替者。
- If you choose a clutter, impostors for all clutter objects represented by the Grass object will be generated.如果选择杂波,则将生成由Grass对象代表的所有杂波对象都将生成。
- In the Impostors Creator window, specify the required textures and settings.
If you are going to generate the impostors for vegetation, you should specify For Vegetation option for textures (where available).在里面Impostors Creator窗口中,指定所需的纹理和设置。If you are going to generate the impostors for vegetation, you should specify For Vegetation option for textures (where available).If you are going to generate the impostors for vegetation, you should specify For Vegetation option for textures (where available).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 Grass object with the material inherited from grass_impostor_base will be added. All required settings will be copied from the original Mesh Clutter to the Grass object automatically.
Real Clutter Objects and Its Impostors in SceneReal Clutter Objects and Its Impostors in SceneObjects and Impostors WireframesObjects and Impostors WireframesReal Clutter Objects and Its Impostors in Scene场景中的真实杂物及其伪装者Objects and Impostors Wireframes对象和假名线框
- For a single object, the Billboards object with the material inherited from billboards_impostor_base will be added.
Real Object (left) and Its Impostor (right) in SceneReal Object (left) and Its Impostor (right) in SceneObject and Impostor WireframesObject and Impostor WireframesReal 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等)。