hey bumpy.
i didn’t exactly understand what your post was about, so bear with me…
Originallyl posted by bumpy:
I need to create a relief map created from a matrix of evenly spaced height values, with cravasses (possibly represented by splines?) to be kept very sharp in the transitions from high to low.
first off, i’m not sure what using splines to represent the height map would get you. do you mean that you would have a height map and then a separate list of crevices represented by splines? pehaps you could elaborate on your thoughts there.
if what you need to do is create a 2d relief map based on a height field, then i don’t think opengl will be of much help. you can simply calculate the lighting yourself using a diffuse lighting model (the intensity of light at a vertex is proportional to the cosine of the angle between the normal of the surface at the vertex and the direction from the light to the surface). i think the standard is to have the “sun” placed to the northwest of the map at an infinite distance away, so that the incoming rays of light will all be parallel.
using that method, you’ll naturally be able to pick out crevices pretty ok (depending on what direction you choose to have your rays of light coming from), because slopes perpendicular to the incoming rays of light will either receive full intensity (if they’re facing the light) or no intensity (if they’re facing away from the light), whereas flat land wouldn’t receive as much light.
another thing you could do is test to see if the ray of light intersects the geometry of the terrain mesh before it reaches the current vertex, in which case you wouldn’t light the current vertex as much. that way you’d be able to see shadows, which would make it easier to pick out valleys and such.
Originally posted by bumpy:
I then need to read the interpolated values back in, to give a more detailed view.
i have no idea what you meant by that.
Originally posted by bumpy:
Is any of this possible using openGL?
where opengl would come in handy is if you want a nice 3d model of the height map. but if you just want to create 2d relief maps, i’m not sure how you’d use opengl for that.