summaryrefslogtreecommitdiff
path: root/util/ogl_renderer/c++/shaders/basic.hpp
blob: 2b0a65f36a3bce93db21ce627a129389bc80a6f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#pragma once

#include <string_view>

namespace kel {
namespace lbm {
constexpr std::string_view shader_basic_vertex = R"(
#version 330 core

layout(location=0) in vec2 vertices;
layout(location=1) in vec2 v_uv;

out vec2 uv;

void main(){
	uv = v_uv;
	gl_Position = vec4(vertices, 0.0, 1.0);
}
)";

constexpr std::string_view shader_basic_fragment = R"(
#version 330 core

in vec2 uv;
out vec4 color;

uniform sampler2D tex_sampler;

void main(){
	color = texture(tex_sampler, uv);
	color.r = 0.8;
}
)";

}
}