Quick Start
Last updated
Last updated
For wireframe rendering it is necessary to:
Calculate and bake wireframe data inside a mesh.
Use wireframe shader to read baked wireframe data from the mesh.
Package includes editor and run-time tools for calculating and baking wireframe data inside a mesh and collection of ready to use wireframe shaders.
If package included wireframe shaders are not enough, custom shaders can be made, or special wireframe rendering method can be easily integrated into any shader. Explained in more details in the Custom Shaders chapter.
As shader reads wirefarme data directly from a mesh, it doesn't do any calculations on the GPU, has no hardware requirements like GeometryShaders / Tessellation or others, doesn't need additional script attaching to a mesh and supports all devices from Mobile, WebGL and VR to Console and PC.
To bake wireframe data inside a mesh use Wireframe Mesh Creator tool from Main Toolbar → Window → Amazing Assets → Wireframe Shader menu:
Drag and drop objects with MeshFilter or SkinnedMeshRenderer from the Hierarchy window or prefab files (including folders) from the Project windows here or use Add Selected or Add Custom Prefab buttons.
After adding objects to the conversion list, click on the Run button.
Tool will calculate wireframe data for that mesh, creates and saves new mesh file with wireframe data baked inside it, sets up new prefab with wireframe material and instantiates it in the scene in the same position as the source object (if source object exists in the currently opened scene).
Prefab is ready to be used. Wireframe visual properties can be changed from the material.
For objects added to the conversion list, editor window displays two most useful information for the generated mesh: Wireframe Vertices count and Index format.
In the example above, Wireframe Vertices column displays that generated mesh will have 17,196 vertices, that is 256% increase compared to the source 4,817 vertices.
Why does vertex count increase? Wireframe data is generated per-triangle, and it is unique for each vertex there. As triangle consist of 3 vertices and each one needs to be unique, final generated mesh always will have 3 times more vertices than triangles count. In the example above source mesh has 5,732 triangles and wireframe mesh will have 3 times more vertices - accordingly 17,196. Triangles count is not changed.
Index column displays format of the generated mesh index buffer, that can be 16 bit (supports up to 65,535 vertices in a mesh), or 32 bit (supports up to 4 billion vertices).
More info about index format is here.
After closing editor window its settings are saved and reused when window is opened again. Use context menu to reset settings to their default values: