forked from 15-466/15-466-f22-base4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShowMeshesProgram.hpp
34 lines (25 loc) · 995 Bytes
/
ShowMeshesProgram.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
#pragma once
#include "GL.hpp"
#include "Load.hpp"
#include "Scene.hpp"
//Shader program that provides various modes for visualizing positions,
// colors, normals, and texture coordinates; mostly useful for debugging.
struct ShowMeshesProgram {
ShowMeshesProgram();
~ShowMeshesProgram();
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;
GLuint INSPECT_MODE_int = -1U; //0: basic lighting; 1: position only; 2: normal only; 3: color only; 4: texcoord only
//Textures:
//no textures used
};
extern Load< ShowMeshesProgram > show_meshes_program;
extern Scene::Drawable::Pipeline show_meshes_program_pipeline; //Drawable::Pipeline already initialized with proper uniform locations for this program.