-
Notifications
You must be signed in to change notification settings - Fork 1
/
shaders.hpp
43 lines (36 loc) · 1017 Bytes
/
shaders.hpp
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
37
38
39
40
41
42
43
#pragma once
struct BuiltInShader {
const char *vs_fs;
const char **attribs;
const char *cs;
bool is_cs;
};
enum ShaderType {
SHADER_GRADIENT,
SHADER_SKY,
SHADER_SHADED,
SHADER_POST
};
static const char *sky_attribs[] = { "v_position", NULL };
static const char *sky_src =
#include "shaders/sky.glsl"
;
static const char *gradient_attribs[] = { "v_position", "v_coords", NULL };
static const char *gradient_src =
#include "shaders/gradient.glsl"
;
static const char *shaded_attribs[] = { "v_position", "v_coords", "v_normal", "v_color", NULL };
static const char *shaded_src =
#include "shaders/shaded.glsl"
;
static const char *post_attribs[] = { "v_position", NULL };
static const char *post_src =
#include "shaders/post.glsl"
;
static const BuiltInShader shaders[] = {
{ gradient_src, gradient_attribs, NULL, false },
{ sky_src, sky_attribs, NULL, false },
{ shaded_src, shaded_attribs, NULL, false },
{ post_src, post_attribs, NULL, false },
NULL
};