What I’m trying to obtain is thesimultaneous rendering of both Solid+Wireframe like in 3DStudioMax
I just wanna ask your oppinions on this ideea :
- Draw the Smooth or Flat mesh
- Disable Depth Testing
- Draw with lines only those triangles that have a positive Z coordinateof the normal vector
- Enable Depth testing again
Is there a simpler or faster method?
What you usually do is:
- Render objects in solid mode.
- Enable GL_POLYGON_OFFSET (problem: the parameters for the offset may vary depending on a number of factors…).
- Render objects in wireframe.
- Disable GL_POLYGON_OFFSET.
This is actually a very easy way to do what you are looking for.
Thank you, but can you detail a bit THOSE FACTORS
The default parameters ,1.0 and 1.0, I believe work fine in most cases. You’ll have to experiment to determine what parameter values work best for your app.
I actually never had a problem with polygon offsets. I typically do:
Which is slightly different from what I explained in my previous post (i.e. I use polygon offset on the filled objects and not on the wireframe ones…).
I remember reading that you can get z-fighting between the solid/wireframe if you do not carefully choose the polygon offset parameters…
Don’t know more about it, sorry…
P.S.: if you search the forums for polygon offset, you’ll certainly find more.
Thanks alot, this is verry useful.