forked from 15-466/15-466-f22-base4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LitColorTextureProgram.hpp
40 lines (31 loc) · 1.12 KB
/
LitColorTextureProgram.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
#pragma once
#include "GL.hpp"
#include "Load.hpp"
#include "Scene.hpp"
//Shader program that draws transformed, lit, textured vertices tinted with vertex colors:
struct LitColorTextureProgram {
LitColorTextureProgram();
~LitColorTextureProgram();
GLuint program = 0;
//Attribute (per-vertex variable) locations:
GLuint Position_vec4 = -1U;
GLuint Normal_vec3 = -1U;
GLuint Color_vec4 = -1U;
GLuint TexCoord_vec2 = -1U;
//Uniform (per-invocation variable) locations:
GLuint OBJECT_TO_CLIP_mat4 = -1U;
GLuint OBJECT_TO_LIGHT_mat4x3 = -1U;
GLuint NORMAL_TO_LIGHT_mat3 = -1U;
//lighting:
GLuint LIGHT_TYPE_int = -1U;
GLuint LIGHT_LOCATION_vec3 = -1U;
GLuint LIGHT_DIRECTION_vec3 = -1U;
GLuint LIGHT_ENERGY_vec3 = -1U;
GLuint LIGHT_CUTOFF_float = -1U;
//Textures:
//TEXTURE0 - texture that is accessed by TexCoord
};
extern Load< LitColorTextureProgram > lit_color_texture_program;
//For convenient scene-graph setup, copy this object:
// NOTE: by default, has texture bound to 1-pixel white texture -- so it's okay to use with vertex-color-only meshes.
extern Scene::Drawable::Pipeline lit_color_texture_program_pipeline;