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


Submitted by Tim C. Schröder, posted on December 24, 2000




Image Description, by Tim C. Schröder



Here you see a few screenhots of my new terrain engine. The upper left picture shows the detail texturing and the sun. You can see the glitch where the sun's flare shines trough the mountain. Thanks to the Octree and my triangle class, this problem is gone now. On the right side you can see the Octree, red nodes contain more triangles. The pics in the middle show various heightmaps. I think you can see how nicely the procdedural generated texture looks. In the lower-left corner are some screenhots of early version of the engine. The last pic is a water-only view. The cubic environment mapped water looks so cool that I think it deserves its own picture ;-) I hope you enjoyed the view. If you want further informations and want to download source & exe (when it's released ;-( ), visit my homepage http://glvelocity.gamedev.net . Some of the source that was used to create the engine is already in my code archive. I also would like to hear a few ideas on what to include into the engine. I'm currently thinking of some kind of algorithm that removes occluded montains. I also want to do lensflares and a moving cloud layer. Bird, butterflies, fishes and trees would also be cool. Oh, and underwater fog and rain and... Way to much...

Tim C. Schröder


[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.
 
David Olsson

December 24, 2000, 10:25 AM

Looks great !!

I love procedural generated textures (and geometry).
But when do you calculate these textures, at startup or when you need them ?
What kind of enviromental mapping do you use, cube or sphere ?
Do you use some kind of LOD ?

/David

 
tcs

December 24, 2000, 12:23 PM

I generate everything on startup. This pic is old, because flipcode gets so many iotd submissions it took a long time for my pic t show up. I already released a version of the engine on my homepage (with source), so check it out! I also have a readme ready that should answer all you questions!

I'm working on a second version with a detailed setup dialog, speed improvements and a lighting model that is better tna OGL standard. Everything is nearly finished so far, so expect a release early in January...

Here is a updated shot: http://glvelocity.gamedev.net/images/bigterrain.jpg

Visit my homepage (http://glvelocity.gamdev.net) for download and more details

Tim

 
Densun

December 24, 2000, 12:24 PM

Nice!

 
fluffy

December 24, 2000, 12:30 PM

Wow. Landscape shots normally bore the hell out of me, but that one actually looks GOOD. One thing to point out is that the flare from the sun WOULD be partially 'in front of' the mountain, since the flare happens in the eye/camera, and is not part of the sun itself. :) Basically, every part of the sun which is visible has its own little mini-flare on it, and it's the cumulative effect of those mini-flares that you see as the big flare of the entire sun. If your visibility scheme allows for this, try clipping a (polygonal) circle of the sun against the landscape, and then use the resulting edges for drawing flares - it's not a technique which I've seen done before, and it'll probably come out quite nice with a bit of tweaking...

 
Vorteks

December 24, 2000, 12:31 PM

That is truly beautifull! Seriously, I don't think I've ever played a game that looked as good as those shots. I'm curious as to what hardware is nessecary to run it. Do you need a GeForce or will it run on something lesser?

 
tcs

December 24, 2000, 12:53 PM

You can disable the cubic env mapping, then it will at least start on non GeForce cards. But everything is clearly aimedn at GF hardware. You can run it on a GeForceDDR (Forget SDR...) but it only will run well on GeForce2 ;-))

I'm redering the suns as two parts: A basic glow (red ball without flare) and a flare. I do raycasting to check the sun's visibility and then draw the flare over the landscape. Maybe I make the sun flare fade out like in Unreal games or I adjust the amout of glow based on the visible area of the sun, nice idea...

 
Jesse

December 24, 2000, 12:57 PM

Neat-o. Look very nice. Could you give a little info on how you did that texture? It looks alot nicer then the one I used on mine...
Jesse Laeuchli
www.laeuchli.com/jesse/

 
EGreg

December 24, 2000, 01:07 PM

LIKE THE SKY, LIKE THE MOUNTAINS, LIKE THE SNOW, LIKE THE RIVER, ILKE THE WATER OH MAN YOU HAVE GOT IT LOOKING VERY WELL INDEED!!!!!

Now make a good game with it and/or make engine very good so you can license it baby!!! :-)
Add m ore stuff to it
Is it real-time? (I hope :)

BTW, flare actually should be in front of the mountain, but not the rays of the sun, hehehehe. You should spend one morning looking at how the sun goes over a mountain... i mean how it rises and when it gets over the mountain you can see the sudden change and nthe mountain isn't only lit up from behind, etc.
BTW, if you want to simulate "filmmaker" stuff... when sun rises, and is in your eyes or something, the rest gets darker by contrast. Kind of like a silhuett... you can see it in low light but when there is a big light from behind it you can't :)

-Greg

PS: I really like your landscape engine, looks very fantasy/real at same time :)

 
Nick

December 24, 2000, 01:12 PM

Hi Tim! ;)

I haven't been albe to take a look at the demo yet (my friend with a GeForce is on a little vacation right now), but I think the screenshots already show enough! Really great job!

Are you going to make a game like Delta Force with it or something like that? I just love shooting birds in DFLW :) I see you're already using your crosshair class so the only thing to add are the birds :) I think your landscape looks better than theirs.

