I have an object that will be rendered with a wireframe shader. This means that line between vertices in a model would be drawn.

The problem is that Unity automatically triangulates all n-gons in my models. I want these n-gons to render as is.

Is there a way to prevent this?


Unity supports the following MeshTopology types:

  • Triangles
  • Quads
  • Lines
  • LineStrip
  • Points

It does not, at the time of writing this answer, support topologies with 5 or more points per polygon.

To render a wireframe mesh containing pentagons or more complicated polygons, you can either...

  • Render it as a collection of lines using MeshTopology.Lines / LineStrip.
  • Render it as a solid surface, and use a suitable fragment shader to draw lines only along selected edges. (See other questions about drawing wireframe meshes for tips)

When you select your model, on the right hand side you can select an option that says "Keep Quads" enter image description here

  • \$\begingroup\$ Does not seem to work with n-gons for me \$\endgroup\$ – Alchemist Nov 12 '16 at 1:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.