I basically know that i 'connect' my vertex data trough VertexArrayObjects with my Shader
But what happens if my shader has more "in" variables (don't know how to name it) than my VAO ==> the shader doesn't draw anything, no warning, no nothing is there any possibility to check in the shader if a "in" variable has been used or not ?!
/*GL.EnableVertexAttribArray(1); GL.BindBuffer(BufferTarget.ArrayBuffer, normalVboHandle); GL.VertexAttribPointer(1, 3, VertexAttribPointerType.Float, true, Vector3.SizeInBytes, 0); GL.BindAttribLocation(shader.shaderProgramHandle, 1, "in_normal");*/
for example if i comment these lines in my code out, my proggi draws nothing
can i do something like this in my vertex shader?:
#version 130
precision highp float;
uniform mat4 projection_matrix;
uniform mat4 modelview_matrix;
in vec3 in_position;
in vec3 in_normal;
out vec3 normal;
void main(void)
{
//works only for orthogonal modelview
if(the in_normal was bound to an attribute location)
{
normal = (modelview_matrix * vec4(in_normal, 0)).xyz;
}
else
{
normal = vec3(0,0,0);}
gl_Position = projection_matrix * modelview_matrix * vec4(in_position, 1);}";or would it be possible to bind an empty buffer? so i could use the same shader for less attributes
i'm a bit confused about all that stuff x)






