As covered in the documentation, triangle fans not supported in Direct3D 10 or later.
Why? Are there inherent drawbacks to working with triangle fans?
As covered in the documentation, triangle fans not supported in Direct3D 10 or later.
Why? Are there inherent drawbacks to working with triangle fans?
For well over a decade hardware vendors have been pushing triangle strips, indexed triangle lists and indexed triangle strips as the fastest primitive types to use. Why? Strips have better cache locality (reusing the last 2 verts submitted instead of having to continually jump back to the first one) and indexing allows hardware vertex caches to actually work, as well as being more effective for eliminating duplicate verts.
If all hardware vendors say "do it this way and you're going to be faster" then there's a pretty good chance that if you do it this way you actually will be faster.
So D3D10+ just formalizes this; if that's the fast path then that's the path you're going to use and other paths won't exist. This is in keeping with one of the design philosophies of D3D10+, which is to put you onto the fast path and keep you there.
I do not know how much this actually affects the development but as with any such changes, it's been told that they will let driver developers write better drivers. The complexity of GPU drivers is amazing but I'm not sure if this exact change will help much.
In either case, it's possible to replace triangle fans for most of your needs (like convex polygon rendering) with strips, often with better results.
// A simplified API interface is presented for the purposes of having readable pseudocode
// Push( pos ) - pushes position data to make a new vertex
// TRIANGLE FANS:
for( i = 0; i < vertices.count; ++i )
Push( vertices[ i ] );
// TRIANGLE STRIPS:
for( i = 0; i < vertices.count; ++i )
{
if( i % 2 == 0 )
vertex = i / 2;
else
vertex = vertices.count - 1 - i / 2;
Push( vertices[ vertex ] );
}
EDIT: forgot to mention - if you need to change winding order - just reverse the test in that "if" (== to !=).
(This particular question warrants an opinion answer:)
Subjectively, I'd say its architecture astronauticism. OpenGLES also threw-out lots of stuff to make it 'less complex' whilst actually just pushing complexity onto each and every developer with legacy code instead.
Of course, even when the hardware doesn't support it natively it would have been trivial to provide compatibility with people sequencing triangle fans by converting them to strips or triangles.
WebGL run-times and such have to keep track of validated buffers and such all the time, and drivers could easily manage people sending them fans despite them not supporting it.
So the whole throwing out of FFP and such is just a big annoyance IMO.