Frame rate dropping when pitching up


I have a problem I’m not able to find an answer to. I tried everything I could think of, but I got nothing.

I have a room, 200x200x10, and a cube (2x2x2) at every intersection of lines with x and y multiple of 10 (361 cubes). You can see what I’m talking about here -

The problem is that the frame rate drops when pitching up (angle is greater than zero), but only when going in some directions. The camera is initially in the right-bottom (so to speak) corner of the room. Walking along Y-axis with pitch -5 gives me 60fps ( Pitching with +5 in the same direction gives me less than 20fps ( Walking along X-axis with pitch -5 gives me 60fps ( and I get the same with pitch +5 ( Going diagonally gives me different values for -5/+5 pitch ( In the movies the frame rates are different because of QuickTime recording, but even so you can see the differences…

Initially I had some other objects instead of the cubes, objects with more vertices and more materials and textures. Replacing them with really simple objects didn’t solve the issue.

I also had my camera attached to another 3d object, but even without that object the problem persists. I took out collisions and got the same results.

I also tried different lights (point, directional) and no lights, with walls, floor and ceiling and without, with textures or colors, but none of this fixed my problem.

Can anyone shed some light on this issue?

There is another issue, not so important at this moment, but it would be nice to have an answer to this one too. In you can see that the colors of floor, ceiling and walls are changing dramatically as the camera moves. It gets better if I use textures, but how can I use colors and have better results?

Thanks & best regards,

P.S. The simplified code and the objects used are here -

I would suggest using pstats to find out what about the scene changes when you pitch up. Perhaps for some reason, less objects get culled when pitching up, causing the number of batches to increase?

I’ll try to do that, though I’m not sure how to use pstats. (from C++ on Mac).

What I did in the meantime was to use another camera to see the frustum of the FPS camera and what gets culled and what not. And I saw no changes when pitching up, same objects got culled. Here is a short video -

What else could it be?