If the shader contains texture properties with non-standard names these should be added to the list of “Custom Shader Property Names”. An atlas will be created for each texture property found in this shader. MB3_TextureBaker has a list of names of common texture properties that it looks for in the Combined Mesh Material shader. A list of game objects with MeshRenderers or SkinnedMeshRenderers to be combined.A Texture Bake Result (MB2_TextureBakeResults).A Combined Mesh Material and set the shader on this material.Once this has been created then any mesh that uses the source materials can be added to the combined mesh, even meshes that were not included in the original texture bake. The MB3_TextureBaker creates atlas assets and a special Texture Bake Result asset that maps the source materials to UV rectangles in the atlases. These components can be used together or separately. A MB3_TextureBaker component and a MB3_MeshBaker component. Mesh Baker consists of two core components. If anything changes in any of your source models or textures, just bake again to regenerate the combined mesh and texture atlases. Once this has been done, you can remove the Mesh Baker object from the scene or keep it around for easy re-baking. (optional) Disable renderers in source objects.The mesh will be saved as an asset and assigned to the provided prefab. If you want to use the combined mesh in a prefab then select “output” -> “bake into prefab” (Create a prefab with an empty GameObject and drag it to the resultPrefab slot). The combined mesh is an instance (not an asset) so it can’t be used in a prefab. This will create the combined mesh and a new game object that uses it. In the MB3_MeshBaker component click ‘Bake’.This will create several MB3_MeshBaker components. If your meshes are distributed throughout the scene or clustered you may want to use the MB3_ClusterGrouper to group your meshes into multiple combined meshes. You may need to adjust non-texture properties in the combined material shader(s) to match the source material(s). Look at the combined material asset in the inspector to see that the generated atlases look correct. Look at warnings / errors in the console.Set any options then click ‘Bake Materials into a Combined Material’.Mesh Baker will build a texture atlas for each texture property in this shader (main, bump, specular etc…). Mesh Baker tries to duplicate the material settings on the first object in the list of objects to combine. Select shader on Combined Mesh Material.This will create material assets for the combined material(s) and also an MB2_TextureBakeResults asset that contains information mapping materials to UV rectangles in the atlases. Click ‘Create Empty Assets For Combined Material’.Use the provided tools to make this fast and easy. For best results, these should use the same shader(s), but they don’t have to. GameObject -> Create Other -> Mesh Baker -> TextureBaker & MeshBaker. If your source objects exceed 64k vertices use a TextureBaker & MultiMeshBaker
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |