Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Extremely simple vertex shader help  (Read 853 times)

0 Members and 1 Guest are viewing this topic.

XGLSuper

  • Newbie
  • *
  • Posts: 4
    • View Profile
Extremely simple vertex shader help
« on: May 25, 2015, 05:39:53 pm »
I have been trying to learn how to write a shader for my game. I have got the fragment shader working mostly. I am having trouble with the vertex shader.

I have been following this tutorial:
https://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/loading.php

It gives an example that just scales all the vertices.
void main(void)
{
   vec4 a = gl_Vertex;
   a.x = a.x * 0.9;
   a.y = a.y * 0.9;


   gl_Position = gl_ModelViewProjectionMatrix * a;

}
 

I have it rendering my vertex array with this shader and nothing shows up, it is just black.

There is no simple tutorials and it is frustrating, this one is simple but it's not working xD

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: Extremely simple vertex shader help
« Reply #1 on: May 25, 2015, 05:52:12 pm »
The minimal vertex shader also sends colors to the fragment shaders.
Yours doesn't. Maybe that's why it's black.