{
if (p->type)
{
- c_particles++;
+ renderstats.particles++;
if (DotProduct(p->org, r_viewforward) >= minparticledist || p->type->orientation == PARTICLE_BEAM)
{
if (p->type == particletype + pt_decal)
{
speedstringcount = 0;
sprintf(r_speeds_string + strlen(r_speeds_string), "org:'%+8.2f %+8.2f %+8.2f' dir:'%+2.3f %+2.3f %+2.3f'\n", r_vieworigin[0], r_vieworigin[1], r_vieworigin[2], r_viewforward[0], r_viewforward[1], r_viewforward[2]);
- sprintf(r_speeds_string + strlen(r_speeds_string), "world:%6i faces%6i nodes%6i leafs%6i dlitwalls\n", c_faces, c_nodes, c_leafs, c_light_polys);
- sprintf(r_speeds_string + strlen(r_speeds_string), "%5i models%5i bmodels%5i sprites%6i particles%4i dlights\n", c_models, c_bmodels, c_sprites, c_particles, c_dlights);
- sprintf(r_speeds_string + strlen(r_speeds_string), "%6i modeltris%6i meshs%6i meshtris\n", c_alias_polys, c_meshs, c_meshelements / 3);
- sprintf(r_speeds_string + strlen(r_speeds_string), "bloom %s: %i copies (%i pixels) %i draws (%i pixels)\n", c_bloom ? "active" : "inactive", c_bloomcopies, c_bloomcopypixels, c_bloomdraws, c_bloomdrawpixels);
- sprintf(r_speeds_string + strlen(r_speeds_string), "realtime lighting:%4i lights%4i clears%4i scissored\n", c_rt_lights, c_rt_clears, c_rt_scissored);
- sprintf(r_speeds_string + strlen(r_speeds_string), "dynamic: %6i shadowmeshes%6i shadowtris%6i lightmeshes%6i lighttris\n", c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris);
- sprintf(r_speeds_string + strlen(r_speeds_string), "precomputed: %6i shadowmeshes%6i shadowtris\n", c_rtcached_shadowmeshes, c_rtcached_shadowtris);
-
- c_alias_polys = 0;
- c_light_polys = 0;
- c_faces = 0;
- c_nodes = 0;
- c_leafs = 0;
- c_models = 0;
- c_bmodels = 0;
- c_sprites = 0;
- c_particles = 0;
- c_dlights = 0;
- c_meshs = 0;
- c_meshelements = 0;
- c_rt_lights = 0;
- c_rt_clears = 0;
- c_rt_scissored = 0;
- c_rt_shadowmeshes = 0;
- c_rt_shadowtris = 0;
- c_rt_lightmeshes = 0;
- c_rt_lighttris = 0;
- c_rtcached_shadowmeshes = 0;
- c_rtcached_shadowtris = 0;
- c_bloom = 0;
- c_bloomcopies = 0;
- c_bloomcopypixels = 0;
- c_bloomdraws = 0;
- c_bloomdrawpixels = 0;
+ sprintf(r_speeds_string + strlen(r_speeds_string), "%5i entities%6i surfaces%6i triangles%5i leafs%5i portals%6i particles\n", renderstats.entities, renderstats.entities_surfaces, renderstats.entities_triangles, renderstats.world_leafs, renderstats.world_portals, renderstats.particles);
+ sprintf(r_speeds_string + strlen(r_speeds_string), "%4i lights%4i clears%4i scissored%7i light%7i shadow%i7 dynamic\n", renderstats.lights, renderstats.lights_clears, renderstats.lights_scissored, renderstats.lights_lighttriangles, renderstats.lights_shadowtriangles, renderstats.lights_dynamicshadowtriangles);
+ if (renderstats.bloom)
+ sprintf(r_speeds_string + strlen(r_speeds_string), "rendered%6i meshes%8i triangles bloompixels%8i copied%8i drawn\n", renderstats.meshes, renderstats.meshes_elements / 3, renderstats.bloom_copypixels, renderstats.bloom_drawpixels);
+ else
+ sprintf(r_speeds_string + strlen(r_speeds_string), "rendered%6i meshes%8i triangles\n", renderstats.meshes, renderstats.meshes_elements / 3);
r_timereport_start = Sys_DoubleTime();
}
+
+ memset(&renderstats, 0, sizeof(renderstats));
}
void R_TimeReport_End(void)
R_Mesh_Draw_ShowTris(firstvertex, numvertices, numtriangles, elements);
return;
}
- c_meshs++;
- c_meshelements += numelements;
+ renderstats.meshes++;
+ renderstats.meshes_elements += numelements;
if (gl_paranoid.integer)
{
unsigned int i, j, size;
matrix4x4_t r_identitymatrix;
-int c_alias_polys, c_light_polys, c_faces, c_nodes, c_leafs, c_models, c_bmodels, c_sprites, c_particles, c_dlights, c_meshs, c_meshelements, c_rt_lights, c_rt_clears, c_rt_scissored, c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris, c_rtcached_shadowmeshes, c_rtcached_shadowtris, c_bloom, c_bloomcopies, c_bloomcopypixels, c_bloomdraws, c_bloomdrawpixels;
+renderstats_t renderstats;
// true during envmap command capture
qboolean envmap;
ent = r_refdef.entities[i];
if (ent->visframe == r_framecount)
{
+ renderstats.entities++;
if (ent->model && ent->model->Draw != NULL)
ent->model->Draw(ent);
else
{
int screenwidth, screenheight, bloomwidth, bloomheight, x, dobloomblend, range;
float xoffset, yoffset, r;
- c_bloom++;
+ renderstats.bloom++;
// set the (poorly named) screenwidth and screenheight variables to
// a power of 2 at least as large as the screen, these will define the
// size of the texture to allocate
// copy view into the full resolution screen image texture
GL_ActiveTexture(0);
qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);
- c_bloomcopies++;
- c_bloomcopypixels += r_view_width * r_view_height;
+ renderstats.bloom_copypixels += r_view_width * r_view_height;
// now scale it down to the bloom size and raise to a power of itself
// to darken it (this leaves the really bright stuff bright, and
// everything else becomes very dark)
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_Color(1, 1, 1, 1);
R_Mesh_Draw(0, 4, 2, polygonelements);
- c_bloomdraws++;
- c_bloomdrawpixels += bloomwidth * bloomheight;
+ renderstats.bloom_drawpixels += bloomwidth * bloomheight;
// render multiple times with a multiply blendfunc to raise to a power
GL_BlendFunc(GL_DST_COLOR, GL_ZERO);
for (x = 1;x < r_bloom_power.integer;x++)
{
R_Mesh_Draw(0, 4, 2, polygonelements);
- c_bloomdraws++;
- c_bloomdrawpixels += bloomwidth * bloomheight;
+ renderstats.bloom_drawpixels += bloomwidth * bloomheight;
}
// we now have a darkened bloom image in the framebuffer, copy it into
// the bloom image texture for more processing
R_Mesh_State(&m);
GL_ActiveTexture(0);
qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);
- c_bloomcopies++;
- c_bloomcopypixels += bloomwidth * bloomheight;
+ renderstats.bloom_copypixels += bloomwidth * bloomheight;
// blend on at multiple vertical offsets to achieve a vertical blur
// TODO: do offset blends using GLSL
range = r_bloom_blur.integer * bloomwidth / 320;
continue;
GL_Color(r, r, r, 1);
R_Mesh_Draw(0, 4, 2, polygonelements);
- c_bloomdraws++;
- c_bloomdrawpixels += bloomwidth * bloomheight;
+ renderstats.bloom_drawpixels += bloomwidth * bloomheight;
GL_BlendFunc(GL_ONE, GL_ONE);
}
// copy the vertically blurred bloom view to a texture
GL_ActiveTexture(0);
qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);
- c_bloomcopies++;
- c_bloomcopypixels += bloomwidth * bloomheight;
+ renderstats.bloom_copypixels += bloomwidth * bloomheight;
// blend the vertically blurred image at multiple offsets horizontally
// to finish the blur effect
// TODO: do offset blends using GLSL
continue;
GL_Color(r, r, r, 1);
R_Mesh_Draw(0, 4, 2, polygonelements);
- c_bloomdraws++;
- c_bloomdrawpixels += bloomwidth * bloomheight;
+ renderstats.bloom_drawpixels += bloomwidth * bloomheight;
GL_BlendFunc(GL_ONE, GL_ONE);
}
// copy the blurred bloom view to a texture
GL_ActiveTexture(0);
qglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, r_view_x, vid.height - (r_view_y + bloomheight), bloomwidth, bloomheight);
- c_bloomcopies++;
- c_bloomcopypixels += bloomwidth * bloomheight;
+ renderstats.bloom_copypixels += bloomwidth * bloomheight;
// go back to full view area
qglViewport(r_view_x, vid.height - (r_view_y + r_view_height), r_view_width, r_view_height);
// put the original screen image back in place and blend the bloom
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_Color(1,1,1,1);
R_Mesh_Draw(0, 4, 2, polygonelements);
- c_bloomdraws++;
- c_bloomdrawpixels += r_view_width * r_view_height;
+ renderstats.bloom_drawpixels += r_view_width * r_view_height;
// now blend on the bloom texture if multipass
if (dobloomblend)
{
GL_BlendFunc(GL_ONE, GL_ONE);
GL_Color(1,1,1,1);
R_Mesh_Draw(0, 4, 2, polygonelements);
- c_bloomdraws++;
- c_bloomdrawpixels += r_view_width * r_view_height;
+ renderstats.bloom_drawpixels += r_view_width * r_view_height;
}
}
if (r_refdef.viewblend[3] >= 0.01f)
int s = ent->skinnum;
if ((unsigned int)s >= (unsigned int)model->numskins)
s = 0;
- if (s >= 1)
- c_models++;
if (model->skinscenes)
{
if (model->skinscenes[s].framecount > 1)
rmeshstate_t m;
if (texture->currentmaterialflags & MATERIALFLAG_NODRAW)
return;
- c_faces += texturenumsurfaces;
+ renderstats.entities_surfaces += texturenumsurfaces;
// FIXME: identify models using a better check than ent->model->brush.shadowmesh
lightmode = ((ent->effects & EF_FULLBRIGHT) || ent->model->brush.shadowmesh) ? 0 : 2;
GL_DepthTest(!(texture->currentmaterialflags & MATERIALFLAG_NODEPTHTEST));
void R_DrawSurfaces(entity_render_t *ent, qboolean skysurfaces)
{
int i, j, f, flagsmask;
+ int counttriangles = 0;
msurface_t *surface, **surfacechain;
texture_t *t, *texture;
model_t *model = ent->model;
R_BuildLightMap(ent, surface);
// add face to draw list
surfacelist[numsurfacelist++] = surface;
+ counttriangles += surface->num_triangles;
if (numsurfacelist >= maxsurfacelist)
{
R_QueueTextureSurfaceList(ent, texture, numsurfacelist, surfacelist, modelorg);
R_BuildLightMap(ent, surface);
// add face to draw list
surfacelist[numsurfacelist++] = surface;
+ counttriangles += surface->num_triangles;
if (numsurfacelist >= maxsurfacelist)
{
R_QueueTextureSurfaceList(ent, texture, numsurfacelist, surfacelist, modelorg);
}
if (numsurfacelist)
R_QueueTextureSurfaceList(ent, texture, numsurfacelist, surfacelist, modelorg);
+ if (!r_showtrispass)
+ renderstats.entities_triangles += counttriangles;
}
// if leaf is in current pvs and on the screen, mark its surfaces
if (CHECKPVSBIT(r_pvsbits, leaf->clusterindex) && !R_CullBox(leaf->mins, leaf->maxs))
{
- c_leafs++;
+ renderstats.world_leafs++;
r_worldleafvisible[j] = true;
if (leaf->numleafsurfaces)
for (i = 0, mark = leaf->firstleafsurface;i < leaf->numleafsurfaces;i++, mark++)
leafstackpos = 1;
while (leafstackpos)
{
- c_leafs++;
+ renderstats.world_leafs++;
leaf = leafstack[--leafstackpos];
r_worldleafvisible[leaf - model->brush.data_leafs] = true;
// mark any surfaces bounding this leaf
// and the leaf is visible in the pvs
// (the first two checks won't cause as many cache misses as the leaf checks)
for (p = leaf->portals;p;p = p->next)
+ {
+ renderstats.world_portals++;
if (DotProduct(r_vieworigin, p->plane.normal) < (p->plane.dist + 1) && !R_CullBox(p->mins, p->maxs) && !r_worldleafvisible[p->past - model->brush.data_leafs] && CHECKPVSBIT(r_pvsbits, p->past->clusterindex))
leafstack[leafstackpos++] = p->past;
+ }
}
}
void R_Q1BSP_Draw(entity_render_t *ent)
{
- if (ent->model == NULL)
+ model_t *model = ent->model;
+ if (model == NULL)
return;
- c_bmodels++;
if (r_drawcollisionbrushes.integer < 2)
R_DrawSurfaces(ent, false);
- if (r_drawcollisionbrushes.integer >= 1 && ent->model->brush.num_brushes)
+ if (r_drawcollisionbrushes.integer >= 1 && model->brush.num_brushes)
{
int i;
- model_t *model = ent->model;
msurface_t *surface;
q3mbrush_t *brush;
R_Mesh_Matrix(&ent->matrix);
if ((ent == r_refdef.worldentity && !r_worldsurfacevisible[surfacelist[surfacelistindex]]))
continue;
surface = model->data_surfaces + surfacelist[surfacelistindex];
+ renderstats.lights_lighttriangles += surface->num_triangles;
if (tex != surface->texture)
{
if (batchnumsurfaces > 0)
}
r_numdlights = 0;
- c_dlights = 0;
if (!r_dynamic.integer || !cl_dlights)
return;
R_RTLight_UpdateFromDLight(&cl_dlights[i].rtlight, &cl_dlights[i], false);
// FIXME: use pointer instead of copy
r_dlight[r_numdlights++] = cl_dlights[i];
- c_dlights++; // count every dlight in use
}
}
}
if (maxshadowelements < nummarktris * 24)
R_Shadow_ResizeShadowElements((nummarktris + 256) * 24);
tris = R_Shadow_ConstructShadowVolume(numverts, numtris, elements, neighbors, invertex3f, &outverts, shadowelements, varray_vertex3f2, projectorigin, projectdistance, nummarktris, marktris);
+ renderstats.lights_dynamicshadowtriangles += tris;
R_Shadow_RenderVolume(outverts, tris, varray_vertex3f2, shadowelements);
}
Mod_ShadowMesh_AddMesh(r_shadow_mempool, r_shadow_compilingrtlight->static_meshchain_shadow, NULL, NULL, NULL, vertex3f, NULL, NULL, NULL, NULL, numtriangles, element3i);
return;
}
+ renderstats.lights_shadowtriangles += numtriangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = vertex3f;
R_Mesh_State(&m);
qglCullFace(GL_BACK); // quake is backwards, this culls front faces
qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
R_Mesh_Draw(0, numvertices, numtriangles, element3i);
- c_rt_shadowmeshes++;
- c_rt_shadowtris += numtriangles;
// increment stencil if frontface is behind depthbuffer
qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
}
R_Mesh_Draw(0, numvertices, numtriangles, element3i);
- c_rt_shadowmeshes++;
- c_rt_shadowtris += numtriangles;
GL_LockArrays(0, 0);
}
qglStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
}
GL_Clear(GL_STENCIL_BUFFER_BIT);
- c_rt_clears++;
+ renderstats.lights_clears++;
}
void R_Shadow_Stage_Lighting(int stenciltest)
GL_Scissor(ix1, vid.height - iy2, ix2 - ix1, iy2 - iy1);
//qglScissor(ix1, iy1, ix2 - ix1, iy2 - iy1);
//qglEnable(GL_SCISSOR_TEST);
- c_rt_scissored++;
+ renderstats.lights_scissored++;
return false;
}
R_Mesh_TexCoordPointer(3, 3, rsurface_normal3f);
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
GL_LockArrays(0, 0);
}
}
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
{
GL_Color(bound(0, color2[0], 1), bound(0, color2[1], 1), bound(0, color2[2], 1), 1);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
}
GL_LockArrays(0, 0);
}
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
{
GL_Color(bound(0, color2[0], 1), bound(0, color2[1], 1), bound(0, color2[2], 1), 1);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
}
GL_LockArrays(0, 0);
}
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
// 0.25 * 0.25 = 0.0625 (this is another pass)
// 0.0625 * 0.0625 = 0.00390625 (this is another pass)
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
GL_LockArrays(0, 0);
memset(&m, 0, sizeof(m));
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
// 0.25 * 0.25 = 0.0625 (this is another pass)
// 0.0625 * 0.0625 = 0.00390625 (this is another pass)
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
GL_LockArrays(0, 0);
memset(&m, 0, sizeof(m));
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
// 0.25 * 0.25 = 0.0625 (this is another pass)
// 0.0625 * 0.0625 = 0.00390625 (this is another pass)
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
GL_LockArrays(0, 0);
memset(&m, 0, sizeof(m));
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
memset(&m, 0, sizeof(m));
m.pointer_vertex = rsurface_vertex3f;
{
GL_Color(bound(0, color2[0], 1), bound(0, color2[1], 1), bound(0, color2[2], 1), 1);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
}
GL_LockArrays(0, 0);
}
GL_LockArrays(surface->num_firstvertex, surface->num_vertices);
R_Mesh_Draw(surface->num_firstvertex, surface->num_vertices, surface->num_triangles, elements);
GL_LockArrays(0, 0);
- c_rt_lightmeshes++;
- c_rt_lighttris += surface->num_triangles;
}
}
}
R_Mesh_Matrix(&ent->matrix);
for (mesh = rtlight->static_meshchain_shadow;mesh;mesh = mesh->next)
{
+ renderstats.lights_shadowtriangles += mesh->numtriangles;
R_Mesh_VertexPointer(mesh->vertex3f);
GL_LockArrays(0, mesh->numverts);
if (r_shadowstage == R_SHADOWSTAGE_STENCIL)
qglCullFace(GL_BACK); // quake is backwards, this culls front faces
qglStencilOp(GL_KEEP, GL_DECR, GL_KEEP);
R_Mesh_Draw(0, mesh->numverts, mesh->numtriangles, mesh->element3i);
- c_rtcached_shadowmeshes++;
- c_rtcached_shadowtris += mesh->numtriangles;
// increment stencil if frontface is behind depthbuffer
qglCullFace(GL_FRONT); // quake is backwards, this culls back faces
qglStencilOp(GL_KEEP, GL_INCR, GL_KEEP);
}
R_Mesh_Draw(0, mesh->numverts, mesh->numtriangles, mesh->element3i);
- c_rtcached_shadowmeshes++;
- c_rtcached_shadowtris += mesh->numtriangles;
GL_LockArrays(0, 0);
}
}
return;
R_Shadow_Stage_ActiveLight(rtlight);
- c_rt_lights++;
+ renderstats.lights++;
usestencil = false;
if (numshadowentities && (!visible || r_shadow_visiblelighting.integer == 1) && gl_stencil && rtlight->shadow && (rtlight->isstatic ? r_rtworldshadows : r_rtdlightshadows))
if (ent->frameblend[0].frame < 0)
return;
- c_sprites++;
-
R_MeshQueue_AddTransparent(ent->effects & EF_NODEPTHTEST ? r_vieworigin : ent->origin, R_DrawSpriteModelCallback, ent, 0);
}
extern int r_framecount;
extern mplane_t frustum[5];
-extern int c_alias_polys, c_light_polys, c_faces, c_nodes, c_leafs, c_models, c_bmodels, c_sprites, c_particles, c_dlights, c_meshs, c_meshelements, c_rt_lights, c_rt_clears, c_rt_scissored, c_rt_shadowmeshes, c_rt_shadowtris, c_rt_lightmeshes, c_rt_lighttris, c_rtcached_shadowmeshes, c_rtcached_shadowtris, c_bloom, c_bloomcopies, c_bloomcopypixels, c_bloomdraws, c_bloomdrawpixels;
+typedef struct renderstats_s
+{
+ int entities;
+ int entities_surfaces;
+ int entities_triangles;
+ int world_leafs;
+ int world_portals;
+ int particles;
+ int meshes;
+ int meshes_elements;
+ int lights;
+ int lights_clears;
+ int lights_scissored;
+ int lights_lighttriangles;
+ int lights_shadowtriangles;
+ int lights_dynamicshadowtriangles;
+ int bloom;
+ int bloom_copypixels;
+ int bloom_drawpixels;
+}
+renderstats_t;
+
+extern renderstats_t renderstats;
// brightness of world lightmaps and related lighting
// (often reduced when world rtlights are enabled)