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

Starting to work on the color map

Sign in to follow this  


I'm using a 2D lookup table where i encode U as the slope of the terrain, and V as the altitude. This table is pre-generated on the CPU, and so far only contains 4 constant colors (for a quick test).

In the pixel shader, i sample the terrain and get the normal / altitude. I then use normal.y as the cosinus of the slope angle to do the lookup.

It's a very quick test and will only improve as i add more shades of colors and better parameters.

Ultimately, i think i will try not to encode colors in the table, but weights to texture layers. As a single color can only store 4 channels, i might end up using 2 lookup tables like this, which will give me up to 8 texture layers. Similar to texture splatting.. but on a per-pixel level :)

At the moment, the texture shown above is procedurally generated at more than 60 fps on a PIV 1 Ghz + Radeon 9700. I'm not worried about the performance though, as these textures only need to be generated once when the terrain patch is loaded. After that, everything is cached.

For the full planet, i think i will not have to generate textures more than a few times per second.
Sign in to follow this  


Recommended Comments

There are no comments to display.

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!