Quick Start
Last updated
Last updated
For achieving lowpoly style effect, mesh needs to have flattened surface normals and color texture (by default Diffuse map) rendered per vertex.
For generating lowpoly style meshes inside Unity Editor, open Lowpoly Style Mesh Generator editor window from the Main Toolbar → Window → Amazing Assets menu:
Editor window saves its settings before closing and restores them after opening it again, and before new use it is always better to reset its settings to the default values using right click Context Menu → Reset option:
Drag & drop objects from the Hierarchy window or prefab/meshes from the Project window inside LSMG editor window:
Objects will be added to the conversion list:
For baking texture into mesh vertex color, inside Solver group click on the Texture #1 drop down menu and choose the _MainTex property. This is a texture property name inside shader used by object's material for texture rendering. During converting mesh into lowpoly style LSMG reads texture from material used by mesh using this property name and bakes it inside mesh vertex color:
Texture property names listed in this menu depends on the shaders used by objects in the conversion list. Choose texture property name that is used by the Diffuse maps rendering inside materials.
After choosing bake texture property name, conversion list will display if materials used by selected objects have such texture property:
Click on the Run button at the bottom of the editor window.
Instead of generating multiple meshes, LSMG editor tool can combine all meshes inside object hierarchy into one mesh and such way only one draw call will be used for their rendering.
Inside Generate group select Combine Everything and click on the Run button again:
Now instead of generating and rendering 117 meshes, only 7 meshes will be generated - one mesh for each object in the conversion list.
Additionally, if group all scene meshes under one object's hierarchy, then LSMG tool can combine them all into one mesh and entire scene can be rendered using by one mesh, one material and one draw call:
Using the right click Context Menu → Highlight Last Saved File option, navigates Projects window to the folder where generated files are saved. It should contain mesh, material and prefab asset files:
Those are all files used by rendering current example scene. No other materials or textures are used and total size of those assets should be about 1.8 MB. It is possible to optimize meshes and reduce generated files size.
One way is to set Mesh Compression to the High value (not recommended), but the better options is to remove unwanted and unused vertex attributes from the generated mesh:
Generated mesh inherits all vertex attributes from the source mesh, and some of them may not be needed any more, for example tangent attribute is used in shaders for Normal/Bump effect rendering and if lowpoly mesh doesn't need such effect then tangent attribute can be removed from it:
Select Attributes dropdown menu, disable Default checkbox there (this enables to manually choose attributes) and remove checkbox for the Tangent:
Click on the Run button and check generate asset files size, it should be about 30% less:
If lowpoly meshes will be rendered only with Unlit vertex color shaders, then normal and uv attributes can be removed too, this reduces generated file size even more.
Be cautious when removing attributes from the mesh, ensure they are never needed.
Package included Preview shader used for vertex color rendering of the generated lowpoly meshes is a Lit shader and requires mesh normal attribute. Without it, the shader renders the mesh in black.
For example highlighted Ground object contains 1 mesh ( in this case) with 1 submesh. Vertex count of its mesh is 625 and triangles count 1,152. Generated lowpoly style mesh will have 3,456 vertices, that is 3 times more than the triangles count: 1,152 x 3 = 3,456 (452% more than in the source mesh). Triangles count will remain the same.
depends on the vertex count and if it exceeds 65,535 than 32Bit mesh is generated.
The editor tool will generate lowpoly style meshes with texture baked inside their vertex colors for all objects in the conversion list, replace all source meshes inside and components with newly generated lowpoly meshes and new material (for vertex color rendering) in the components. Based on all those actions new prefab asset file will be created and instantiated in the scene, in the same position as the source objects.