Sign in to follow this  
schupf

Heightmap creation

Recommended Posts

schupf    221
Hello! I want to write a system to create a terrain heightmap by combining several heightmaps. For example: The user specifies 2 heightmaps (one created from Noise, the other created with a fault algorithm) and then the user should be able to combine both heightmaps with a mathemtical operation like Add or Multiply. Add is no problem, I just iterate over both heightmaps (h1 and h2) points and add them (for all (x,y): (x,y)_h3 = (x,y)_h2 + (x,y)_h1). But I have some problems implementing the operation Multiply. My multipliy operator should basically do this: The first input is a heightmap h1 and the second input should be a weighting heightmap h2, whose height values are in the range [0,1]. If I want to compute a height value of the resulting heightmap h3: (x,y)_h3 = (x,y)_h2 * (x,y)_h3). For example if vertex (x,y) of heightmap h3 is 1, then the full height of h1 at this point should be in the resulting heightmap. If the height at (x,y) in heightmap h3 is 0.3f, then the resulting height value should be 0.3 * (height at heightmap h2 at (x,y)). I think you know what I mean. But my problem: When I create the input heightmaps the values can be in any range. I could create them in the height range [0,200] or [0,1000] or whatever. Should I create every heightmap with a specified height range and a "weighting heightmap" only in range [0,1]? Or should I create all heightmaps in range [0,N] and just devide a weightening heightmap by N? Thanks for any ideas!

Share this post


Link to post
Share on other sites

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

Sign in to follow this