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 Mesh class now will have 2 additional extension methods:
Generates new mesh with wireframe data baked inside uv4 buffer (inside shader uv4 coordinate 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.
useGeometryShader – If enabled, wireframe texture is generated using GeometryShaders and the source mesh does not need to have wireframe data baked inside it. For run-time use, project must include Amazing Assets/Wireframe Shader/Texture Exporter file into the build.
if useGeometryShader option is false then texture is generated based on the wireframe data baked inside the source mesh.
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.
resolution - Texture resolution. Must be power of 2, in the range of 16 – 8192.