X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrfileman;a=blobdiff_plain;f=src%2Fbackdrop.cc;h=b81a04a35f663a7994161404373e3dc8730b84e2;hp=f9dbe22cfab52ed8f564a6b85cad456f2584c6e8;hb=cb2703917746784c4ea3408a049ff4297dfc268e;hpb=b4582685152d23c4c3b6c7ead4d651c4df06eb01 diff --git a/src/backdrop.cc b/src/backdrop.cc index f9dbe22..b81a04a 100644 --- a/src/backdrop.cc +++ b/src/backdrop.cc @@ -5,6 +5,7 @@ #include "mesh.h" #include "meshgen.h" #include "backdrop.h" +#include "app.h" static unsigned int sdr_grid; static Texture *tex_grid; @@ -12,11 +13,11 @@ 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() { @@ -38,11 +39,14 @@ bool init_backdrop() delete tex_grid; return false; } + tex_grid->set_anisotropy(glcaps.max_aniso); mesh_skydome = new Mesh; 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; } @@ -56,9 +60,21 @@ void cleanup_backdrop() 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);