AB4D Forum

Full Version: Wireframe support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I need to display my 3D model with wireframe mode.

Using Ab3d.DirectX.Materials.LineMaterial I managed to do it but hidden lines are visible. There is a way to show only standard lines without drawing model two times? Maybe a shader solution?

Thank you
Leonardo
The most efficient way to hide the hidden lines is to render the object two times: once with wireframe and then as solid object (usually with a background color). This way you can use the graphics card to use depth buffer to remove the hidden lines and this is very fast.

I know that there are some algorithms that can calculate the visible parts of the lines. But I imagine that this algorithm can be quite complex and should be done on CPU each time camera or lines are changed. This would be surely more time consuming that rendering all the objects twice.