Hi,
I'm converting my application from using OpenGL 2.0 to OpenGL 3.0. I was using glVertexPointer, glTexCoordPointer and glColorPointer to send the vertices to the GPU and when I doesn't need of Color, I simply disabled it with glDisableClientState(GL_TEXTURE_COORD_ARRAY), so the GPU set gl_Color from vertex shader is white by default.
Now I'm using glDisableVertexAttribArray to disable the vertices and glVertexAttribPointer to send stuff and now comes the problem. glDisableVertexAttribArray(COLOR) set black the color by default in vertex shader! Now I won't fill all the vertices of 1.0f and force to enable the color, so I'm asking you if there is a way to not send the color where it doesn't required without to use particular tricks (like to create a fragment shader for color stuff and another fragment shader to the texture-only stuff).
My shaders looks like this:
#version 330 core
varying vec3 texcoord;
varying vec4 vertex_color;
in vec4 in_Position;
in vec4 in_Color;
in vec4 in_Texture;
void main()
{
gl_Position = in_Position;
texcoord = in_Texture;
vertex_color = in_Color;
}
#version 330 core
uniform sampler3D texture
varying vec3 texcoord;
varying vec4 vertex_color;
void main()
{
vec4 precolor = texture3D(texture, texcoord);
precolor *= vertex_color;
gl_FragColor = precolor;
}