x


Show polygons/vertexes in game

I want to be able to show the vertexes so that the polygons of a mesh are highlighted while in game view. This would look that same as when you click on a game object while in the editor scene view.

Preferably there is a way to do it through unity commands since it is already written for the editor. Otherwise, how would I approach this through a shader? Could it be done in the strumpy shader editor?

more ▼

asked Aug 02 '12 at 03:23 AM

tobobox gravatar image

tobobox
8 4 7 9

I just found the following thread: http://answers.unity3d.com/questions/144693/wireframe-rendering.html

but it doesn't appear to work on unity 3.5. Also I would prefer something like an image effect. That way it would alter the entire scene rather then just one object.

Aug 02 '12 at 02:50 AM tobobox

There's no Unity command; actually there are a lot of things for the editor that don't work in a build (probably why the editor is substantially larger than the engine in a build). An image effect couldn't really work...there's edge detection, but that's not the same thing.

Aug 02 '12 at 03:32 AM Eric5h5

so is the only approach to personally write a script that draws a line on the boarder of every polygon? or is there a way to address this as an image effect?

Aug 02 '12 at 05:19 AM tobobox

You don't have to write the script yourself; I've done that with Vectrosity, which can make wireframes of any given mesh with one command. It doesn't do hidden line removal though.

Aug 02 '12 at 05:43 AM Eric5h5

I want to be able to overlay this on top of my rendered materials. Since Vectrosity doesn't handle hidden line removal you would see all vertex in a scene on top of the materal right?

Aug 02 '12 at 02:52 PM tobobox
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The direct answer: there is no easy way to do this using shades or the gpu. Basically there are two options... Build this from scratch or build it using Vectrosity (a paid plugin). Vectrosity does seem like a powerful plug in but I've yet to use it.

Writing the wireframe script from scratch would entail using the cpu to analyze each individual polygon and draw a line on all edges. There appears to not be a way to accomplish this via a shader. Vectrosity has a ready built script that will draw lines for every poly edge but there is no depth checking. This means you see every edge in the scene overlaid on top of each other with equal line weight. If you are overlaying the lines on top of your textures this is less of an issue since the textures will block your view of distant lines. Otherwise this can get visually confusing. I'm not sure what the performance hit of this Vectrosity script will be. I believe it uses a completely separate camera (ie render cycle) and it sounds like a lot of cpu based calculation is needed if your scene has a fair amount of poly. That being said, the Vectrosity Web player examples run nice and smoothly.

more ▼

answered Aug 19 '12 at 01:25 PM

tobobox gravatar image

tobobox
8 4 7 9

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1650
x4

asked: Aug 02 '12 at 03:23 AM

Seen: 552 times

Last Updated: Aug 19 '12 at 01:25 PM