Advertisement Jump to content
  • Advertisement
  • entries
  • comments
  • views

Terrain integration, step 2

Sign in to follow this  


Been a while since i last posted some screenshots:

Things are becoming messy, to say the least. It looks nice and clean in the screenies, but i still have to face a high amount of bugs or problems. I've recently been working on matching the lighting with the sun direction as seen through the atmosphere (yeah, it was incorrect before!), but i think i still have a bug somewhere.. and it's not easy to fix, since the sun has to be transformed by the whole objects hierarchy, which means lots of object-to-world and world-to-object space matrices calculations.

Edges are still visible between adjcent terrain patches, sometimes it's very ugly, sometimes almost unnoticeable. In order to fix it, i'll have to replicate the normals on the bounaries between adjacent patches, but i've yet to write the code.

Another problem is with the heightfield. In the transition between my previous tech demo (which was a standard, flat terrain) to the current one (which is curved on the planet's surface), i feel the heightfield has lots some style. Hard to explain, but now, everything looks very repetitive and similar, at any place on the planet. It's probably just a matter of finding good parameters for the noise functions, but again another thing to fix.

I've switched the high frequencies noise generation to diamond-square - that is much, much faster than 3D Perlin noise, by an order of magnitude at least, and it's important when the camera is near the ground level, since if you're moving quickly, a lot of terrain patches have to be regenerated ( and at that altitude the noise is at high frequencies ). Unfortunately, the same scale is used everywhere on the planet, so it's impossible to mix flat areas noise (for valleys) and mountainous areas noise. Another point in my TODO list.
Sign in to follow this  


Recommended Comments

Fantastic. Funny but the top one looks a bit like Canada the last time I flew over it on a trip from the UK.

Share this comment

Link to comment
The depth haze in the first image amazes me. The transition from terrain to atmosphere is very smooth.
In my own project, this was not so good.
Is this a by-product of the exponential scaling of the colors or did you apply some special hack to achieve this?

Share this comment

Link to comment
Is this a by-product of the exponential scaling of the colors or did you apply some special hack to achieve this?

There is only one "hack": i'm using two different sets of parameters, one for ground level, one for space, and interpolate between the two depending on the camera altitude. In the future i might even add a third set of parameters, for sunsets (since the colors subtely different than what i'd like to have at sunset).

To determine these parameters, well, no miracle. I have assigned a key to each parameter, and i can increase/decrease its value in real-time. So it's just a matter of playing with all the parameters until you get something you are happy with..

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!