Original Post
hi,
im having problem trying to implement my texture2d Array. here is the c++/opengl code where i put my texture value:
i put the default value 50 for a while to check its right or wrong.
here is the glsl code:
the color appear on the screen is just blank. there are no error appeared when compiling the glsl. any1 notice anything wrong in the code?
thanks in advance
EDIT: i used geforce 9600GT 512MB if thats important
im having problem trying to implement my texture2d Array. here is the c++/opengl code where i put my texture value:
unsigned char* texture3DFit = new unsigned char[textureWidth*textureDepth*textureHeight*3];for(int i = 0; i<textureWidth*textureDepth*textureHeight*3;i++) { texture3DFit = 50;}glBindTexture(GL_TEXTURE_2D_ARRAY, texName);glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MIN_FILTER,GL_LINEAR);glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_MAG_FILTER,GL_LINEAR);glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);glTexParameteri(GL_TEXTURE_2D_ARRAY,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);glTexImage3D(GL_TEXTURE_2D_ARRAY, 0, GL_RGB8, textureWidth, textureHeight, textureDepth, 0, GL_RGB, GL_UNSIGNED_BYTE, texture3DFit); i put the default value 50 for a while to check its right or wrong.
here is the glsl code:
#version 130#extension GL_EXT_gpu_shader4: enableuniform sampler2DArray tex;varying float sphIndexY;varying float sphIndexZ;void main() { vec3 coord; coord.x = gl_TexCoord[0].s; coord.y = gl_TexCoord[0].t; coord.z = 1; vec4 color = texture2DArray(tex, coord.xyz); gl_FragColor = color;}the color appear on the screen is just blank. there are no error appeared when compiling the glsl. any1 notice anything wrong in the code?
thanks in advance
EDIT: i used geforce 9600GT 512MB if thats important