wren
Vulkan-based game engine
Loading...
Searching...
No Matches
mesh.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string_view>
4
5namespace wren::shaders {
6
7const std::string_view kMeshVertShader = R"(
8#version 450
9
10layout(location = 0) in vec3 in_position;
11layout(location = 1) in vec3 in_color;
12
13layout(binding = 0) uniform GLOBALS {
14 mat4 view;
15 mat4 proj;
16} globals;
17
18layout(binding = 1) uniform LOCALS {
19 mat4 model;
20} locals;
21
22layout(location = 0) out vec3 out_color;
23
24void main() {
25 gl_Position = globals.proj * globals.view * locals.model * vec4(in_position, 1.0);
26 out_color = in_color;
27}
28)";
29
30const std::string_view kMeshFragShader = R"(
31#version 450
32
33layout(location = 0) in vec3 in_color;
34
35layout(location = 0) out vec4 out_color;
36
37void main() {
38 out_color = vec4(in_color, 1.0);
39}
40
41)";
42
43} // namespace wren::shaders
Definition editor_scene.hpp:5
const std::string_view kMeshFragShader
Definition mesh.hpp:30
const std::string_view kMeshVertShader
Definition mesh.hpp:7