3
\$\begingroup\$

I've discovered that I managed to program a series of boxes with indexed vertices in such a way that every other triangle (Half of each face) has a backwards winding order.

As a result, XNA is culling half of them.

However, my Vertex objects contain normal data that I have explicitly set, and I am going to implement my own backface culling shortly to reduce the size of the VertexBuffer.

Should I turn off winding order culling and manage it myself, or should I make sure the winding order is consistent and let XNA handle it?

\$\endgroup\$

1 Answer 1

6
\$\begingroup\$

you won't be able could cull backfaces any where near as quick as the GPU. Especially if you are modifying or recreating the vertex buffer or index buffer on frame-by-frame basis.

I would either;

  1. turn off backface culling (at least for the boxes) and live with the extra triangles being drawn (it'll still be much, much faster than your custom backface culling)

  2. fix your winding order

\$\endgroup\$
1
  • 1
    \$\begingroup\$ @Phil #2 for sure. It is one thing if you are using models in a format you cannot edit, but if you are creating the data yourself, fix it and let culling happen in hardware. \$\endgroup\$ Commented Nov 26, 2012 at 17:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .