Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

vertex shader

By: a guest on Jul 23rd, 2013  |  syntax: None  |  size: 0.48 KB  |  views: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #version 150
  2.  
  3. uniform mat4 projMat;
  4. uniform mat4 viewMat;
  5. uniform mat4 modelMat;
  6. uniform mat3 normalMat;
  7.  
  8. in vec3 inPosition;
  9. in vec2 inTexCoord;
  10. in vec3 inNormal;
  11.  
  12. out vec4 passColor;
  13. out vec2 passTexCoord;
  14. out vec4 eye;
  15. out vec3 normal;
  16.  
  17. void main()
  18. {
  19.     mat4 mvMat = viewMat * modelMat;
  20.     normal = normalize(normalMat * inNormal);
  21.     eye = -(mvMat * vec4(inPosition, 1.0));
  22.  
  23.         passTexCoord = inTexCoord;
  24.         gl_Position = projMat * mvMat * vec4(inPosition,1.0);
  25. }
clone this paste RAW Paste Data