How large size does glTexImage3D support?

When I set one dimension size of 3D texture to 1024,The texture seems wrong. All texture have the same color which is the first index color I setted.Why?

It is GPU dependent.
You can try this in OpenGL code:
GLint max3dsize=0;
glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &max3dsize);

Or any program for checking your GPU (e.g OpenGL extension viewer)
http://www.realtech-vr.com/glview/download.html

miso

You need to query glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &size).
Todays HW can support up to 512^3, but that doesn’t mean you can load that!
For one byte per texel 512^3 already needs 128MB and available texture memory is limited.
You would have to use proxy textures to check if it fits.
That is why 3D volume rendering is normally done with smaller volume bricks.

Add glGetError calls during debugging.
Read the OpenGL 2.0 spec.
Search the internet for volume bricking.

Thank you. I think I will go further in Volume Rendering domain.