DirectX support would also be great but I think you already don't know what to do first...

Greetings,

Nick

 
MK42

December 24, 2000, 05:33 PM

Hi!

I tried the demo and must say that it looks pretty cool. You're right it runs very nice on a GeForce 2 :)

That water looks very tasty and I really like the sun/flare. It might even be cooler, if you could add the flare to the water (being reflected) ... gives you more realism and added eye-candy ...

- MK42

 
tcs

December 24, 2000, 05:49 PM

All your suggestions are pretty good ! You could spend your entire life trying to make a perfect model of the nature. Everytime you think it is perfect, you see a little bug ;-))

The rays ARE in front of the landscape, at least in reality. tust me, I tried it ;-)

I also wanted to do a relfection of the skybox in the water, but that looks bad, no idea why ;-)

I have a few problem with my illumination model. I added shadow casting and so on, but guess what: Mountains are not dark, even if they are covered by other mountains... Ambient lighting looks a bit cheap, let's see what I can do...

Tim

 
fluffy

December 24, 2000, 06:13 PM

tcs: One thing to keep in mind is that, due to atmospheric scattering, the sun effectively becomes a yellowish lightsource with blueish ambient light. For the lighting, think in terms of how radiosity works. :) I've actually experimented with realistic lighting models like that (diffuse=specular = 1,1,0.7, ambient = 0,0,0.5 or thereabouts) and it ends up looking pretty good. Just remember that, by definition, the total light coming from the sky is pretty much white (that is, it's what our eyes have evolved to perceive as white). I'll try setting up a half-assed landscape shot and posting it in a bit. :)

 
MC. BAXTON

December 24, 2000, 06:30 PM

13-th message:
Really nice images. I'll try to do better...
:)

 
MC BAXTON

December 24, 2000, 07:09 PM

You should better handle your error messages. When user gets an SERIOUS error message, application should terminate.
I was unable to run your app on win2k, as well as on win98
After getting error message, application (successfully!) loads it's data, and after that needs manual shutting down(from task manager window)
Is your application works only with GeForce ? Usually ALL examples posted here works at least on win98 with my hardware.
I do not like when app switching screen resolution without my wish ;-) (and crashing ...)
If you want to make something really serious, you should make it more flexible.
Yeah, your images is nice. But I feel that you just want to add some reflections to your terrain. You should do more, and not just for eye..

 
tcs

December 24, 2000, 08:28 PM

GeForce only, damn it's GeForce only... Oh, sue ID Software because Quake3 switches the screen resolution without your EXPLICIT wish !!! If you get an error message, it's because your cards sucks or files are missing or some other strange thing happens... And adding reflections to the terrain is a GREAT idea ! Yes, like in reality, every mountain is a mirror...

Some people...

fluffy: I'm doing much work on my lighting system. I just added shadow casting recently. But you're right when you are talking about radiosity. The shadows are to hard & dark. When you have a snowy mountain it's bright all over the place because the snow spreads the light. I think when doing shadows I'll take the neighbor places into account, depending on their "material type" (colo ?)...

Tim

 
fluffy

December 24, 2000, 09:01 PM

Argh. Trying to hack up a landscape screenshot based on my engine has shown me how completely unsuited my engine is to landscapes. :) (It was designed for MUD-type environments, and I'm too lazy to put in landscapes.) Ohwell. Mesa is totally barfing on stencils right now (damn 'priorities' in free software :) so I can't show things working with shadows, unfortunately, but hopefully this will give a good idea of what the ambient blue looks like:



I think it'd look better if shadows were working. In any case, I have my ambient light at 0.1,0.1,0.4 and my direct light at 1,1,0.8. The torii are the cardinal red, green and blue, and the ball is 1,0.5,0.25 with white specular highlights and a cheesy pseudo-marble texture. The ground is grey (and it really is grey, it just looks yellowish in contrast to the blue sky). Also, the skydome is textured with a cloud texture which has no bearing whatsoever on the lighting conditions. :)

Oh, and FWIW, the landscape geometry isn't procedural, it was actually acquired from NIMA's data of the White Sands Missile Range (check out www.nima.mil). It makes for pretty good test landscape data. They actually have pretty high-resolution data of most of the planet's surface, and if you're military or have a specific reason for it, you can get even higher-resolution data out of them. It's a very useful resource.

 
tcs

December 24, 2000, 09:40 PM

I'll check out that site, maybe I can get some data...

My main problem is that global illumination / radiosity thing. I do my own lighting (allows me to match a better vertex format and I can do shadows).

Now imagine you have shadows in your landscape. How would you try to get thos artifical sharp shadows away ? I'm thinking of blurring them and using some jittering. So I the corners are not sharp. And those radiosity thing would be cool, maybe a very simplified from... Maybe you have some ideas for this ?

Tim

 
fluffy

December 24, 2000, 09:51 PM

Well, if you do the shadows by just munging the lighting per-vertex (and yeah, I've been meaning to eventually getting around to doing my own lighting instead of using OpenGL's), then you could always try just projecting your objects onto the landscape and 'drawing' in the lighting values in as black. Is that what you mean? Since your engine is intended for GeForce-class hardware, tesselating the landscape a bit more where shadows lie shouldn't be a problem... dunno how to really quickly calculate amounts of shadowing though. Perhaps just using a bounding volume to guesstimate it and doing some sort of 'area of the sun visible' assuming that the bounding volume is, say, 50% filled by the object would work... then projecting the object onto the landscape would be much easier as well (since you only have to deal with the bounding volume and not the actual object's geometry).

