#include "meshgen.h"
#include "backdrop.h"
#include "app.h"
+#include "color.h"
static unsigned int sdr_grid;
static Texture *tex_grid;
static Mesh *mesh_skydome;
static unsigned int sdr_skydome;
-static const Vec3 grid_color = Vec3(1.0, 0.07, 1.0);
-static const Vec3 mid_color = Vec3(0.133, 0.006, 0.612);
-static const Vec3 horiz_color = Vec3(0.612, 0.006, 1.0);
-static const Vec3 zenith_color = Vec3(0.029, 0.029, 0.029);
-static const Vec3 fog_color = Vec3(0.01, 0.01, 0.01);
+static Vec3 grid_color;
+static int uloc_grid_color;
bool init_backdrop()
{
+ grid_color = color(1.0, 0.07, 1.0);
+ Vec3 mid_color = color(0.133, 0.006, 0.612);
+ Vec3 horiz_color = color(0.612, 0.006, 1.0);
+ Vec3 zenith_color = color(0.029, 0.029, 0.029);
+ Vec3 fog_color = color(0.01, 0.01, 0.01);
+
if(!(sdr_grid = create_program_load("sdr/grid.v.glsl", "sdr/grid.p.glsl"))) {
return false;
}
+ uloc_grid_color = get_uniform_loc(sdr_grid, "grid_color");
set_uniform_float3(sdr_grid, "grid_color", grid_color.x, grid_color.y, grid_color.z);
set_uniform_float3(sdr_grid, "fog_color", fog_color.x, fog_color.y, fog_color.z);
glMultMatrixf(xform[0]);
bind_program(sdr_grid);
+ float pulse = 1.0 + sin(time_sec * 3.0) * 0.25;
+ glUniform3f(uloc_grid_color, grid_color.x * pulse, grid_color.y * pulse, grid_color.z * pulse);
bind_texture(tex_grid);
glBegin(GL_QUADS);