a question about 1D float point texture

Started by
0 comments, last by V-man 14 years, 8 months ago
hello there, i'm trying to pass a lot of float point numbers to the frag shader. i don't want my float points to lose any precision, so i passed it as a float texture, and this is my setup:


 glGenTextures(1, &cuttingPlaneTable);

 glActiveTexture(GL_TEXTURE1);
 glBindTexture(GL_TEXTURE_1D, cuttingPlaneTable);
 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_REPEAT);
 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
 glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 glTexImage1D(GL_TEXTURE_1D, 0, GL_LUMINANCE32F_ARB , 1000, 0, GL_LUMINANCE, GL_FLOAT, cuttingPlanes);


 printf("[%f,%f,%f]\n",cuttingPlanes[0],cuttingPlanes[1],cuttingPlanes[2]);

		glUniform1i(glGetUniformLocation(shaderID,"cuttingPlaneTable"),1);
but it turned out that there is some limitation on the size of the 1D texture, in my code, if i specify the size as 1000, everything is fine, but if i use the real size, which is 20000, the float numbers become zero in the shader. what am i suppose to fix this problem? will 2D texture be a solution? and how can i know the size limitations of different texture map types? thank you
Advertisement
The max would be glGetIntegerv(GL_MAX....something something

Most cards support 8096
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement