TGLTerrainRenderer
Experiment with BF1942 high-resolution textures - Eric Grange (feb 2003)
There was a discussion in the GLScene newsgroups about how the game "BattleField 1942" was rendering its terrain: decent range, high-detail, no popping, etc. And a question remained: was it possible to do this with GLScene terrain renderer?
Yes melord, it's possible! And it's easy!
Below are a few screenshots of the thing in action, rendering the BF1942 "Wake" terrain from the multiplayer demo. You can get the source of the glscene proggy here for the most adventurous among you (you'll need to download the demo, extract relevant texture and elevation files from the ".rfa", convert them to standard BMP format, and finally generate an HTF version of the elevation map with the included .tpcfg and TerrainPack from the glscene utilities demos).
As you can see in the shots, framerates are quite comfortable, especially knowing that in-game fog is closer, that anisotropic filtering was active and no frame-to-frame coherency is exploited. This leaves a lot rendering capacity for water, buildings, vehicles & other stuff. With full-detail (no ROAM), framerate goes down to 170-200 FPS, which may be what the game uses (full geometry) with its reduced fog distance.
The textures are the highest-resolution ones, i.e. a total of
16 (sixteen) 1024x1024 textures (that's 48 MB of uncompressed
data) applied to a 512x512 heightmap. In the test proggy, the
textures are compressed on the fly at load-time, and it takes 5
seconds on my machine to load & compress everything (starting
from RAW high-res BMPs). If you have a card with 128 MB like me,
you may comment out the compression request for almost
instantaneous loading time (rendering performance shouldn't vary
by more than 10-30 FPS).
The terrain renderer is fed by a TGLCustomHDS, which assembles
elevation data from an HTF height-datasource and textures from a
regular material library. Since there is not much elevation data,
the HTF is quite overkill, but using it means less code to write
and a demo on how to chain height-datasources :).
Hardware used for the screenshots: Athlon XP 1800+, GeForce 4 Ti 4200.
Japanese aerial approach route. Note that shadows are built into the ground texture maps.
A low altitude view, you can spot the detail texture in the lower part of the shot.
A view from the US airstrip.
The same US Airstrip viewed in wireframe mode. ROAM mesh simplification becomes obvious.
And a last overall shot which exposes most of the island.