Rendering geometry in wireframe

Started by
2 comments, last by lukesmith123 12 years, 1 month ago
Hi,

I'm rendering some geometry in directx9 with the DrawIndexedPrimitive function by passing in the number of verts indices etc, using the triangle list primitive.

I want to render the geometry in wireframe using the line list or line strip primitive but I cant figure out how to do this.

I dont know what to put into the prim count paramater.

Could anybody explain how to do this?


thanks,
Advertisement
Easier to just use SetRenderState (D3DRS_FILLMODE, D3DFILL_WIREFRAME) - that will give you a wireframe representation and you don't need to change any of your geometry, primitive types, etc.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Actually, my experience has been that wireframe fill mode is sometimes dramatically slower, because the driver rewrites the geometry as lines. (This was more an ATI problem way back). Test it. It's okay for debugging, but you may want to create a separate index buffer for wireframe if it is an important part of your rendering.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Oh good idea thanks, its just for debugging so the performance thing isnt a biggie.

This topic is closed to new replies.

Advertisement