PDA

View Full Version : display lists with colorscales



mithun_daa
11-26-2003, 07:55 AM
i have a display list that displays a terrain. now i also have a colorscale that assigns different colors for different heights. is there any way that i can color the whole display list with a new colorscale without having to generate a new list.

pseudo code :

glcolor colorscale
glcalllist terrain

PanzerSchreck
11-26-2003, 08:33 AM
Easiest way would be to use a vertexprogram to color your vertices according to their height, as it also works with a compiled DL. It's easy to implement an they're even supported on a RivaTNT with newer drivers.

But why do you post a second time on that topic (http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/010923.html)?

[This message has been edited by PanzerSchreck (edited 11-26-2003).]

zeckensack
11-26-2003, 08:48 AM
Why not use a 1D texture for the "color map"?

mithun_daa
11-26-2003, 11:37 AM
Originally posted by zeckensack:
Why not use a 1D texture for the "color map"?
i am using a 1d map and just to try out i copied most of the code given in the red book (pg 415). and i added the following code in my display routine

glEnable GL_TEXTURE_GEN_S
glEnable GL_TEXTURE_1D
glBindTexture glTexture1D, texName
glCallList (intJ + (inti) * 10000001)
glDisable glcTexture1D
glDisable glcTextureGenS


but the screen is blank. therez nothin happening.

mithun_daa
11-26-2003, 11:41 AM
also, im not very sure if this is the right way to pass the parameters in VB. i checked a lot of bookz and forums, and they all said that the way im passing my parameters is right, but im not sure if it is really working this way:

glTexImage1D glTexture1D, 0, GL_RGBA, ColorScaleWidth, 0, GL_RGBA, GL_UNSIGNED_BYTE, bytColorScale(0)
glTexImage1D glTexture1D, 0, 4, ColorScaleWidth, 0, GL_RGBA, GL_UNSIGNED_BYTE, bytColorScale(0)
glTexEnvf tetTextureEnv, tenTextureEnvMode, tepModulate
glTexGeni GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR
glTexGenfv GL_S, tgObjectPlane, currentCoeff(0)