In a game I'm working on a lot of objects are loaded (around 15000). They all just have 2 polygons, but the game is really slow on my machine (0.5 FPS). I'm assuming this is because I'm using the default scenenodes. Can I make the game faster somehow? Would writing a custom scenenode help?
And before anybody asks, the drawing part is slowing the game down, not the game logic.
A lot of objects - a lot of Slowdown?
khm khm... http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=39154 ..khmkhm
everybody tells us to batch the meshes, but noone tells how.
And when i ask, everyone keep quiet..
actually append didnt work for me (dunno why).
So if u can achieve something, please share with me too :3
everybody tells us to batch the meshes, but noone tells how.
And when i ask, everyone keep quiet..
actually append didnt work for me (dunno why).
So if u can achieve something, please share with me too :3
There's no specific way to "do batching." Batching is just a term that refers to reducing the number of draw calls you make every frame. I don't know why the transform isn't working and I'm not at my home computer right now so I can't check why. There's many ways to create larger batches:
- Use a texture atlas so that you only have to call SetMaterial (a batch breaker) once for multiple draw calls (this would require a custom scene node).
- Use a vertex shader to transform groups of meshes instead of using setTransform (again, this would require a custom scene node).
- Combine mesh buffers (I don't know why append isn't doing what you want - check the source code and figure out what it actually does) and put resulting mesh in a mesh scene node.
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Here's a batching mesh scene node from bitplane: http://files.bitplane.net/CBatchingMesh.zip
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
-
- Posts: 208
- Joined: Sun Apr 02, 2006 9:20 pm
I have posted a reply to baz on batching meshes in http://irrlicht.sourceforge.net/phpBB2/ ... 331#228331
The example I use for batching meshes batches 2500 object containing a total of about 330,000 polygons without batching and without hardware buffers it runs at 24fps. with batching and without hardware buffers it runs at 66fps.
When I switch hardware buffers on that jumps to 660fps.
The example I use for batching meshes batches 2500 object containing a total of about 330,000 polygons without batching and without hardware buffers it runs at 24fps. with batching and without hardware buffers it runs at 66fps.
When I switch hardware buffers on that jumps to 660fps.