Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Eric, posted on February 14, 2001




Image Description, by Eric



This is a screenshot of my landscape engine. I decided to post this in response to a previous IOTD posting, where the submitter commented on the fact that it's the quality of the texture mapping which makes or breaks a landscape engine.

My landscape engine only has a simple static binary triangle tree LOD system, much like ROAM but without the dynamic LOD depending on how far away the particular part of the landscape is. It may seem pointless to have LOD which doesn't depend on distance, but I wasn't happy with the idea of the landscape morphing around before your eyes as you move across it. Also the WHOLE landscape is drawn every frame, so I needed some way of reducing the detail in large flat areas of land (this is shown in the corner). One final advantage is that you can specify how many triangles you want the landscape to consist of and the LOD system does that, within about 10 triangles.

Eric


[prev]
Image of the Day Gallery
www.flipcode.com

[next]

 
Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
s.t.i

February 14, 2001, 11:27 AM

Looks really nice!

How do you calculate the shadows? they look really convincing
And is that detail texturing also?

/Fredrik

 
Pants

February 14, 2001, 11:38 AM

Hi.

The small section of snow in the middle-bottom looks increadible, nice texturing. Also the shadows on the right mountain looks good.

Is it a static lightmap or vertex colouring? Is the lightmap baked into the ground texture?

Pete

 
Allen Chang

February 14, 2001, 11:47 AM

Nice picture; you're texture mapping is quite good.

If you're representing the landscape with a binary triangle tree, it's very easy to efficiently clip to a viewing frustum so that you don't have to draw the whole landscape every frame. Are you considering implementing this?

Otherwise, perhaps you should just store your terrain in some vertex buffers, instead of traversing a tree every frame (or are you already doing this?)?

 
Peter Mackay

February 14, 2001, 11:53 AM

That does look really smart.

I could imagine some kind of off-road racing game with little buggies skidding around.

Would it be possible for us to see a demo of the landscape engine?

Nice work!

- Pete (different one!)

 
ent

February 14, 2001, 12:26 PM

Are you using Terragen for the textures?

BTW, a I see a lot of people still using ROAM/LindStrom... And this is not the way for the current hw cards.

I'd choose subdividing the terrain in patches and apply LOD to these patches. You could striptify/cache optimize this patches easily.

 
Vorteks

February 14, 2001, 01:32 PM

Very pretty, especially the textures and the shadows. How do you do those?

 
user name

February 14, 2001, 01:47 PM

that looks really funky!

create a 3d worms style game and i'll give you wads of cash!

 
Revolver

February 14, 2001, 01:48 PM

Could you explain to me just HOW to get a colormap out of terragen?

 
Aragorn

February 14, 2001, 02:13 PM

looks really nice, especially the shadows
but the sun looks a bit strange

one question, how many triangles are there in this picture?

 
remo

February 14, 2001, 02:17 PM

you see this is exactly my point - the shadows aren't actually anything to do with the engine, they're part of the texture - therefore it's the texture which makes or breaks the landscape engine.

they're rendered by Terragen along with the rest of the texture

 
remo

February 14, 2001, 02:21 PM

i am eric btw
:)

 
remo

February 14, 2001, 02:25 PM

Yeah um..
in this particular case it was just a test to see how well it would work with the lightmap printed onto the texture... but it didn't work too well... from the top it looked fine but from side on you could see areas where the heightmap was at a lower resolution than the texture and it just didn't work

there is also a vertex-lighting lightmap as well (i realise that makes no sense... like a heightmap but instead of height it's with light)

 
remo

February 14, 2001, 02:29 PM

oh yes and basically the texturing is done in two passes: firstly a texture map is applied to the whole landscape (i.e. no repeats), then a pretend "bumpmap" (bump lighting done in photoshop not by the engine itself) is applied over it, and repeated

it works quite well i think?

btw i am the person who submitted this

 
remo

February 14, 2001, 02:33 PM

note: i am eric (the person who posted this)

i haven't actually implemented any of what you said but it does seem like a good idea, though i do have to say that for some reason every 'optimisation' i've tried to incorporate so far has required a load of extra code and hasn't really made a great speed improvement...
ah well.

no the tree isn't traversed every frame, in fact the tree could just be deleted were it not for the fact that you use it to find out how high the landscape is at a given coordinate (which doesn't work at the moment for some reason)

 
remo

February 14, 2001, 02:41 PM

Some of the questions above have been answered directly, however i feel it's necessary to expand on my shitty original description of the image.

As you can see the frame rate was 73/sec when this particular shot was taken, which is pretty much the average as you fly around the landscape with a TNT2 Ultra. The texture was indeed made in Terragen, as ent suggested, as indeed were the shadows. Usually there is a seperate texture map and lightmap, but in this case I was just trying it out with the lightmap printed onto the texture map - the screenshot looks good (which is why I sent it in), but you could see inconsistencies in the lighting as you actually flew around over the landscape.

