Run-time API
Last updated
Last updated
Run-time API for calculating wireframe data for a mesh or generating wireframe texture can be brought into scope with this using directive
Unity class now will have 2 additional extension methods:
Generates new mesh with wireframe data baked inside storeInside vertex buffer (by default it is UV3 buffer and inside shader it is read using TEXCOORD3 semantic). Resultant mesh is in 16 bit index buffer format if it has less than 65,535 vertices, otherwise mesh uses 32 bit index buffer format.
Generates wireframe texture.
textureResolution - Texture resolution. Must be power of 2, in the range of 16 – 8192.
solver - Generates wireframe texture dynamically using (WireframeShaderEnum.Dynamic value) or reads wireframe data baked inside mesh (WireframeShaderEnum.Prebaked value).
readBakedWireframeFromAttribute - In the case of using WireframeShaderEnum.Prebaked solver, defines mesh vertex attribute where wireframe data is baked.
submeshIndex - Index of a submesh for which is rendered wireframe texture. Using -1 bakes all submesh's wireframe data into one texture.
normalizeEdges – Wireframe triangle edges will be approximately of the same size.
tryQuad – Renders wireframe in quad shape instead of a triangle. Result highly depends on a mesh vertex & triangle layout.
thickness/smoothness – Wireframe edge size (thickness) and its smoothness.
If using WireframeShaderEnum.Dynamic solver in the builds, make sure Amazing Assets/Wireframe Shader/Wireframe Texture Generator shader is included in the build and target device supports .