Device vertex buffers optimizations (WIP)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
delscorcho
Posts: 12
Joined: Tue Aug 23, 2005 10:26 pm

Device vertex buffers optimizations (WIP)

Post by delscorcho »

I added interfaces to Irrlicht that make it easy to create device-dependent vertex/index buffers.

With D3D, this allows the use of DrawIndexedPrimitive, as opposed to DrawIndexedPrimitiveUP. Basically, DrawIndexedPrimitiveUP, as documented by microsoft, always creates index and vertex buffers internally, every time it is called. So every time drawIndexedTriangleList is called in Irrlicht, you incur this overhead.

The new interface allows you to create the index/vertex buffers for a mesh once, making rendering significantly faster. I changed CMeshSceneNode to use this interface and create the buffers ahead of time. I've got more to do, but here're my initial findings:

Comparison/Benchmark
------------------------------
Mesh: 2000 polys

Benchmark: Render mesh 10 times per frame
Standard buffers: ~350 fps
With device buffers: ~480 fps
Improvement: ~38%


This is critical for me because I'm not targeting the world's best hardware. So far so good... 38% is pretty massive. Also note that the more meshes, the better the improvement.
Foole
Posts: 87
Joined: Mon Aug 29, 2005 10:08 am

Post by Foole »

Good work 8-) I hope this makes it into the next release!

Does it work with OpenGL? (glBindBufferARB/glBufferDataARB etc?)
delscorcho
Posts: 12
Joined: Tue Aug 23, 2005 10:26 pm

Post by delscorcho »

Nope... not yet. I'm not an OpenGL guru, so I'll do it for D3D8/9, and create the classes for Ogl. Someone is welcome to take it from there. Software obviously won't bother with this.

If the Irrlicht author is fine with my implementation, I'll fork it over (once it's complete).
Post Reply