A slightly older demo is indeed available from my website (go to the downloads section and get the RTS 3D Tech Demo). It won't look exactly the same as the screenshot, but not necessarily worse. No shadows though... :(

There we go I think that's all...

Eric Reynolds
(submitter of the image)

 
remo

February 14, 2001, 02:44 PM

you don't... i just render it top-down without any atmosphere/lighting

 
D.P.

February 14, 2001, 02:56 PM

looks great, good texturing and lighting(shadows). How are they done
I just started my landscape engine a few days ago, I now have a morphing between two textures for high and low ground, fog and a crap sky box but already it looks good. However the next steps will be difficult as I will need to calculate normals for lighting/collision detection and have a decent LOD system. How do you texture your landscape - is it one large, precalculated texture or is it dynamicaly calculated for each triangle like mine(which is slow and gives poor results).

 
Navreet Gill

February 14, 2001, 03:17 PM

whaa? are there better things to use on current hardware than ROAM? I didn't know so... hmm, can you point me in the right direction? What should I look into instead?

 
remo

February 14, 2001, 03:35 PM

i'm not answering questions i've already answered
check the messages by remo

 
remo

February 14, 2001, 03:36 PM

i think that quadtrees are more TnL friendly but they are also harder in the sense that you need to find a way to deal with boundaries between one LOD level and another, which ROAM deals with intrinsically

 
maddoc

February 14, 2001, 03:57 PM

WOW

can you please describe the render pipeline!

The high frame rate is impressive how are your speeding up tricks??

KeeP oN CODiNG

 
zed zeek

February 14, 2001, 04:32 PM

nice one ive gotta get some of those textures :) i dropped support for LOD on my terrain engine about 6 months ago i found none of the LOD methods paids off it was either
good framerate + visual popping (unacceptable)
bad framerate + no popping

whereas without LOD its
medium framerate + no popping

 
Revolver

February 14, 2001, 04:44 PM

The cons of ROAM outweigh the pros. It's too processor intensive - most CLOD algorithms are. Project IGI had CLOD terrain, and while it was livable, it wasn't all that pleasant. Popping sucks. Geomorphing - if very well done - can save the day, but it still doesn't match the niceness of TnL.

TnL is where things are moving these days, and software processing of vertices (be it for LOD or whatever) just isn't a good idea. Shove it (sectionally split by a kd-tree, of course) in a VB and muss with an IB if you must, but otherwise don't fuck wit da vertaceez. ;-)

 
remo

February 14, 2001, 04:55 PM

ok, like i keep saying, there are obviously some tricks...

firsly the screenshot looks better than the engine normally does, for the reason i keep describing...

secondly, Terragen does A LOT, and i can hardly claim all the credit for the quality of the image

lastly, the landscape is NOT very big, the idea is it's a kinda arena in which you have little battles (eventually) etc etc..

the heightmap is only 65x65 pixels. this is gracefully reduced to
roughly 4000 triangles (or whatever you want, from the intial 65*65*2 = 8450 triangles) by the engine, based on height variance within different areas. what this essentially means is that flat expanses get represented by fewer triangles than mountainous regions.

 
remo

February 14, 2001, 04:59 PM

yeah i agree totally

i absolutely hate ROAM in games (i'm NOT saying it doesn't have a lot of very good applications and that it isn't an incredibly clever algorithm), and it annoys me how in games the landscape wobbles around in front of you as you move around... it completely destroys the illusion that the landscape is a solid object. i'd much rather have less detail.

however in my opinion static LODing pays off - it doesn't require any per-frame processing, and it means that the user can scale the landscape detail as low as they like - which is a serious consideration on low spec pc's, obviously.

 
Waramp

February 14, 2001, 05:28 PM

It looks very nice. you gotta love Terragen :)

I have a question about your Triangulation method: How long does it take to process the heightmap into those various Triangles? As far as I know, that process is called a Triangular Irregular Network (TIN)
Lots of Geographical Information Systems use them for their Digital Elevation Models, (Arcview by ESRI is the one that I am most familiar with), and they tend to take up to a minute to process a standard Heightfield, so i was curious as to how fast and what method you used...

Waramp.

 
David Frey

February 14, 2001, 05:32 PM

... and lets just ignore the majority of computer users since the majority don't have a TnL card.

 
haust

February 14, 2001, 05:41 PM

Eric said : "but I wasn't happy with the idea of the landscape morphing around before your eyes as you move across it"
I say : I agree !! ROAM is a very good tech on the CPU/GPU traffic side but on the the display side when you see the landscape morphing is quite disturbing. There may be more advanced solutions for this...

 
Richard Szalay

February 14, 2001, 05:57 PM

Damn you eric :)

I clicked on the 'dont click' button....

 
Phoenix492

February 14, 2001, 06:01 PM

Ouch. Nice. Very nice. (hey, I'm new at this Gaem development stuff, but out of all the games I've played, thats a VERY good landscape....)

 
This thread contains 51 messages.
First Previous ( To view more messages, select a page: 0 1 ... out of 1) Next Last
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.