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 . 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

Image of the Day Gallery


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.

December 25, 2000, 09:49 PM

tcs: In the interreflection setup you mentioned, wouldn't the mountain causing the supposed reflections be shadowed by the mountian receiving them, though? Again, I can't think of any real-life situations where interreflections would make a really visible difference...

Jesse Yurkovich

December 26, 2000, 12:22 AM

Very nice! This is what i was waiting for :)
I have a P3 500 with a 32meg TNT 2 ultra and i get some very good frame rates (35+ if i stand in the middle and spin or around 19 if im at the edge of the map and look toward the other corner)!!! Dont know what the fuss about GeForce is

it does seem however that the heightmap size cannot really go below 72x72 without the engine crashing on me?? It seems like the poly count is exponentialy related to the size of the map; ie a 128x128 map will generate nearly 3x the polys of that of a 72x72 one? i havent had too much time to look through the source but is there a tesselation feature i can tweek so i can use larger map sizes (ie i wont have to scale them down) or a way to limit the amount of polys generated?

other than that great job and personally i would think your next move would be to go to some sort of variable geometry so even less polys would be needed depending on how close you are to the terrain feture.

Francis Shanahan

December 26, 2000, 01:20 AM

Tim, I've watched this for a while. I'd like to congratulate you on a fine piece of work. You should be very proud. Your engine is both artistically beautiful and technically impressive. Well done and keep up the good work. You have a very bright future ahead of you.

best regards,


December 26, 2000, 08:18 AM

great landscape, just one thing


fuck quaternions.. why the hell do you let the people rotating around the z-axe

its really terrible to move around.. after one, two rotations you cant get the horizon back horizontal, thats damn shit

(i just wantet to say this because its in nearly every demo of you done like this.. and its just not usefull)

but, your engine is great anyways... just beautifull and fast (i want to disable the water to test how fast it is then.. but i cant compile it.. dont know why.. i get linker errors wich couldnt be..)



December 26, 2000, 09:53 AM


The lighting of our whole world is based on this priciple... I mean why is the backside of your house visible (=illuminated) even when the sun only shines at the front side ? Why can you see the moon etc ? Why Isn't it 100% dark at night ? Just because every object is a lightsource when it is illuminated, radiosity !

Jesse Yurkovich:

The FPS you get is really nice. The GeForce2 should get close to 40FPS and does Cubing Environemtn Mapping. The demo is very CPU limited because of the water code. I bet that a GeForce can outperform any non T&L card by 500% if you are completely T&L limited on work with static data.

I haven't experienced any problems with small hightmaps ? If I remember right 16x16 is the minium size that is not asserted, and maybe even 2x2/4x4 work... You only have to watch that the TGA is a square... And of course, 128x128 is ~300% more area and triangles than 72x72. The engine has build in scaling features, but id doesn not use them for scaling down the heightmaps in the way you mentioned. It just assumes you know what you do when you give in a large heightmap... So why don't you just scale it down yourself ? I mean the engine can't do anything else than you can do witj Paint Shop Pro...

This engine will remeain LOD-less, that would cause to much rewrite. But the next one will have ROAM or somethign like this...


Thanks ! I really was lucky that. I found those great textures, they look very cool...



;-) lamer ! I always played Descen wihtout Z-Leveling. I have absolutely no problem with it, when I control the engine you won't even notice that there is not Z-Center ;-)

"fuck quaternions.. why the hell do you let the people rotating around the z-axe"

Because I don't care about it and this engine is about graphics, not input or physics ;-)

"its really terrible to move around.. after one, two rotations you cant get the horizon back horizontal, thats damn shit"

As I said, no problem for me...

"(i just wantet to say this because its in nearly every demo of you done like this.. and its just not usefull)"

I hope you notice the pattern: The input is NOT a part of the 3D stuff so, it's only a neccessery evil, nothing to mess around with

"but, your engine is great anyways... just beautifull and fast (i want to disable the water to test how fast it is then.. but i cant compile it.. dont know why.. i get linker errors wich couldnt be..) "

Strange, I can't imagine why this happens. The next release will have a nice setup dialog where you can adjust everything, including the water ;-)


Phil Carlisle

December 26, 2000, 10:38 AM

Nice shots..

My only concern is that the landscape is too small for a real game. But then its just a test, so I dont think its really important.

I like your texture generation, its got enough noise in it to be fairly good, I cant see the water properly on my TNT2, but the landscape certainly looks nice. (Will try it out on the GeForce in a mo).

Ive come to the conclusion that vertex lighting for a landscape if fine, as long as the shading isnt too sharp (like you suggest, a bit of jitter in there will help a lot).

Anyway, looking good, still needs a lot, but youve done some nice things so far :)) Keep at it!



December 26, 2000, 10:58 AM

Tim, if you really want to keep using quaternions I strongly suggest a system that smoothly keeps the horizon level. I think that's the most natural camera movement for first person views. It's like with a flight simulator, planes also keep themselves level and you can keep your enemy in sight in a very intuitive way.




