Advertisement
Guest User

shaders

a guest
Apr 16th, 2017
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. //vertexShader.vert
  2. #version 330 core
  3. layout (location = 0) in vec3 position;
  4. layout (location = 1) in vec3 inColor;
  5. layout (location = 2) in vec2 texCoord;
  6.  
  7. out vec2 TexCoord;
  8. uniform vec4 ourPos2;
  9.  
  10. void main()
  11. {
  12.     gl_Position = vec4(position.x, position.y, position.z, 1.0) / ourPos2;
  13.     TexCoord = texCoord;
  14. }
  15.  
  16. //fragmentShader.frag
  17. #version 330 core
  18.  
  19. in vec2 TexCoord;
  20. out vec4 color;
  21. uniform sampler2D ourTexture;
  22.  
  23. void main()
  24. {
  25.     color = texture(ourTexture, TexCoord);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement