X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=gl_rsurf.c;h=746632b3287a9bb2c86f43766fc121464f17434e;hp=d9497d4367b76f867eaab72a8f07dd5d4429baab;hb=HEAD;hpb=91642e0dd9ae0445824471d689d8023af3da31e8 diff --git a/gl_rsurf.c b/gl_rsurf.c index d9497d43..d9f0c461 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -394,7 +394,7 @@ void R_DrawPortals(void) for (portal = model->brush.data_leafs[leafnum].portals;portal;portal = portal->next) { if (portal->numpoints <= POLYGONELEMENTS_MAXPOINTS) - if (!R_CullBox(portal->mins, portal->maxs)) + if (!R_CullFrustum(portal->mins, portal->maxs)) { VectorClear(center); for (i = 0;i < portal->numpoints;i++) @@ -426,7 +426,7 @@ static void R_View_WorldVisibility_CullSurfaces(void) { if (surfacevisible[surfaceindex]) { - if (R_CullBox(surfaces[surfaceindex].mins, surfaces[surfaceindex].maxs) + if (R_CullFrustum(surfaces[surfaceindex].mins, surfaces[surfaceindex].maxs) || (r_vis_trace_surfaces.integer && !R_CanSeeBox(r_vis_trace_samples.integer, r_vis_trace_eyejitter.value, r_vis_trace_enlarge.value, r_vis_trace_expand.value, r_vis_trace_pad.value, r_refdef.view.origin, surfaces[surfaceindex].mins, surfaces[surfaceindex].maxs))) surfacevisible[surfaceindex] = 0; } @@ -459,7 +459,7 @@ void R_View_WorldVisibility(qbool forcenovis) 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 - if (CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, leaf->clusterindex) && !R_CullBox(leaf->mins, leaf->maxs)) + if (CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, leaf->clusterindex) && !R_CullFrustum(leaf->mins, leaf->maxs)) { r_refdef.stats[r_stat_world_leafs]++; r_refdef.viewcache.world_leafvisible[j] = true; @@ -475,7 +475,7 @@ void R_View_WorldVisibility(qbool forcenovis) viewleaf = model->brush.PointInLeaf ? model->brush.PointInLeaf(model, r_refdef.view.origin) : NULL; // if possible fetch the visible cluster bits if (!r_lockpvs.integer && model->brush.FatPVS) - model->brush.FatPVS(model, r_refdef.view.origin, 2, r_refdef.viewcache.world_pvsbits, (r_refdef.viewcache.world_numclusters+7)>>3, false); + model->brush.FatPVS(model, r_refdef.view.origin, 2, &r_refdef.viewcache.world_pvsbits, r_main_mempool, false); // if floating around in the void (no pvs data available, and no // portals available), simply use all on-screen leafs. @@ -490,7 +490,7 @@ void R_View_WorldVisibility(qbool forcenovis) 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)) + if (!R_CullFrustum(leaf->mins, leaf->maxs)) { r_refdef.stats[r_stat_world_leafs]++; r_refdef.viewcache.world_leafvisible[j] = true; @@ -513,7 +513,7 @@ void R_View_WorldVisibility(qbool forcenovis) 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)) + if (CHECKPVSBIT(r_refdef.viewcache.world_pvsbits, leaf->clusterindex) && !R_CullFrustum(leaf->mins, leaf->maxs)) { r_refdef.stats[r_stat_world_leafs]++; r_refdef.viewcache.world_leafvisible[j] = true; @@ -572,7 +572,7 @@ void R_View_WorldVisibility(qbool forcenovis) cullmaxs[0] = p->maxs[0] + cullbias; cullmaxs[1] = p->maxs[1] + cullbias; cullmaxs[2] = p->maxs[2] + cullbias; - if (R_CullBox(cullmins, cullmaxs)) + if (R_CullFrustum(cullmins, cullmaxs)) continue; if (r_vis_trace.integer) { @@ -752,7 +752,7 @@ static void R_Q1BSP_RecursiveGetLightInfo_BSP(r_q1bsp_getlightinfo_t *info, qboo continue; #endif #if 0 - if (!r_shadow_compilingrtlight && R_CullBoxCustomPlanes(node->mins, node->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes)) + if (!r_shadow_compilingrtlight && R_CullBox(node->mins, node->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes)) continue; #endif // axial planes can be processed much more quickly @@ -825,7 +825,7 @@ static void R_Q1BSP_RecursiveGetLightInfo_BSP(r_q1bsp_getlightinfo_t *info, qboo continue; #endif #if 1 - if (!r_shadow_compilingrtlight && R_CullBoxCustomPlanes(leaf->mins, leaf->maxs, info->numfrustumplanes, info->frustumplanes)) + if (!r_shadow_compilingrtlight && R_CullBox(leaf->mins, leaf->maxs, info->numfrustumplanes, info->frustumplanes)) continue; #endif @@ -1009,7 +1009,7 @@ static void R_Q1BSP_RecursiveGetLightInfo_BIH(r_q1bsp_getlightinfo_t *info, cons continue; #endif #if 1 - if (!r_shadow_compilingrtlight && R_CullBoxCustomPlanes(leaf->mins, leaf->maxs, info->numfrustumplanes, info->frustumplanes)) + if (!r_shadow_compilingrtlight && R_CullBox(leaf->mins, leaf->maxs, info->numfrustumplanes, info->frustumplanes)) continue; #endif surfaceindex = leaf->surfaceindex; @@ -1076,7 +1076,7 @@ static void R_Q1BSP_RecursiveGetLightInfo_BIH(r_q1bsp_getlightinfo_t *info, cons continue; #endif #if 0 - if (!r_shadow_compilingrtlight && R_CullBoxCustomPlanes(node->mins, node->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes)) + if (!r_shadow_compilingrtlight && R_CullBox(node->mins, node->maxs, rtlight->cached_numfrustumplanes, rtlight->cached_frustumplanes)) continue; #endif if (info->lightmins[axis] <= node->backmax) @@ -1295,7 +1295,10 @@ void R_Mod_CompileShadowMap(entity_render_t *ent, vec3_t relativelightorigin, ve // exceeding the number of triangles in a single mesh) we have to make sure // that we make only a single mesh - so over-estimate the size of the mesh // to match the model. - r_shadow_compilingrtlight->static_meshchain_shadow_shadowmap = Mod_ShadowMesh_Begin(r_main_mempool, model->surfmesh.num_vertices, model->surfmesh.num_triangles); + // bones_was_here: +128 works around BUG https://github.com/DarkPlacesEngine/darkplaces/issues/119 + // +64 was enough to start the map without triggering ASan, +96 was enough to also edit the light. + // See also: warning in Mod_ShadowMesh_AddMesh + r_shadow_compilingrtlight->static_meshchain_shadow_shadowmap = Mod_ShadowMesh_Begin(r_main_mempool, model->surfmesh.num_vertices, model->surfmesh.num_triangles + 128); R_Shadow_PrepareShadowSides(model->surfmesh.num_triangles); for (surfacelistindex = 0;surfacelistindex < numsurfaces;surfacelistindex++) {