This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool change_shadow_size (int dims) { | |
game_log ("generating shadow textures, size %i", dims); | |
g_sett.shadow_size = dims; | |
glBindFramebuffer(GL_FRAMEBUFFER, g_shads.cube_fb); | |
{ // colour cube texture | |
bind_cube_texture (0, g_shads.cube_colour_tex); | |
for (int i = 0; i < 6; i++) { | |
// NOTE: 16F and FLOAT are NOT part of GL 2.1 but MESA didn't support | |
// the 16 and INT which ARE part of GL 2.1 | |
glTexImage2D (GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGBA16F, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void draw_frame (double elapsed) { | |
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | |
if (do_pre_pass) { // depth-writing pre-pass | |
glUseProgram (dshader_programme); | |
for (int i = 0; i < NUM_MONKEYS; i++) { | |
float x = 0.0f; | |
float y = 0.0f; | |
float z = sinf ((float)i) * 100.0f - 100.0f; | |
mat4 M = translate_mat4 (vec3_from_3f (x, y, z)); | |
mat4 PVM = mult_mat4_mat4 (PV, M); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public gist contents |