PDA

View Full Version : How to back-Culling in wireframe mode between meshes?



lemta2000
07-08-2012, 04:10 AM
Hello,
I have a problem with back-culling in wireframe between meshes. This is I can do in opengl:

http://postimage.org/image/ve6w5k6u7/

But I want to like below:
http://postimage.org/image/fh848uefz/

Any suggestion?
Thanks for help!

Ilian Dinev
07-08-2012, 10:27 AM
Do a depth-only render with the objects being solid. You might need to add some depth-bias to the wireframe pass afterwards.

mfort
07-08-2012, 12:23 PM
Or draw your geometry with special shader that emulates wireframe mode.

see this:
http://developer.download.nvidia.com/SDK/10.5/direct3d/Source/SolidWireframe/Doc/SolidWireframe.pdf

NVIDIA provided DirectX source code. Porting to OpenGL is trivial. Work pretty well for me.
The paper looks quite complicated but in the end it is just a few lines of code in geometry and fragment shader.