DIrectX 9 Woes...

Published January 18, 2006
Advertisement
I got a DirectX 9 Driver up and running, but I am having an issue rendering with a vertex buffer. I wrote a caching system that uses 1 dynamic vertex buffer and keeps track of each brush using a vector of a struct that contains the following information:

1. Starting vertex in the VB
2. Number of primitives
3. Number of texture layers
4. The texture array
5. Rendering flags (Alpha blending, Z buffer stuff, ...)

Before DrawPrimitive() is called, I sort the brushes by texture. The Flush() function only changes texture if the texture id is different from the previous one. I am using triangle fans to render as the engine is optimized for that right now.

The original way I did it worked, but was unoptimal. I originally just filled the vertex buffer with the one brush then called DrawPrimitive(). When I switched to the new way, I get a "polygon soup". In otherwords, the level looks exploded. If I figure it out, version 1 of my driver is done. Next step would be to get the world into 1 static vertex buffer.

Old Way (one brush then flush vertex buffer):



New way (fill dynamic vertex buffer, render using saved brush data):
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement