Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#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