X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=gl_rsurf.c;h=ed5534ae5abc6567b330527d5e6c28c2f3782a63;hb=5341d9394eaad8c3752d9a318f9308d47c428b54;hp=9d5bca92fa303c5bfa4e1bc34e12ab55304c66eb;hpb=1151781920e0ab925cd2e5578474b7da9ebd6a75;p=xonotic%2Fdarkplaces.git diff --git a/gl_rsurf.c b/gl_rsurf.c index 9d5bca92..ed5534ae 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -362,7 +362,7 @@ static void R_DrawPortal_Callback(const entity_render_t *ent, const rtlight_t *r for (i = 0, v = vertex3f;i < numpoints;i++, v += 3) VectorCopy(portal->points[i].position, v); R_Mesh_PrepareVertices_Generic_Arrays(numpoints, vertex3f, NULL, NULL); - R_SetupShader_Generic(NULL, NULL, GL_MODULATE, 1); + R_SetupShader_Generic(NULL, NULL, GL_MODULATE, 1, false, false); R_Mesh_Draw(0, numpoints, 0, numpoints - 2, polygonelement3i, NULL, 0, polygonelement3s, NULL, 0); } @@ -446,7 +446,7 @@ void R_View_WorldVisibility(qboolean forcenovis) // 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 || forcenovis) + if (!viewleaf || viewleaf->clusterindex < 0 || forcenovis || r_trippy.integer) { // no visibility method: (used when floating around in the void) // simply cull each leaf to the frustum (view pyramid) @@ -454,6 +454,8 @@ void R_View_WorldVisibility(qboolean forcenovis) r_refdef.viewcache.world_novis = true; for (j = 0, leaf = model->brush.data_leafs;j < model->brush.num_leafs;j++, leaf++) { + if (leaf->clusterindex < 0) + continue; // if leaf is in current pvs and on the screen, mark its surfaces if (!R_CullBox(leaf->mins, leaf->maxs)) { @@ -475,6 +477,8 @@ void R_View_WorldVisibility(qboolean forcenovis) // similar to quake's RecursiveWorldNode but without cache misses for (j = 0, leaf = model->brush.data_leafs;j < model->brush.num_leafs;j++, leaf++) { + if (leaf->clusterindex < 0) + continue; // if leaf is in current pvs and on the screen, mark its surfaces if (CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, leaf->clusterindex) && !R_CullBox(leaf->mins, leaf->maxs)) { @@ -507,6 +511,8 @@ void R_View_WorldVisibility(qboolean forcenovis) leaf = leafstack[--leafstackpos]; if (r_refdef.viewcache.world_leafvisible[leaf - model->brush.data_leafs]) continue; + if (leaf->clusterindex < 0) + continue; r_refdef.stats.world_leafs++; r_refdef.viewcache.world_leafvisible[leaf - model->brush.data_leafs] = true; // mark any surfaces bounding this leaf @@ -629,7 +635,7 @@ void R_Q1BSP_DrawDepth(entity_render_t *ent) GL_BlendFunc(GL_ONE, GL_ZERO); GL_DepthMask(true); // R_Mesh_ResetTextureState(); - R_SetupShader_DepthOrShadow(); + R_SetupShader_DepthOrShadow(false); if (ent == r_refdef.scene.worldentity) R_DrawWorldSurfaces(false, false, true, false, false); else