December 26, 2000, 11:55 AM

First of all, nice shots.

I tried to run your demo on a Radeon. The environment mapping of the water worked beautifully, everything else was messed up :)

I'm trying to put an image up here if your interested, but something is wrong with ftp at the moment.

But since you've released the source (woohoo!), maybe I can take a look at it and figure out why is so wierd.

Again, nice job.


December 26, 2000, 11:57 AM

Yes, the landscape size worries me to. But it is possible to get it quite large, and with LOD it should be fine ;-)) As you said, it's just a test. I wanted to try out a few things, and they worked out very well.

I'll start to work on my lighting stuff tomorrow, today I'll finish the setup dialog



December 26, 2000, 12:55 PM

I've downloaded the source and started playing around with it. My first problem has been an assertion in OctreeNode.cpp line 252 during start up right after loading the cube map. Is this a known issue, can it be safely ignored?

What extensions are required for this to work. I'm pretty sure the Radeon supports most of the standard ones that nvidia supports, are there any nvidia specific things in here? Haven't found them as of yet but thought I'd ask. And why use the vertex array extension, are you trying to make sure this is compatible with older OpenGL implementations. I've changed the code to use the vertex array support in OpenGL 1.1 and it works just the same.

Again, good job.


December 26, 2000, 01:54 PM

You shouldn't get any assertions, maybe I forgot that in the first release. A few days ago I fixed an assertion there ;-) It was not an error in the code, the assertion still assumes that we deal with a triangle array, not an array of pointers to triangles. I guess you can ignore it...

Raedon has every standard extension that the GeForce has and even more. The only extensions that the GeForce have that the Radeon lacks are nVidia specific, I'm using none of them. I'm still unsure how the engine performs on radeon cards since I can't test it ;-)

I had problems with my OpenGL headers. I'm using VC++ with the latest service pack, but my vertex array commands are differet from the OpenGL standard and different from those that are documented inside MSDN, strange uh ? So I decided to just get the function pointers which should make sure that I never problems compiling it. Wasn't that much work, so...



December 26, 2000, 02:41 PM

Actually, it's more because the air makes light kind of bend off in diff directions. Like, why does the sky turn orange or purple when there is a sunset or sunrise? That's why :-)



December 26, 2000, 02:57 PM

tcs: Yes, but it's interreflections from the SKY which illuminate the back of your house, not interreflections from other objects around. My whole point is that pretending to do radiosity but only basing it on the diffuse lighting from the sky should be sufficient - diffuse lighting coming off of other objects makes no signifigant contribution in outdoor environments.

The moon really doesn't help your case any - all of its lighting comes directly from the sun! It's not getting (visible) interreflections off of the Earth or anything.

Jeeze, try paying attention or something. :) Look, draw a profile (2-dimensional cross-section) of a landscape on graph paper, draw the sun on it, and then process the radiosity of that by hand, and you'll quickly see that there's no situation where the interreflections off of the mountain will contribute signifigantly to the lighting of any part of the mountain (even with snow - you have to account for the fact that snow doesn't stick to vertical surfaces very well :) and that all of the visible lighting comes from the sky and sun, NOT other things in the landscape.


December 26, 2000, 04:46 PM

With just a one line addition to the CWater class, the engine works extremely well on the Radeon. I've sent an e-mail to your hotmail account ( I think ) that explains what I had to do to get it working.


December 26, 2000, 06:11 PM

Yeah, I got your point... I got stuck on those indoor radiosity models, I think that the landscape itself doesn't change the lighting much... But diffuse light that comes from the sky is just ambient light after all ;-) Damn, does anyone know how current killer engines like Halo do their lighting ?

Oh, and I meant the moon as lightsource for the earth, not the moon itself ;-) I know that the moon is not illuminated by light that comes from a snowy mountain ;-))

I find it really strange that the cubemapping doesn't work on the Radeon. ATI says the card supports it, and I'm using not an nVidia specific extension, it's even an ARB extension...


James Matthews

December 26, 2000, 06:45 PM

That's very nice - I got a decent 70fps on my machine. The water goes a bit crazy when you move...nice effect though. The lens effect is cool as well. One thing I'd like to see added a an underwater effect like Funlabs did in their Cave demo (its at somewhere). Everything beneath the water (or above it if you are in the water) gets warped as the water moves - very cool.

Beautiful shots.


December 26, 2000, 06:45 PM

I tweaked my lighting engine a bit and made a big screenshot. Please take a look at it and tell me what you think. It's to large to post it in the forum, just see for yourself and give me your opinions, it should look as real as possible. (Don't complain that the sunlight comes form the wrong direction and that the rays of he sun are not parallel, I'll fix this)

here's the shot:



December 26, 2000, 07:54 PM

Looks damn good and accurate. Do the shadows cast on the water? Looks like it does a little bit in the middle, where there are 2 small peaks looks like the tip is casted on the water, I doubt it though.
Good work :)


