diff options
author | bunnei <bunneidev@gmail.com> | 2014-08-26 06:03:05 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-08-26 06:03:05 +0200 |
commit | fef62d0e54c4c8422e74a24053953262618fed11 (patch) | |
tree | 31355774610d25174521e88ca7dcebfe5bbfe715 /src/video_core/renderer_opengl/gl_shaders.h | |
parent | Update README.md to correct OS X typo (diff) | |
parent | Rewrite of OpenGL renderer, including OS X support (diff) | |
download | yuzu-fef62d0e54c4c8422e74a24053953262618fed11.tar yuzu-fef62d0e54c4c8422e74a24053953262618fed11.tar.gz yuzu-fef62d0e54c4c8422e74a24053953262618fed11.tar.bz2 yuzu-fef62d0e54c4c8422e74a24053953262618fed11.tar.lz yuzu-fef62d0e54c4c8422e74a24053953262618fed11.tar.xz yuzu-fef62d0e54c4c8422e74a24053953262618fed11.tar.zst yuzu-fef62d0e54c4c8422e74a24053953262618fed11.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shaders.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/gl_shaders.h b/src/video_core/renderer_opengl/gl_shaders.h new file mode 100644 index 000000000..f84424c47 --- /dev/null +++ b/src/video_core/renderer_opengl/gl_shaders.h @@ -0,0 +1,39 @@ +// Copyright 2014 Citra Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. + +#pragma once + +namespace GLShaders { + +static const char g_vertex_shader[] = R"( +#version 330 core +layout(location = 0) in vec3 position; +layout(location = 1) in vec2 texCoord; + +out vec2 UV; + +mat3 window_scale = mat3( + vec3(1.0, 0.0, 0.0), + vec3(0.0, 5.0/6.0, 0.0), // TODO(princesspeachum): replace hard-coded aspect with uniform + vec3(0.0, 0.0, 1.0) + ); + +void main() { + gl_Position.xyz = window_scale * position; + gl_Position.w = 1.0; + + UV = texCoord; +})"; + +static const char g_fragment_shader[] = R"( +#version 330 core +in vec2 UV; +out vec3 color; +uniform sampler2D sampler; + +void main() { + color = texture(sampler, UV).rgb; +})"; + +} |