Home Technical Talk

Displaying quad wireframe in WebGL like Maya(?)

Nexidian
null
Offline / Send Message
Nexidian null
Hey guys, 

I have been working on a 3d model viewer, like Sketchfab, in my spare time to learn some more about tech art, as well as building up my portfolio. It is going quite well so far but i have run into an issue. 

This is what my model viewer currently looks like, with the wire-frame enabled. 



I am using ThreeJS to load the model into the browser, and then loading in a duplicate, with the wireframe flag set. I have noticed that my model's wireframe is being shown in tris, but i would rather this be in quads, much like how Maya and other 3D modelling software do e.g.



Sadly, ThreeJS has dropped support for Face4. What i would like is to be able to write a shader that would only render the edges of a mesh and not the diagonal intersection lines. If i could achieve the results within a shader it would eliminate my need to load the same model twice, and it would also give me some control over the thickness or color of the lines for example.


Actual question(s):

Would anyone be able to advise me/point me in to the direction of how to create a shader that will only render the lines of a mesh?

Is this how Maya achieves its result? by rendering as tris but just ignoring the intersection that makes up the two tris for a quad? 

I appreciate this post might be a bit vague, so if you have any need for further information please let me know :) 

Thanks in advance.

Replies

Sign In or Register to comment.