Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualGlass_Knife

Posted 21 February 2014 - 10:56 PM

If I want to draw a teapot or sphere from the GLU library, but I want to use a vertex and fragment shader, I don't understand how this works.  So far, everything I've done with a vertex shader has defined a layout at the top:

layout(location = 0) in vec4 position;
layout(location = 1) in vec4 color;

void main() {

   ... and so on...

Then I use a vertex array bound to 0 or 1 to pass the data to the shader.  What I don't understand is:  if I draw a teapot glutWireTeapot () 

what do I define in the shader as the input vector?


#1Glass_Knife

Posted 21 February 2014 - 10:56 PM

If I want to draw a teapot or sphere from the GLU library, but I want to use a vertex and fragment shader, I don't understand how this works.  So far, everything I've done with a vertex shader has defined a layout at the top:

layout(location = 0) in vec4 position;
layout(location = 1) in vec4 color;

void main() {

   ... and so on...

Then I use a vertex array bound to 0 or 1 to pass the date to the shader.  What I don't understand is:  if I draw a teapot glutWireTeapot () 

what do I define in the shader as the input vector?


PARTNERS