cvar_t r_wateralpha = {CVAR_SAVE, "r_wateralpha","1", "opacity of water polygons"};
cvar_t r_dynamic = {CVAR_SAVE, "r_dynamic","1", "enables dynamic lights (rocket glow and such)"};
cvar_t r_fullbrights = {CVAR_SAVE, "r_fullbrights", "1", "enables glowing pixels in quake textures (changes need r_restart to take effect)"};
+cvar_t r_q1bsp_skymasking = {0, "r_qb1sp_skymasking", "1", "allows sky polygons in quake1 maps to obscure other geometry"};
cvar_t gl_fogenable = {0, "gl_fogenable", "0", "nehahra fog enable (for Nehahra compatibility only)"};
cvar_t gl_fogdensity = {0, "gl_fogdensity", "0.25", "nehahra fog density (recommend values below 0.1) (for Nehahra compatibility only)"};
Cvar_RegisterVariable(&r_wateralpha);
Cvar_RegisterVariable(&r_dynamic);
Cvar_RegisterVariable(&r_fullbright);
+ Cvar_RegisterVariable(&r_q1bsp_skymasking);
Cvar_RegisterVariable(&r_textureunits);
Cvar_RegisterVariable(&r_glsl);
Cvar_RegisterVariable(&r_glsl_offsetmapping);
R_Mesh_Matrix(&ent->matrix);
}
GL_DepthMask(true);
- // LordHavoc: HalfLife maps have freaky skypolys...
- // LordHavoc: Quake3 never did sky masking (unlike software Quake
- // and Quake2), so disable the sky masking in Quake3 maps as it
- // causes problems with q3map2 sky tricks
- if (!model->brush.ishlbsp && model->type != mod_brushq3)
+ // LordHavoc: HalfLife maps have freaky skypolys so don't use
+ // skymasking on them, and Quake3 never did sky masking (unlike
+ // software Quake and software Quake2), so disable the sky masking
+ // in Quake3 maps as it causes problems with q3map2 sky tricks,
+ // and skymasking also looks very bad when noclipping outside the
+ // level, so don't use it then either.
+ if (model->type == mod_brushq1 && r_q1bsp_skymasking.integer && !r_worldnovis)
{
GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
memset(&m, 0, sizeof(m));
unsigned char r_worldleafvisible[32768];
// TODO: dynamic resize according to r_refdef.worldmodel->num_surfaces
unsigned char r_worldsurfacevisible[262144];
+// if true, the view is currently in a leaf without pvs data
+qboolean r_worldnovis;
/*
===============
memset(r_worldsurfacevisible, 0, model->num_surfaces);
memset(r_worldleafvisible, 0, model->brush.num_leafs);
+ r_worldnovis = false;
+
// if floating around in the void (no pvs data available, and no
// portals available), simply use all on-screen leafs.
if (!viewleaf || viewleaf->clusterindex < 0)
// no visibility method: (used when floating around in the void)
// simply cull each leaf to the frustum (view pyramid)
// similar to quake's RecursiveWorldNode but without cache misses
+ r_worldnovis = true;
for (j = 0, leaf = model->brush.data_leafs;j < model->brush.num_leafs;j++, leaf++)
{
// if leaf is in current pvs and on the screen, mark its surfaces