#include "mesh.h"
#include "meshgen.h"
#include "backdrop.h"
+#include "app.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.3, 1.0);
-static const Vec3 mid_color = Vec3(0.4, 0.1, 0.8);
-static const Vec3 horiz_color = Vec3(0.8, 0.1, 1.0);
-static const Vec3 zenith_color = Vec3(0.2, 0.2, 0.2);
-static const Vec3 fog_color = Vec3(0.12, 0.12, 0.12);
+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);
bool init_backdrop()
{
delete tex_grid;
return false;
}
+ tex_grid->set_anisotropy(glcaps.max_aniso);
mesh_skydome = new Mesh;
- gen_sphere(mesh_skydome, 100.0, 32, 16, 1, 0.5);
+ gen_sphere(mesh_skydome, 500.0, 32, 16, 1, 0.5);
mesh_skydome->flip();
+ glClearColor(fog_color.x, fog_color.y, fog_color.z, 1.0);
+
return true;
}
void draw_backdrop()
{
// draw sky
+ Mat4 view_mat_inf = view_matrix.upper3x3();
+ glPushMatrix();
+ glLoadMatrixf(view_mat_inf[0]);
+
+ glDisable(GL_DEPTH_TEST);
+ glDepthMask(0);
+
bind_program(sdr_skydome);
mesh_skydome->draw();
+ glEnable(GL_DEPTH_TEST);
+ glDepthMask(1);
+
+ glPopMatrix();
+
// draw grid
Mat4 xform;
xform.scaling(500.0);