gl_shaders.h 808 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. namespace GLShaders {
  6. static const char g_vertex_shader[] = R"(
  7. #version 150 core
  8. in vec3 position;
  9. in vec2 texCoord;
  10. out vec2 UV;
  11. mat3 window_scale = mat3(
  12. vec3(1.0, 0.0, 0.0),
  13. vec3(0.0, 5.0/6.0, 0.0), // TODO(princesspeachum): replace hard-coded aspect with uniform
  14. vec3(0.0, 0.0, 1.0)
  15. );
  16. void main() {
  17. gl_Position.xyz = window_scale * position;
  18. gl_Position.w = 1.0;
  19. UV = texCoord;
  20. })";
  21. static const char g_fragment_shader[] = R"(
  22. #version 150 core
  23. in vec2 UV;
  24. out vec3 color;
  25. uniform sampler2D sampler;
  26. void main() {
  27. color = texture(sampler, UV).rgb;
  28. })";
  29. }