View Full Version : texturing a heightmap
12-31-2000, 10:37 PM
hmm... what are good ways to generate a texcoord for a heightmap??
I am using a height as one variable... but this makes all the heights have the SAME texcoord... looks very ugly in my opinion...
my texture file is layed out like this:
first 10% is like bluish watery color
then there is a big grassy texture
then last 20% is sorta like snow texture
any advice would be helpful!
01-01-2001, 09:22 AM
Why not take the simple method and use the x/z (assuming y is your height) values for your heightmap to translate into texcoords?
For example, say your heightmap is from (-128.0, -128.0) to (128.0, 128.0). Make the texcoord for the first corner (0,0) and for the other corner (1,1) Anything in between, calculate as necessary.
That's assuming you're not tiling the texture.. if you're tiling that probably won't work so well. http://www.opengl.org/discussion_boards/ubb/smile.gif
01-01-2001, 12:44 PM
yes, that's a good idea...
but the thing is then I can't put any "snow" in the texture because it might be mapped to the flat ground... Yeah that happens rarely, but usually the higher alts have more snow...
so is there a way to combine the two techniques??
01-01-2001, 01:03 PM
ok, I've implemented it... and it seems to work well. But I had to replace the watery and the snow parts of the textures... Is there anyway I can make multiple passes and re-texture the snowy tops??
01-01-2001, 04:58 PM
This may not be the best way to do this, but if the landscape doesn't change you can possibly pre-blend everything into one texture when the program first starts. If that would mean having a huge texture (bigger than the video card will handle) it may not be a very good idea, though.
You could also probably use multi-pass rendering and use alpha values based on the height. There may be other people with better ideas. I'd be interested in hearing more ideas myself.
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.