Advertisement
Guest User

Psychedelic Shaders

a guest
Dec 17th, 2018
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //VertexShader.h
  2. const char* vertexShaderSource =
  3. "#version 330 core\n"
  4. "layout(location = 0) in vec3 aPos;\n"
  5. "layout(location = 1) in vec3 aColor;\n"
  6. "layout(location = 2) in vec2 aTexCoord;\n"
  7. "out vec3 ourColor;\n"
  8. "out vec2 TexCoord;\n"
  9. "uniform mat4 u_proj;\n"
  10. "uniform mat4 u_view;\n"
  11. "uniform mat4 u_model;\n"
  12. "void main()\n"
  13. "{\n"
  14. "gl_Position = u_proj * u_view * u_model * vec4(aPos, 1.0);\n"
  15. "ourColor = aColor;\n"
  16. "TexCoord = aTexCoord;\n"
  17. "}\n";
  18.  
  19.  
  20. //FragmentShaders.h
  21.  
  22. const char* fragmentShaderSource =
  23. "#version 330 core\n"
  24. "out vec4 FragColor;\n"
  25. "in vec3 ourColor;\n"
  26. "in vec2 TexCoord;\n"
  27. "uniform sampler2D ourTexture;\n"
  28. "void main()\n"
  29. "{\n"
  30. "FragColor = texture(ourTexture, TexCoord) * vec4(ourColor, 1.0);\n"
  31. "}\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement