|
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?
(comments are locked)
|
|
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.
(comments are locked)
|

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.
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.
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?
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.
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?