Or there's always projected textures, if you don't care about objects shadowing themselves or each other, and just use standard line-of-sight to see if the landscape is shadowing itself in any given location.

As far as the radiosity for lighting goes, you could always just assume that the background light from the sky is constant and do two 'area occluded' calculations, one for the disc of the sun and one for the sky.

This is the sort of thing I haven't really thought much about for the purposes of realism, honestly, since I tend not to write landscape engines these days. :)

 
Dave

December 24, 2000, 10:42 PM

This is a nice looking engine. I like how the textures work as you get closer to them. The moving water is a nice touch, but either way, This is on its way to rival alot of games out there if the time is spent to push this forward. Nice job. I could give suggestions on this, but you probably already have an idea of what they should be already. This is good work :)

Dave

 
Warren Marshall

December 25, 2000, 12:00 AM

"If you want to make something really serious, you should make it more flexible.
Yeah, your images is nice. But I feel that you just want to add some reflections to your terrain. You should do more, and not just for eye.."

Dude, most of these images come from people coding in their spare time, creating stuff for fun. The fact that it doesn't have a totally robust error handling system is pretty irrelevant ...

 
EGreg

December 25, 2000, 12:25 AM

For Added coolness: how about you make sun reflect in water and make sun path or something :)

And moon maybe yay

-Greg

 
EGreg

December 25, 2000, 12:31 AM

How do you determine where you have grass, where dirt, where to blend?

-Greg

 
tcs

December 25, 2000, 12:55 AM

EGreg:

It's height based at the moment... But I'll make it more advanced ! You can process many parameters. Like shadows or the gradient of the landscape. You could also take water and a noise value...

fluffy:

This is how I calc my lighting now:

I step trough every vertex. If it's not occluded by a mountainm I'll do the same lighting calculation that GL does. If it's occluded, I just set it to the ambient brightness. But this gives artifical dark shadows. I have no problem with the tesselation, that's fine. I could do it per-pixel, but this would permit me altering the lighting at runtime.

My idea is to make the strong and dark shadows go away. In reality there's not a dark side of a mountain. Just like radiosity, the snow f.e. "transfers" the light trough relfection...

Tim

 
fluffy

December 25, 2000, 01:33 AM

tcs: Yeah, what I was talking about was a possible mechanism for simulating radiosity at a faster rate though. :) I don't think diffuse interreflections are really that useful though - in my experience, slopes which are steep enough to expose enough of a form factor to other slopes are too steep to carry any snow anyway. I think the only lighting you really need to worry about is from the sun and from the sky - I don't think interreflections from the mountains will really make a noticeable difference. Interreflections from objects (a bright red ball, for example) can be handled much in the same way as shadows...

And I think per-vertex lighting is fine for these purposes, myself, as long as you tesselate the polygons small enough. Being able to theoretically modify things realtime is always a big plus, yeah.

 
tcs

December 25, 2000, 04:48 AM

"I don't think interreflections from the mountains "

Imagine a big snowy mountain with nice reflecting snow. Now place a low sun at side a. Side b will be very bright, just because there's a hell lot of reflections going on. In my current lighting model there are to much shadows. But just raising the ambient lighting washed out the image and reduces depth... Maybe I use the ray jittering approach, I know that some lighmap renderer use this approach.

Tim

 
EGreg

December 25, 2000, 10:51 AM

Tim - it doesn't look heightmap based... for example, right middlepicture, two places with same height have diff textures. It is also slope based or something? Or is it somehow random noise type of thing?

Btw, love the water! Gotta learn better cubic mapping baby!! :-)

-Greg

 
Badman

December 25, 2000, 12:38 PM

Marvelous. Probably the best heightfield-based terrain engine I've seen (even though it runs awful on my Voodoo 3). And the fact that source is available is a big, big plus.

 
tcs

December 25, 2000, 01:05 PM

It's really just height based. I experiented with some weird tex coord generation stuff, so this might explain the effect. But we can always make it more complex if we want. I have a CCubeMap class on my site, check it out ...

Tim

 
EGreg

December 25, 2000, 04:02 PM

No, no... how do you determine where you have snow where you have stone? or where you have dirt/grass?

1) Do you have only two textures and you blend between them?
2) Look at middle right shot and also bottomest leftest shot... with the snow... how do you explain texturing on that mountain in the background? :-)

What about middle right shot?

I'd like to know. :-)
-Greg

 
tcs

December 25, 2000, 06:59 PM

As I said, height based ;-) The engine takes as much textures as you put in the directory...

Tim

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