Height Map ( .tga )+Sky Box = Poor Performance ?

Please help me out here. Iam trying to create a 3d-world for a flight simulator game.

I’ve created a Sky-Box (a cube with 6 Textured Quads, each of which is a bitmap of size 512x512-32 Bit) and I’ve also created a Height Map (a 1024x1024 .tga file) with in the sky box. When I rotate the camera, I get V Poor frame rates. When I remove either one of them, I get excellent frame rates. What Is the problem ?

Also, How do I create a terrain which is dynamic ? i.e One which is not a static height map.

Hi !

One possibility is that the hardware is not able to handle everything so it switches to software rendering, how much memory do you have on the video card ? (the skybox use 6M, the height field 1M or more depdning on size, then you need a framebuffer (or 2 for double buffering) and a depth buffer, this can be a lot of ram.

It could also be the fact that the hardware walks a little on it’s knees processing everything.

Mikael

Thanks Mikael. I have a GeForce 4 mx440 with 64mb vram ( agp 2x ) ; Processor=450MHz P3, 256MB RAM.

SkyBox uses about 4.75 MB and Height-Map about 1MB. How do I use the sky-box and Height Map simultaneously and get good frame-rates ? Inspite of loading both of them in a Display-List, Iam getting low FPS. Any suggestions ?

If I use Vertex Arrays, will it help me to get higher FPS ?

>> … the hardware is not able to handle everything so it switches to software rendering …

Apparently lack of video memory seem to be the problem, so in that case, blame the AGP transfert of all the textures to the card. The rendering however should still done in hardware.

I have heard that to better use the AGP textures, you should draw a scene by switching the order of the textures every frame. In that case only one texture may be uploaded at each frame.

ie :

frame 1 :

draw sky quad 1
draw sky quad 2
draw sky quad 3
draw terrain
draw sky quad 4
draw sky quad 5
draw sky quad 6

frame 2 :

draw sky quad 6
draw sky quad 5
draw sky quad 4
draw terrain
draw sky quad 3
draw sky quad 2
draw sky quad 1

then back to frame 1 etc.

To avoid such problems, estimate the memory taken by your textures + framebuffer.
ex :
sky textures : 6512512*4
etc.

By the way, you may want only RGB textures, so it will take less memory.

Is your terrain textured too ?
How many triangles for your terrain ? 102410242 ? That is quite a lot.

And what is your card and its video memory ?

Edit: ok, you already posted it.

Thanks. I have a GeForce 4 mx440 with 64mb vram ( agp 2x ) ; Processor=450MHz P3, 256MB RAM.

SkyBox uses about 4.75 MB and Height-Map about 1MB. How do I use the sky-box and Height Map simultaneously and get good frame-rates ? Inspite of loading both of them in a Display-List, Iam getting low FPS. Any suggestions ?

If I use Vertex Arrays, will it help me to get higher FPS ?

By the way, HeightMap(.raw file) consists of 64x64=4096 textured quads.

Please let me know as to how I can create a dynamic terrain which gets generated in real-time as the camera moves along x-axis or z-axis.

Which is more suitable for a 3d flight simulation game ? a static heightmap loaded off a .RAW Image or one which is dynamic ? Any Tutorials on the web for realtime terrain generation ?

1.) Your textures will be convertered by the driver to 32 bit ARGB giving you 4MB for the terrain and 6MB for the Skybox or 10MB in total.

2.) When you say “load the textures in a display list”, I hope you dont mean you really load them by using glTexImage2d() but use texture objects and (re)bind them?

3.) If you could show us some code (please use the code tag) it would be much easier to pinpoint the problem.

4.) www.vterrain.org is a resurcefull site for terrain generation.

Let’s be serious. The kind of system OGL_PGR specified wouldn’t have any problem in managing a single skybox. It could easily lock at more than 1kFPS without using tricks.

Originally posted by <Somebodyelse>:
2.) When you say “load the textures in a display list”, I hope you dont mean you really load them by using glTexImage2d() but use texture objects and (re)bind them?
I think this could be the only problem which calls for further investigation.

What are the framerates with and without the skybox? I need this to know what ‘very low framerates’ means.