Adding light part 2

I’ve changed the way the program calculates the light level on the textures, so it should be more realistic. The sun’s position is configurable, and is used to shade one side of a hill, while the other one will be bright.

Better light model

Better light model

The sun would on the left side of this picture, you can see a small valley in the middle with a hill behind it. Notice the difference in light levels between the right and left sides of the valley and hill. This is actually looking very nice. 🙂

From above

From above

Same valley, seen from above. The walls are about the same steepness. However, there are a few problems and limitations. Firstly, the sun’s position can only be specified in the east-west range. This is not much of a problem, and is easily corrected if necessary. Secondly, there are no shadows yet, but I plan to add support for this. And thirdly, there are these artifacts here on the textures:

Artifacts on the terrain

Artifacts on the terrain

See those lines there. They are everywhere. Actually, they appeared when I implemented the texture splatting as well, but then I managed to work around them, for the most part. But now, I have a plan to get rid of them. The problem is, the height map has integer values. So on many slopes the steepness map will be like a stair instead of a smooth slope. To counter this, I think I need to create a random terrain generator.

I’ve been searching around a bit, and I want too implement a fractal generator for the terrain, preferably in a way that allow me to feed it a number to generate a terrain from(seed), or use an random one. Hopefully this will get me smooth slopes as well as interesting terrain, and i hope to complete this as soon as possible.

-Knut

Advertisements

Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: