From d825f40374cf6c88ca0087a23f9a75b8deba26f2 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 23 Mar 2006 11:47:11 +0000 Subject: [PATCH] fixed bug that made light filter cubemaps not work in GLSL mode (was binding a cubemap as a 2D texture... oops) fixed bug that made sky brush entities not appear when not looking at sky brushes in the world (GL_DepthTest/GL_DepthMask were messed up) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6175 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/gl_rmain.c b/gl_rmain.c index 4bc35ef4..c4f2b1fc 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -1029,7 +1029,7 @@ void R_SetupSurfaceShader(const entity_render_t *ent, const texture_t *texture, if (permutation & SHADERPERMUTATION_MODE_LIGHTSOURCE) { R_Mesh_TexMatrix(3, &r_shadow_entitytolight); - if (r_glsl_permutation->loc_Texture_Cube >= 0) R_Mesh_TexBind(3, R_GetTexture(r_shadow_rtlight->currentcubemap)); + //if (r_glsl_permutation->loc_Texture_Cube >= 0) R_Mesh_TexBindCubeMap(3, R_GetTexture(r_shadow_rtlight->currentcubemap)); if (r_glsl_permutation->loc_LightPosition >= 0) qglUniform3fARB(r_glsl_permutation->loc_LightPosition, r_shadow_entitylightorigin[0], r_shadow_entitylightorigin[1], r_shadow_entitylightorigin[2]); if (r_glsl_permutation->loc_LightColor >= 0) qglUniform3fARB(r_glsl_permutation->loc_LightColor, lightcolorbase[0], lightcolorbase[1], lightcolorbase[2]); if (r_glsl_permutation->loc_AmbientScale >= 0) qglUniform1fARB(r_glsl_permutation->loc_AmbientScale, r_shadow_rtlight->ambientscale); @@ -2802,27 +2802,26 @@ static void R_DrawTextureSurfaceList(const entity_render_t *ent, texture_t *text // transparent sky would be ridiculous if (!(texture->currentmaterialflags & MATERIALFLAG_TRANSPARENT)) { - GL_DepthMask(true); if (skyrendernow) { skyrendernow = false; - if (skyrendermasked) - { - R_Sky(); - // restore entity matrix and GL_Color - R_Mesh_Matrix(&ent->matrix); - GL_Color(1,1,1,1); - } + R_Sky(); + // restore entity matrix + R_Mesh_Matrix(&ent->matrix); } + GL_DepthMask(true); // LordHavoc: HalfLife maps have freaky skypolys... //if (!ent->model->brush.ishlbsp) { + GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1); + memset(&m, 0, sizeof(m)); + R_Mesh_State(&m); if (skyrendermasked) { // depth-only (masking) GL_ColorMask(0,0,0,0); - // just to make sure that braindead drivers don't draw anything - // despite that colormask... + // just to make sure that braindead drivers don't draw + // anything despite that colormask... GL_BlendFunc(GL_ZERO, GL_ONE); } else @@ -2830,9 +2829,6 @@ static void R_DrawTextureSurfaceList(const entity_render_t *ent, texture_t *text // fog sky GL_BlendFunc(GL_ONE, GL_ZERO); } - GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1); - memset(&m, 0, sizeof(m)); - R_Mesh_State(&m); for (texturesurfaceindex = 0;texturesurfaceindex < texturenumsurfaces;texturesurfaceindex++) { surface = texturesurfacelist[texturesurfaceindex]; -- 2.39.2