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.
Device vertex buffers optimizations (WIP)
-
delscorcho
- Posts: 12
- Joined: Tue Aug 23, 2005 10:26 pm
-
delscorcho
- Posts: 12
- Joined: Tue Aug 23, 2005 10:26 pm