Hi all,
I’m trying to read out a 32bit floating point texture on a gf6800 GT.
Here is the code I use:
GLfloat* depthLUT = new GLfloat[w*h*4];
cerr << "w = " << w << endl;
cerr << "h = " << h << endl;
cerr << "subsample = " << subsample << endl;
glActiveTextureARB(GL_TEXTURE0_ARB);
glBindTexture(GL_TEXTURE_2D,textures[0]);
cerr << "istexture = " << (glIsTexture(textures[0]) ? "true" : "false") << endl;
GLint wtex,htex,comp,rs,gs,bs,as;
glGetTexLevelParameteriv( GL_TEXTURE_2D, subsample,GL_TEXTURE_WIDTH, &wtex );
glGetTexLevelParameteriv( GL_TEXTURE_2D, subsample,GL_TEXTURE_HEIGHT, &htex );
glGetTexLevelParameteriv( GL_TEXTURE_2D, subsample,GL_TEXTURE_INTERNAL_FORMAT, &comp );
glGetTexLevelParameteriv( GL_TEXTURE_2D, subsample,GL_TEXTURE_RED_SIZE, &rs );
glGetTexLevelParameteriv( GL_TEXTURE_2D, subsample,GL_TEXTURE_GREEN_SIZE, &gs );
glGetTexLevelParameteriv( GL_TEXTURE_2D, subsample,GL_TEXTURE_BLUE_SIZE, &bs );
glGetTexLevelParameteriv( GL_TEXTURE_2D, subsample,GL_TEXTURE_ALPHA_SIZE, &as );
cerr << "wtex = " << wtex << endl;
cerr << "htex = " << htex << endl;
cerr << "iformat = " << comp << endl;
cerr << "check iformat = " << GL_RGBA_FLOAT32_ATI << endl;
cerr << "component sizes = " << rs << " " << gs << " " << bs << " " << as << endl;
glGetTexImage(GL_TEXTURE_2D,subsample, GL_RGBA, GL_FLOAT,depthLUT);
The console output:
w = 720
h = 576
subsample = 0
istexture = true
wtex = 720
htex = 576
iformat = 34836
check iformat = 34836
component sizes = 32 32 32 32
Why does it crash at the getTexImage call? Removing this call does not cause a crash.
Greetz,
Nico