Jump to content
  • Advertisement
  • entries
    232
  • comments
    1463
  • views
    961393

Starting to work on the color map

Sign in to follow this  
Ysaneya

218 views



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  


0 Comments


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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!