I'm building a 3D fighting game using irrlicht 1.8.3 and I've stumbled into a not-so-nice issue.
In my scene, I'm rendering two animated characters (IAnimatedMeshNode) with approx. 7000-8000 polygons each, inside an arena (I've used the Quake arena included in the engine, just to test it), with two lights and soft shadows (XEffects-Reloaded, you can find it here).
The problem is, that the frame rate drops really badly when switching lights on.
More precisely:
- first character rendered alone -> 400 fps,
- both characters rendered -> 140 fps,
- characters + arena -> 115 fps,
- lights on -> 24-28 fps
... to this:
Now, I have a good-to-advanced knowledge in C++, but I lack experience on shaders and GPU programming in general.
Can just adding lights and shadows cause a severe frame drop like this? Is the renderer using too much time to render the models? Should I reduce the poly count?
I was wondering if there could be a solution to get the same effect without the excessive frame rate drop.
Additional information:
- My meshs are fairly middle-poly (8000 tris), and have bone/skeletal animations (.x mesh). Both meshs contain about 250 animation frames.
- I have tried excluding all the game logic and build a minimal program with only the models, but the final result doesn't change (at least, now I'm sure that the FPS drop is not due to other routines, like the physics engine).
- Interestingly enough, if I add any post-processing shader, the frame rate doesn't drop anymore - it's all due to the lights, apparently, but I could be wrong.
- I've run the program using a Geforce 740M graphic card, processor Intel i7, 8 GB RAM.
- I'm currently working on a Windows 10 computer with Visual Studio 2013.
Thanks in advance,
~ Andrea Jens