December 26, 2000, 09:12 PM

The demo DOES work on the Radeon, all I did was disable the reflection mapping after drawing the water with the following code...


Everything worked great after that. Guess thats why games have to be tested on all cards :)

Michael Russell

December 26, 2000, 10:52 PM

You have no idea...even when you aren't using OpenGL/Direct3D, you run into countless configuration issues.

A good example is with some of the old S3 chipsets and DirectX. In DirectX 7 and below, to plot a pixel, you had to set it according to the appropriate pixel format in 16-bit color: 5-6-5 or 5-5-5. Some early S3 cards set it to 4-4-4 which completely hosed some routines.

But yes, configuration testing is a massive part of the testing effort. For the projects that I work on, we spend almost 25% of the time doing configuration testing, and we still miss quite a bit because there just isn't enough time...thank Bob for fixed platforms (i.e. Xbox).


December 26, 2000, 10:57 PM

This really kick ass ! ;)


December 27, 2000, 12:32 AM

Wow, yeah, that shadowcasting looks quite nice. Is that just normal 'see if the sun is visible from this vertex' shadowcasting? (And Slythic, it's pretty obvious that it's not casting shadows on the water - look at the right side of the water, for example).

BTW, what algorithm are you using to generate the landscape? To me it looks like you're zeroing the data and then repeatedly setting a few random points to full-height and then smoothing the whole landscape... nice, fast and easy to implement, that. :)

Also, you can't just do ambient light for the sky-diffuse lighting. Hopefully the screenshot I posted in here shows that it looks pretty crappy for, like, the bottom of objects and such, and the same applies to things at the bottom of a deep trench or the like (where it wouldn't be getting much sky lighting at all). Again, I think the easiest way to do the pseudoradiosity is to clip a polygon representative of the sky against the landscape (if your visibility mechanism supports this - you DO have a visibility mechanism, right? :) and then scaling the ambient parameter based on the area of the polygon. Not something you can do per-vertex per-frame, though.


December 27, 2000, 04:09 AM

2 words:
Bloody awsome!


December 27, 2000, 05:22 AM

Yea, I noticed that later on..and thanks to the pic I also fixed a problem with my main monitor being to dark(hence the reason I couldnt tell if it was a shadow or whatever).

The Wolf

December 27, 2000, 11:59 AM

WOW!! very nice shot. I can't wait to get home and download the source code. The pics look awesome. Great job


December 27, 2000, 12:41 PM

what I said was that the Radeon has this extension, at least ATI says it has. So why does it only work if you disable cube mapping ?

I also noticed the water stuff, but justv setting another water vertex color is not much of a problem, so this will be a feature I'm looking into.

The heightmaps are just TGA files, some are hand-drawn, some are generated by Brice, some are... Just everyting that is grayscale and makes a nice terrain :-)

I have some visibility stuff, the engine has a lot more features in it that are not really used, jut because some of the classes are also used outside this engine ;-) I'm working on some better lighting system, your suggestions are always welcome and I always try out what looks best... I don't plan to do anything dynamic, speed is not that important. I'm just not doing the lighting on the texture because this would never allow me to do small changes like a normal spotlight without any shadows...

I hope I have a new demo ready in the next 14 days, it will include many of the suggestions you maden.



December 27, 2000, 12:49 PM

Ah, okay. In any event, there's a lot to be said for a per-vertex illumination map. :) (in other words, a lightmap)

I wouldn't expect you to put lighting into the texture. That's just stupid. Of course, for dynamic additive lights you could just do it in a glBlendFunc(GL_ONE, GL_ONE) pass, possibly using a projected texture or the like.


December 27, 2000, 02:16 PM

do per vertex lighting, thats just easy to do, and fast (bout 50 lights with 25fps on a tnt2 in our engine, and it looks really beautiful (take a look at the pics at you even dont need really to calculate normals and it looks nice anyways!!:)

but, do it with, its bether...
per texture (per pixel) lighing looks great for games like quake and unreal (unreal2.. dont know.. it has landscape) where you have big,large,flat faces wich looks terrible in vertexlighting.. a landscape has normaly enough faces to look nice enought

a lightmap, do it per vertex, too, like your hightmap.. thats nice

i really hope to get your source to work like your engine runs on my pc, but i cant compile it!!!!!!!! buähhhhhhhh



December 27, 2000, 02:20 PM

"I wouldn't expect you to put lighting into the texture. That's just stupid."

Can you give me a good reason why this is stupid?


December 27, 2000, 02:25 PM

This lighting is really HARD. I still have sunlight problems. On the pic I posted, the rays of the sunlight are not parallel, which is wrong. Shadows must point all in the same direction, just think of a sunclock. But this would mean there are areas that are occluded from the sunflare but still fullbright ;-) and ray jittering for smooth shadows doesn't look any good with non-local lightources. Reality can be a complex thing sometimes. Everybody notice when you do it wrong, but nobody can tell you why it's wrong...


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.