wren
Vulkan-based game engine
Loading...
Searching...
No Matches
triangle.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string_view>
4
5namespace wren::shaders {
6
7std::string_view const TRIANGLE_VERT_SHADER = R"(
8#version 450
9
10layout(location = 0) out vec3 fragColor;
11
12vec2 positions[3] = vec2[](
13 vec2(0.0, -0.5),
14 vec2(0.5, 0.5),
15 vec2(-0.5, 0.5)
16);
17
18vec3 colors[3] = vec3[](
19 vec3(1.0, 0.0, 0.0),
20 vec3(0.0, 1.0, 0.0),
21 vec3(0.0, 0.0, 1.0)
22);
23
24void main() {
25 gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
26 fragColor = colors[gl_VertexIndex];
27}
28
29)";
30
31std::string_view const TRIANGLE_FRAG_SHADER = R"(
32#version 450
33
34layout(location = 0) in vec3 fragColor;
35
36layout(location = 0) out vec4 outColor;
37
38void main() {
39 outColor = vec4(fragColor, 1.0);
40}
41)";
42
43} // namespace wren::shaders
Definition editor_scene.hpp:5
std::string_view const TRIANGLE_FRAG_SHADER
Definition triangle.hpp:31
std::string_view const TRIANGLE_VERT_SHADER
Definition triangle.hpp:7