Wireframe support - Printable Version
+- AB4D Forum (https://forum.ab4d.com)
+-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4)
+--- Forum: Ab3d.DXEngine (https://forum.ab4d.com/forumdisplay.php?fid=11)
+--- Thread: Wireframe support (/showthread.php?tid=4027)
Wireframe support - leonardo - 08-04-2017
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?
RE: Wireframe support - abenedik - 08-07-2017
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.