Hi There!
I create a 1d texture as follows:
glGenTextures(1,&texResult);
glBindTexture( GL_TEXTURE_1D,texResult);
glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA, stripeImageWidth, 0, GL_RGBA, GL_FLOAT,stripeImage);// the stripeImage is filled from 0. to 1.
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_1D,GL_TEXTURE_WRAP_S,GL_CLAMP);
In my repaint i make the following:
glEnable(GL_TEXTURE_1D);
glBindTexture( GL_TEXTURE_1D, texResult );
glEnableClientState (GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(1, GL_FLOAT, 0, result_damage);
ShowModelAsList();// Display the DisplayList
But i only get the model with one color, but the entries in result_damage are beween 0. and 0.8.
What could be wrong
Thanks
Juergen
Provided that stripeImageWidth is supplied properly and the image itself is properly organized (i.e. you have all 4 components to your colors and whatnot), I don’t see anything wrong. One thing you may want to try is to convert stripeImage into a GL_UNSIGNED_BYTE like so…