Project:
Simple brute-force terrain divided up into sections. Each section has a bounding cube used for culling. The camera implements gluLookAt().
Current order of operations:
- calculate frustum
- call gluLookAt()
- cull landscape sections
- draw landscape sections
Performance and appearance of scene:
Performance nearly doubled, and the scene looks fine.
Weirdness:
- No matter where the camera moves in the scene, the
number of culled sections remains exactly the same. - Even though the reported number of culled sections
remains static, the frame rate goes up dramatically
when the camera is pointed directly at the ground, or
moves to the edge of the scene and looks “out into
space”.
Observations/Questions:
- How can those 2 facts be explained? I would say that
the code I am using to report the number of culled
sections is faulty, but it is so simple that I don’t THINK
I could have it screwed up - As far as the order of operations goes, it seems like
the intuitive thing would be:
A) Call gluLookAt() to move camera.
B) Move objects in scene.
C) Calculate frustum.
D) Cull
E) Draw - I tried the ‘intuitive’ approach, and it culls items
that should easily be visible, whereas the first
order of operations listed in this post seems to work
fine execpt for the issues listed in the ‘weirdness’
section.
Thanks for your input