Archive for May, 2009

Adding texture splatting

May 30, 2009

As you could see from the screen shots in the previous post, plain textures, although better than wire frame, was a bit boring and repetitive. So I added texture splatting. Now, the program will look at the steepness of the terrain and decide witch texture to use. Or rather, how much of each texture, as they are blended together. The result is impressive:

Texture splatting added

Texture splatting added

What a difference it makes. The terrain is really starting to come alive 🙂

Another angle

Another angle

As you can see, steeper terrain means more rock. These values are taken from the unoptimized height map, so even a flat area can contain interesting textures. This really makes the drawing faster while still giving a good looking terrain.

Another angle

Another angle

I still need to tweak this a bit. And I would also like to be able to use more than just two textures, and perhaps different sized ones as well. But at least now, the terrain is starting to look really good. 🙂

-Knut

Advertisements

Texture mapping

May 26, 2009

I’ve added texture mapping to the project. As mentioned in an earlier post, I found some nice free textures here. The program is currently only using a grass texture, but I’m planing to add a system where it will blend in a rock image depending on how steep the terrain is. The result of adding some greenness:

Texture mapping

Texture mapping

Not too bad, but it’s easy to see that more variation is needed. It actually looks a lot better when the camera is moving around. Here’s another angle:

Texture mapping

Texture mapping

And just for fun, I tried with a rock texture:

With rock texure

With rock texture

Not too bad. 🙂 But I still think a blend of these two will look even better. Especially if I can make it so it gives a visual cue on steepness. That will be the next part I guess.

-Knut

Return of the terrain engine

May 23, 2009

Hello

After a long break, the terrain engine has returned. I’m very sorry for the big time gap between posts, but I’ve been very busy for some time now, with work and also some other hobby projects. But, I have also done a lot of work on the terrain engine.

The project was becoming a bit unmanageable, and I felt that this would only get worse as I added more features. So I have done a big job reorganizing the code into a new project structure, cleaned up a bit and re-factored much of the functionality. I’ve also added a couple of small features. The program actually runs smoother and looks nicer, and it should be a lot easier to add more functionality to it.The camera movement is now based on timing, rather than a fixed value each iteration of the main loop. And the project should be easier to compile on different platforms.

Now I can continue on developing the texture system. I’m thinking about using a steepness map, and blend a rock and grass texture based on that. The steepness map should be calculated using the original height map rather than the optimized one. Hopefully this will create some interesting textures.

I leave you with a screen shot, and I hope it won’t be as long until the next post. 🙂

Return of the terrain engine

Return of the terrain engine

-Knut