![]() |
DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
|
|
#include "quakedef.h"
#include "r_shadow.h"
#include "portals.h"
#include "csprogs.h"
#include "image.h"
Go to the source code of this file.
Data Structures | |
struct | r_q1bsp_getlightinfo_t |
Macros | |
#define | BATCHSIZE 1024 |
#define | GETLIGHTINFO_MAXNODESTACK 4096 |
#define | RSURF_MAX_BATCHSURFACES 8192 |
Functions | |
void | GL_Surf_Init (void) |
void | R_BuildLightMap (const entity_render_t *ent, msurface_t *surface, int combine) |
static void | R_DrawPortal_Callback (const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist) |
void | R_DrawPortals (void) |
static void | R_ListWorldTextures_f (cmd_state_t *cmd) |
void | R_Mod_CompileShadowMap (entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist) |
void | R_Mod_Draw (entity_render_t *ent) |
void | R_Mod_DrawAddWaterPlanes (entity_render_t *ent) |
void | R_Mod_DrawDebug (entity_render_t *ent) |
void | R_Mod_DrawDepth (entity_render_t *ent) |
void | R_Mod_DrawLight (entity_render_t *ent, int numsurfaces, const int *surfacelist, const unsigned char *lighttrispvs) |
void | R_Mod_DrawPrepass (entity_render_t *ent) |
void | R_Mod_DrawShadowMap (int side, entity_render_t *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs) |
void | R_Mod_DrawSky (entity_render_t *ent) |
void | R_Mod_GetLightInfo (entity_render_t *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qbool noocclusion) |
static void | R_Q1BSP_CallRecursiveGetLightInfo (r_q1bsp_getlightinfo_t *info, qbool use_svbsp) |
static void | R_Q1BSP_DrawLight_TransparentCallback (const entity_render_t *ent, const rtlight_t *rtlight, int numsurfaces, int *surfacelist) |
static int | R_Q1BSP_GetLightInfo_comparefunc (const void *ap, const void *bp) |
static void | R_Q1BSP_RecursiveGetLightInfo_BIH (r_q1bsp_getlightinfo_t *info, const bih_t *bih) |
static void | R_Q1BSP_RecursiveGetLightInfo_BSP (r_q1bsp_getlightinfo_t *info, qbool skipsurfaces) |
static void | R_ReplaceWorldTexture_f (cmd_state_t *cmd) |
void | R_Stain (const vec3_t origin, float radius, int cr1, int cg1, int cb1, int ca1, int cr2, int cg2, int cb2, int ca2) |
static void | R_StainNode (mnode_t *node, model_t *model, const vec3_t origin, float radius, const float fcolor[8]) |
void | R_View_WorldVisibility (qbool forcenovis) |
static void | R_View_WorldVisibility_CullSurfaces (void) |
Variables | |
static const msurface_t * | batchsurfacelist [RSURF_MAX_BATCHSURFACES] |
cvar_t | r_ambient = {CF_CLIENT, "r_ambient", "0", "brightens map, value is 0-128"} |
cvar_t | r_lockpvs = {CF_CLIENT, "r_lockpvs", "0", "disables pvs switching, allows you to walk around and inspect what is visible from a given location in the map (anything not visible from your current location will not be drawn)"} |
cvar_t | r_lockvisibility = {CF_CLIENT, "r_lockvisibility", "0", "disables visibility updates, allows you to walk around and inspect what is visible from a given viewpoint in the map (anything offscreen at the moment this is enabled will not be drawn)"} |
static msurface_t * | r_q1bsp_getlightinfo_surfaces |
cvar_t | r_q3bsp_renderskydepth = {CF_CLIENT, "r_q3bsp_renderskydepth", "0", "draws sky depth masking in q3 maps (as in q1 maps), this means for example that sky polygons can hide other things"} |
cvar_t | r_shadow_sortsurfaces |
qbool | r_shadow_usingdeferredprepass |
cvar_t | r_useportalculling = {CF_CLIENT, "r_useportalculling", "1", "improve framerate with r_novis 1 by using portal culling - still not as good as compiled visibility data in the map, but it helps (a value of 2 forces use of this even with vis data, which improves framerates in maps without too much complexity, but hurts in extremely complex maps, which is why 2 is not the default mode)"} |
cvar_t | r_usesurfaceculling = {CF_CLIENT, "r_usesurfaceculling", "1", "skip off-screen surfaces (1 = cull surfaces if the map is likely to benefit, 2 = always cull surfaces)"} |
cvar_t | r_vis_trace = {CF_CLIENT, "r_vis_trace", "0", "test if each portal or leaf is visible using tracelines"} |
cvar_t | r_vis_trace_delay = {CF_CLIENT, "r_vis_trace_delay", "1", "keep a portal visible for this many seconds"} |
cvar_t | r_vis_trace_enlarge = {CF_CLIENT, "r_vis_trace_enlarge", "0", "make portal bounds bigger for tests by (1+this)*size"} |
cvar_t | r_vis_trace_expand = {CF_CLIENT, "r_vis_trace_expand", "0", "make portal bounds bigger for tests by this many units"} |
cvar_t | r_vis_trace_eyejitter = {CF_CLIENT, "r_vis_trace_eyejitter", "8", "use a random offset of this much on the start of each traceline"} |
cvar_t | r_vis_trace_pad = {CF_CLIENT, "r_vis_trace_pad", "8", "accept traces that hit within this many units of the portal"} |
cvar_t | r_vis_trace_samples = {CF_CLIENT, "r_vis_trace_samples", "1", "use this many randomly positioned tracelines each frame to refresh the visible timer"} |
cvar_t | r_vis_trace_surfaces = {CF_CLIENT, "r_vis_trace_surfaces", "0", "also use tracelines to cull surfaces"} |
#define BATCHSIZE 1024 |
Definition at line 1366 of file gl_rsurf.c.
Referenced by R_Q1BSP_DrawLight_TransparentCallback().
#define GETLIGHTINFO_MAXNODESTACK 4096 |
Definition at line 704 of file gl_rsurf.c.
Referenced by R_Q1BSP_RecursiveGetLightInfo_BIH(), and R_Q1BSP_RecursiveGetLightInfo_BSP().
#define RSURF_MAX_BATCHSURFACES 8192 |
Definition at line 1316 of file gl_rsurf.c.
Referenced by R_Mod_DrawLight(), and R_Mod_DrawShadowMap().
Definition at line 1564 of file gl_rsurf.c.
References CF_CLIENT, Cmd_AddCommand(), Cvar_RegisterVariable(), r_ambient, R_ListWorldTextures_f(), r_lockpvs, r_lockvisibility, r_q3bsp_renderskydepth, R_ReplaceWorldTexture_f(), r_useportalculling, r_usesurfaceculling, r_vis_trace, r_vis_trace_delay, r_vis_trace_enlarge, r_vis_trace_expand, r_vis_trace_eyejitter, r_vis_trace_pad, r_vis_trace_samples, and r_vis_trace_surfaces.
Referenced by Render_Init().
void R_BuildLightMap | ( | const entity_render_t * | ent, |
msurface_t * | surface, | ||
int | combine ) |
Definition at line 50 of file gl_rsurf.c.
References bound, client_state_t::buildlightmapmemory, client_state_t::buildlightmapmemorysize, cl, cls, msurface_t::deluxemaptexture, msurface_lightmapinfo_t::extents, i, Image_MakesRGBColorsFromLinear_Lightmap(), int(), cvar_t::integer, client_static_t::levelmempool, msurface_t::lightmapinfo, msurface_lightmapinfo_t::lightmaporigin, msurface_t::lightmaptexture, r_refdef_scene_t::lightstylevalue, MAXLIGHTMAPS, Mem_Alloc, Mem_Free, min, entity_render_t::model, model, n, msurface_lightmapinfo_t::nmapsamples, r_q1bsp_lightmap_updates_combine, r_refdef, r_stat_lightmapupdatepixels, r_stat_lightmapupdates, r_texture_blanknormalmap, R_UpdateTexture(), msurface_lightmapinfo_t::samples, scale, r_refdef_t::scene, size, viddef_t::sRGB3D, msurface_lightmapinfo_t::stainsamples, r_refdef_t::stats, msurface_lightmapinfo_t::styles, VectorCopy, VectorLength, VectorNormalize, vid, vid_sRGB, and vid_sRGB_fallback.
Referenced by R_DrawModelSurfaces().
|
static |
Definition at line 343 of file gl_rsurf.c.
References CHECKGLERROR, mleaf_t::clusterindex, r_refdef_view_t::colorscale, GL_BlendFunc(), GL_Color(), GL_CullFace(), GL_DepthMask(), GL_DepthRange(), GL_DepthTest(), GL_NONE, GL_ONE_MINUS_SRC_ALPHA, GL_PolygonOffset(), GL_SRC_ALPHA, mportal_t::here, i, identitymatrix, min, NULL, mportal_t::numpoints, mportal_t::past, mportal_t::points, polygonelement3i, polygonelement3s, POLYGONELEMENTS_MAXPOINTS, r_refdef_t::polygonfactor, r_refdef_t::polygonoffset, mvertex_t::position, R_EntityMatrix(), R_Mesh_Draw(), R_Mesh_PrepareVertices_Generic_Arrays(), r_refdef, R_SetupShader_Generic_NoTexture(), v, VectorCopy, and r_refdef_t::view.
Referenced by R_DrawPortals().
Definition at line 381 of file gl_rsurf.c.
References f, i, ixtable, mportal_t::maxs, mportal_t::mins, model, mportal_t::next, NULL, mportal_t::numpoints, mportal_t::points, POLYGONELEMENTS_MAXPOINTS, mvertex_t::position, R_CullFrustum(), R_DrawPortal_Callback(), R_MeshQueue_AddTransparent(), r_refdef, rsurface, rsurfacestate_t::rtlight, r_refdef_t::scene, TRANSPARENTSORT_DISTANCE, VectorAdd, VectorClear, VectorScale, r_refdef_t::viewcache, r_refdef_viewcache_t::world_leafvisible, and r_refdef_scene_t::worldmodel.
Referenced by R_RenderScene().
|
static |
Definition at line 1532 of file gl_rsurf.c.
References Con_Print(), Con_Printf(), model_t::data_textures, i, texture_t::name, r_refdef, r_refdef_t::scene, and r_refdef_scene_t::worldmodel.
Referenced by GL_Surf_Init().
void R_Mod_CompileShadowMap | ( | entity_render_t * | ent, |
vec3_t | relativelightorigin, | ||
vec3_t | relativelightdirection, | ||
float | lightradius, | ||
int | numsurfaces, | ||
const int * | surfacelist ) |
Definition at line 1286 of file gl_rsurf.c.
References texture_t::basematerialflags, rtlight_t::cullmaxs, rtlight_t::cullmins, i, MATERIALFLAG_NOSHADOW, rtlight_t::matrix_worldtolight, msurface_t::maxs, msurface_t::mins, Mod_ShadowMesh_Begin(), Mod_ShadowMesh_Finish(), entity_render_t::model, model, NULL, msurface_t::num_firsttriangle, msurface_t::num_triangles, numshadowsides, r_main_mempool, R_Shadow_ChooseSidesFromBox(), r_shadow_compilingrtlight, R_Shadow_PrepareShadowSides(), R_Shadow_ShadowMapFromList(), shadowsides, shadowsideslist, rtlight_t::static_meshchain_shadow_shadowmap, rtlight_t::static_shadowmap_casters, rtlight_t::static_shadowmap_receivers, and msurface_t::texture.
Referenced by Mod_DARKPLACESMODEL_Load(), Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_INTERQUAKEMODEL_Load(), Mod_OBJ_Load(), Mod_PSKMODEL_Load(), Mod_Q1BSP_Load(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), Mod_VBSP_Load(), and Mod_ZYMOTICMODEL_Load().
void R_Mod_Draw | ( | entity_render_t * | ent | ) |
Definition at line 637 of file gl_rsurf.c.
References entity_render_t::model, model, NULL, and R_DrawModelSurfaces().
Referenced by Mod_DARKPLACESMODEL_Load(), Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_INTERQUAKEMODEL_Load(), Mod_Mesh_Create(), Mod_OBJ_Load(), Mod_PSKMODEL_Load(), Mod_Q1BSP_Load(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), Mod_VBSP_Load(), and Mod_ZYMOTICMODEL_Load().
void R_Mod_DrawAddWaterPlanes | ( | entity_render_t * | ent | ) |
Definition at line 603 of file gl_rsurf.c.
References rsurfacestate_t::entity, entity_render_t::entitynumber, i, MATERIALFLAG_CAMERA, MATERIALFLAG_REFLECTION, MATERIALFLAG_REFRACTION, MATERIALFLAG_WATERSHADER, MAX_EDICTS, entity_render_t::model, model, n, NULL, r_refdef, R_Water_AddWaterPlane(), RSurf_ActiveModelEntity(), rsurface, r_refdef_t::scene, texture, r_refdef_t::viewcache, r_refdef_viewcache_t::world_surfacevisible, and r_refdef_scene_t::worldentity.
Referenced by Mod_Mesh_AddSurface(), and Mod_SetDrawSkyAndWater().
void R_Mod_DrawDebug | ( | entity_render_t * | ent | ) |
Definition at line 660 of file gl_rsurf.c.
References entity_render_t::model, NULL, and R_DrawModelSurfaces().
Referenced by Mod_DARKPLACESMODEL_Load(), Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_INTERQUAKEMODEL_Load(), Mod_Mesh_Create(), Mod_OBJ_Load(), Mod_PSKMODEL_Load(), Mod_Q1BSP_Load(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), Mod_VBSP_Load(), and Mod_ZYMOTICMODEL_Load().
void R_Mod_DrawDepth | ( | entity_render_t * | ent | ) |
Definition at line 645 of file gl_rsurf.c.
References r_refdef_view_t::colormask, GL_BlendFunc(), GL_Color(), GL_ColorMask(), GL_DepthMask(), GL_DepthTest(), GL_ONE, GL_ZERO, entity_render_t::model, model, NULL, R_DrawModelSurfaces(), r_refdef, and r_refdef_t::view.
Referenced by Mod_DARKPLACESMODEL_Load(), Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_INTERQUAKEMODEL_Load(), Mod_Mesh_Create(), Mod_OBJ_Load(), Mod_PSKMODEL_Load(), Mod_Q1BSP_Load(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), Mod_VBSP_Load(), and Mod_ZYMOTICMODEL_Load().
void R_Mod_DrawLight | ( | entity_render_t * | ent, |
int | numsurfaces, | ||
const int * | surfacelist, | ||
const unsigned char * | lighttrispvs ) |
Definition at line 1399 of file gl_rsurf.c.
References batchsurfacelist, bound, CHECKGLERROR, texture_t::currentmaterialflags, rsurfacestate_t::entity, entity_render_t::flags, r_refdef_view_t::forward, i, cvar_t::integer, rsurfacestate_t::localvieworigin, MATERIALFLAG_CAMERA, MATERIALFLAG_NODEPTHTEST, MATERIALFLAG_NORTLIGHT, MATERIALFLAG_REFLECTION, MATERIALFLAG_REFRACTION, MATERIALFLAG_WALL, MATERIALFLAG_WATERSHADER, MATERIALFLAGMASK_DEPTHSORTED, rsurfacestate_t::matrix, Matrix4x4_Transform(), msurface_t::maxs, min, msurface_t::mins, entity_render_t::model, model, rsurfacestate_t::modelsurfaces, r_fb, R_FrameData_ReturnToMark(), R_FrameData_SetMark(), R_GetCurrentTexture(), R_MeshQueue_AddTransparent(), R_Q1BSP_DrawLight_TransparentCallback(), r_refdef, R_Shadow_RenderLighting(), r_shadow_usingdeferredprepass, r_transparent_sortsurfacesbynearest, RENDER_WORLDOBJECT, r_waterstate_t::renderingscene, RSURF_MAX_BATCHSURFACES, rsurface, rsurfacestate_t::rtlight, r_refdef_t::scene, msurface_t::texture, rsurfacestate_t::texture, entity_render_t::transparent_offset, texture_t::transparentsort, TRANSPARENTSORT_HUD, TRANSPARENTSORT_SKY, r_refdef_t::view, r_refdef_t::viewcache, r_framebufferstate_t::water, r_refdef_viewcache_t::world_surfacevisible, and r_refdef_scene_t::worldentity.
Referenced by Mod_DARKPLACESMODEL_Load(), Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_INTERQUAKEMODEL_Load(), Mod_Mesh_Create(), Mod_OBJ_Load(), Mod_PSKMODEL_Load(), Mod_Q1BSP_Load(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), Mod_VBSP_Load(), and Mod_ZYMOTICMODEL_Load().
void R_Mod_DrawPrepass | ( | entity_render_t * | ent | ) |
Definition at line 667 of file gl_rsurf.c.
References entity_render_t::model, model, NULL, and R_DrawModelSurfaces().
Referenced by Mod_DARKPLACESMODEL_Load(), Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_INTERQUAKEMODEL_Load(), Mod_Mesh_Create(), Mod_OBJ_Load(), Mod_PSKMODEL_Load(), Mod_Q1BSP_Load(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), Mod_VBSP_Load(), and Mod_ZYMOTICMODEL_Load().
void R_Mod_DrawShadowMap | ( | int | side, |
entity_render_t * | ent, | ||
const vec3_t | relativelightorigin, | ||
const vec3_t | relativelightdirection, | ||
float | lightradius, | ||
int | modelnumsurfaces, | ||
const int * | modelsurfacelist, | ||
const unsigned char * | surfacesides, | ||
const vec3_t | lightmins, | ||
const vec3_t | lightmaxs ) |
Definition at line 1320 of file gl_rsurf.c.
References BATCHNEED_ALLOWMULTIDRAW, BATCHNEED_ARRAY_VERTEX, rsurfacestate_t::batchnumvertices, batchsurfacelist, rsurfacestate_t::batchvertex3f, rsurfacestate_t::batchvertex3f_bufferoffset, rsurfacestate_t::batchvertex3f_vertexbuffer, BoxesOverlap, r_refdef_view_t::cullface_back, texture_t::currentmaterialflags, GL_CullFace(), GL_NONE, MATERIALFLAG_NOCULLFACE, MATERIALFLAG_NOSHADOW, msurface_t::maxs, msurface_t::mins, entity_render_t::model, model, msurface_t::num_triangles, R_FrameData_ReturnToMark(), R_FrameData_SetMark(), R_GetCurrentTexture(), R_Mesh_PrepareVertices_Vertex3f(), r_refdef, r_stat_lights_dynamicshadowtriangles, r_stat_lights_shadowtriangles, RSurf_DrawBatch(), RSURF_MAX_BATCHSURFACES, RSurf_PrepareVerticesForBatch(), rsurface, r_refdef_t::stats, msurface_t::texture, rsurfacestate_t::texture, and r_refdef_t::view.
Referenced by Mod_DARKPLACESMODEL_Load(), Mod_IDP0_Load(), Mod_IDP2_Load(), Mod_IDP3_Load(), Mod_INTERQUAKEMODEL_Load(), Mod_Mesh_Create(), Mod_OBJ_Load(), Mod_PSKMODEL_Load(), Mod_Q1BSP_Load(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), Mod_VBSP_Load(), and Mod_ZYMOTICMODEL_Load().
void R_Mod_DrawSky | ( | entity_render_t * | ent | ) |
Definition at line 596 of file gl_rsurf.c.
References entity_render_t::model, NULL, and R_DrawModelSurfaces().
Referenced by Mod_Mesh_AddSurface(), and Mod_SetDrawSkyAndWater().
void R_Mod_GetLightInfo | ( | entity_render_t * | ent, |
vec3_t | relativelightorigin, | ||
float | lightradius, | ||
vec3_t | outmins, | ||
vec3_t | outmaxs, | ||
int * | outleaflist, | ||
unsigned char * | outleafpvs, | ||
int * | outnumleafspointer, | ||
int * | outsurfacelist, | ||
unsigned char * | outsurfacepvs, | ||
int * | outnumsurfacespointer, | ||
unsigned char * | outshadowtrispvs, | ||
unsigned char * | outlighttrispvs, | ||
unsigned char * | visitingleafpvs, | ||
int | numfrustumplanes, | ||
const mplane_t * | frustumplanes, | ||
qbool | noocclusion ) |
Definition at line 1202 of file gl_rsurf.c.
References model_t::brush, model_brush_t::data_portals, model_t::data_surfaces, rsurfacestate_t::entity, r_q1bsp_getlightinfo_t::frontsidecasting, r_q1bsp_getlightinfo_t::frustumplanes, model_brush_t::GetPVS, cvar_t::integer, r_q1bsp_getlightinfo_t::lightmaxs, r_q1bsp_getlightinfo_t::lightmins, r_q1bsp_getlightinfo_t::lightradius, max, min, entity_render_t::model, r_q1bsp_getlightinfo_t::model, r_q1bsp_getlightinfo_t::noocclusion, NULL, model_brush_t::num_leafs, model_t::num_surfaces, surfmesh_t::num_triangles, r_q1bsp_getlightinfo_t::numfrustumplanes, r_q1bsp_getlightinfo_t::outleaflist, r_q1bsp_getlightinfo_t::outleafpvs, r_q1bsp_getlightinfo_t::outlighttrispvs, r_q1bsp_getlightinfo_t::outmaxs, r_q1bsp_getlightinfo_t::outmins, r_q1bsp_getlightinfo_t::outnumleafs, r_q1bsp_getlightinfo_t::outnumsurfaces, r_q1bsp_getlightinfo_t::outshadowtrispvs, r_q1bsp_getlightinfo_t::outsurfacelist, r_q1bsp_getlightinfo_t::outsurfacepvs, Portal_Visibility(), r_q1bsp_getlightinfo_t::pvs, R_Q1BSP_CallRecursiveGetLightInfo(), R_Q1BSP_GetLightInfo_comparefunc(), r_q1bsp_getlightinfo_surfaces, r_refdef, r_shadow_compilingrtlight, r_shadow_frontsidecasting, r_shadow_realtime_dlight_portalculling, r_shadow_realtime_dlight_svbspculling, r_shadow_realtime_world_compileportalculling, r_shadow_realtime_world_compilesvbsp, r_shadow_sortsurfaces, r_q1bsp_getlightinfo_t::relativelightorigin, RSurf_ActiveModelEntity(), rsurface, r_refdef_t::scene, model_t::surfmesh, VectorCopy, r_q1bsp_getlightinfo_t::visitingleafpvs, and r_refdef_scene_t::worldentity.
Referenced by Mod_Mesh_Create(), Mod_OBJ_Load(), Mod_Q1BSP_Load(), Mod_Q2BSP_Load(), Mod_Q3BSP_Load(), and Mod_VBSP_Load().
|
static |
Definition at line 1100 of file gl_rsurf.c.
References model_t::brush, CHECKPVSBIT, mnode_t::children, Con_DPrintf(), model_brush_t::data_leafs, model_brush_t::data_nodes, developer_extra, mplane_t::dist, DotProduct, cvar_t::integer, bih_t::leafs, max, svbsp_t::maxnodes, mleaf_t::maxs, min, mleaf_t::mins, r_q1bsp_getlightinfo_t::model, svbsp_t::nodes, mplane_t::normal, NULL, model_brush_t::num_leafs, model_t::num_surfaces, surfmesh_t::num_triangles, svbsp_t::numnodes, origin, r_q1bsp_getlightinfo_t::outleaflist, r_q1bsp_getlightinfo_t::outleafpvs, r_q1bsp_getlightinfo_t::outlighttrispvs, r_q1bsp_getlightinfo_t::outmaxs, r_q1bsp_getlightinfo_t::outmins, r_q1bsp_getlightinfo_t::outnumleafs, r_q1bsp_getlightinfo_t::outnumsurfaces, r_q1bsp_getlightinfo_t::outshadowtrispvs, r_q1bsp_getlightinfo_t::outsurfacepvs, mnode_t::plane, R_FrameData_Alloc(), R_Q1BSP_RecursiveGetLightInfo_BIH(), R_Q1BSP_RecursiveGetLightInfo_BSP(), r_shadow_usebihculling, r_svbsp, svbsp_t::ranoutofnodes, r_q1bsp_getlightinfo_t::relativelightorigin, model_t::render_bih, SETPVSBIT, svbsp_t::stat_occluders_accepted, svbsp_t::stat_occluders_fragments_accepted, svbsp_t::stat_occluders_fragments_rejected, svbsp_t::stat_occluders_rejected, svbsp_t::stat_queries_accepted, svbsp_t::stat_queries_fragments_accepted, svbsp_t::stat_queries_fragments_rejected, svbsp_t::stat_queries_rejected, model_t::surfmesh, r_q1bsp_getlightinfo_t::svbsp_active, SVBSP_Init(), r_q1bsp_getlightinfo_t::svbsp_insertoccluder, mplane_t::type, and VectorCopy.
Referenced by R_Mod_GetLightInfo().
|
static |
Definition at line 1368 of file gl_rsurf.c.
References BATCHSIZE, entity_render_t::flags, i, min, rsurfacestate_t::modelsurfaces, R_FrameData_ReturnToMark(), R_FrameData_SetMark(), R_GetCurrentTexture(), R_Shadow_RenderLighting(), R_Shadow_RenderMode_ActiveLight(), R_Shadow_RenderMode_Begin(), R_Shadow_RenderMode_End(), R_Shadow_RenderMode_Lighting(), R_Shadow_SetupEntityLight(), RENDER_NOSELFSHADOW, rsurface, rtlight_t::shadowmapatlassidesize, msurface_t::texture, and rsurfacestate_t::texture.
Referenced by R_Mod_DrawLight().
Definition at line 1187 of file gl_rsurf.c.
References a, b, r_q1bsp_getlightinfo_surfaces, and msurface_t::texture.
Referenced by R_Mod_GetLightInfo().
|
static |
Definition at line 970 of file gl_rsurf.c.
References bih_node_t::back, bih_node_t::backmax, BIH_MAXUNORDEREDCHILDREN, BIH_RENDERTRIANGLE, BIH_SPLITX, BIH_UNORDERED, BoxesOverlap, CHECKPVSBIT, bih_node_t::children, texture_t::currentmaterialflags, surfmesh_t::data_element3i, model_t::data_surfaces, surfmesh_t::data_vertex3f, bih_node_t::front, bih_node_t::frontmin, r_q1bsp_getlightinfo_t::frontsidecasting, r_q1bsp_getlightinfo_t::frustumplanes, GETLIGHTINFO_MAXNODESTACK, bih_leaf_t::itemindex, bih_t::leafs, r_q1bsp_getlightinfo_t::lightmaxs, r_q1bsp_getlightinfo_t::lightmins, MATERIALFLAG_NOCULLFACE, MATERIALFLAG_NOSHADOW, bih_leaf_t::maxs, bih_node_t::maxs, bih_leaf_t::mins, bih_node_t::mins, r_q1bsp_getlightinfo_t::model, bih_t::nodes, r_q1bsp_getlightinfo_t::noocclusion, NULL, r_q1bsp_getlightinfo_t::numfrustumplanes, r_q1bsp_getlightinfo_t::outlighttrispvs, r_q1bsp_getlightinfo_t::outnumsurfaces, r_q1bsp_getlightinfo_t::outshadowtrispvs, r_q1bsp_getlightinfo_t::outsurfacelist, r_q1bsp_getlightinfo_t::outsurfacepvs, PointInfrontOfTriangle, R_CullBox(), R_GetCurrentTexture(), r_shadow_compilingrtlight, r_svbsp, r_q1bsp_getlightinfo_t::relativelightorigin, bih_t::rootnode, SETPVSBIT, bih_leaf_t::surfaceindex, model_t::surfmesh, r_q1bsp_getlightinfo_t::svbsp_active, SVBSP_AddPolygon(), r_q1bsp_getlightinfo_t::svbsp_insertoccluder, msurface_t::texture, bih_leaf_t::type, bih_node_t::type, v, v2, and VectorCopy.
Referenced by R_Q1BSP_CallRecursiveGetLightInfo().
|
static |
Definition at line 706 of file gl_rsurf.c.
References BoxesOverlap, BoxInsideBox, BoxOnPlaneSide(), model_t::brush, CHECKPVSBIT, mnode_t::children, mleaf_t::clusterindex, texture_t::currentmaterialflags, surfmesh_t::data_element3i, model_brush_t::data_leafs, model_brush_t::data_nodes, model_t::data_surfaces, surfmesh_t::data_vertex3f, mplane_t::dist, mleaf_t::firstleafsurface, r_q1bsp_getlightinfo_t::frontsidecasting, r_q1bsp_getlightinfo_t::frustumplanes, GETLIGHTINFO_MAXNODESTACK, i, r_q1bsp_getlightinfo_t::lightmaxs, r_q1bsp_getlightinfo_t::lightmins, MATERIALFLAG_NOCULLFACE, MATERIALFLAG_NOSHADOW, max, mleaf_t::maxs, mnode_t::maxs, msurface_t::maxs, min, mleaf_t::mins, mnode_t::mins, msurface_t::mins, r_q1bsp_getlightinfo_t::model, mportal_t::next, r_q1bsp_getlightinfo_t::noocclusion, NULL, msurface_t::num_firsttriangle, r_q1bsp_getlightinfo_t::numfrustumplanes, mleaf_t::numleafsurfaces, mportal_t::numpoints, r_q1bsp_getlightinfo_t::outleaflist, r_q1bsp_getlightinfo_t::outleafpvs, r_q1bsp_getlightinfo_t::outlighttrispvs, r_q1bsp_getlightinfo_t::outmaxs, r_q1bsp_getlightinfo_t::outmins, r_q1bsp_getlightinfo_t::outnumleafs, r_q1bsp_getlightinfo_t::outnumsurfaces, r_q1bsp_getlightinfo_t::outshadowtrispvs, r_q1bsp_getlightinfo_t::outsurfacelist, r_q1bsp_getlightinfo_t::outsurfacepvs, mnode_t::plane, PlaneDist, PointInfrontOfTriangle, mportal_t::points, mleaf_t::portals, mvertex_t::position, r_q1bsp_getlightinfo_t::pvs, R_CullBox(), R_GetCurrentTexture(), r_shadow_compilingrtlight, r_svbsp, r_q1bsp_getlightinfo_t::relativelightorigin, SETPVSBIT, model_t::surfmesh, r_q1bsp_getlightinfo_t::svbsp_active, SVBSP_AddPolygon(), r_q1bsp_getlightinfo_t::svbsp_insertoccluder, msurface_t::texture, TriangleBBoxOverlapsBox, mplane_t::type, v, v2, and VectorCopy.
Referenced by R_Q1BSP_CallRecursiveGetLightInfo().
|
static |
Definition at line 1483 of file gl_rsurf.c.
References cl, cmd(), Cmd_Argc(), Cmd_Argv(), Con_Print(), Con_Printf(), texture_t::currentskinframe, model_t::data_textures, i, client_state_t::islocalgame, matchpattern(), texture_t::name, r, r_refdef, R_SkinFrame_LoadExternal(), r_refdef_t::scene, TEXF_ALPHA, TEXF_MIPMAP, TEXF_PICMIP, client_state_t::worldmodel, and r_refdef_scene_t::worldmodel.
Referenced by GL_Surf_Init().
void R_Stain | ( | const vec3_t | origin, |
float | radius, | ||
int | cr1, | ||
int | cg1, | ||
int | cb1, | ||
int | ca1, | ||
int | cr2, | ||
int | cg2, | ||
int | cb2, | ||
int | ca2 ) |
Definition at line 298 of file gl_rsurf.c.
References model_t::brush, client_state_t::brushmodel_entities, model_t::brushq1, cl, model_brush_t::data_nodes, client_state_t::entities, hull_t::firstclipnode, model_brushq1_t::hulls, entity_render_t::inversematrix, model_brushq1_t::lightdata, Matrix4x4_Transform(), entity_render_t::model, model, n, NULL, client_state_t::num_brushmodel_entities, origin, r_refdef, R_StainNode(), entity_t::render, r_refdef_t::scene, and r_refdef_scene_t::worldmodel.
Referenced by CL_ParticleEffect_Fallback(), CL_ParticleExplosion(), and R_DrawParticles().
|
static |
Definition at line 176 of file gl_rsurf.c.
References a, bound, mnode_t::children, DotProduct, msurface_lightmapinfo_t::extents, mnode_t::firstsurface, i, int(), lhrandom, msurface_t::lightmapinfo, model, mplane_t::normal, mnode_t::numsurfaces, origin, mnode_t::plane, PlaneDiff, R_StainNode(), sqrt(), msurface_lightmapinfo_t::stainsamples, msurface_lightmapinfo_t::texinfo, msurface_lightmapinfo_t::texturemins, mplane_t::type, mtexinfo_t::vecs, and VectorCopy.
Referenced by R_Stain(), and R_StainNode().
Definition at line 436 of file gl_rsurf.c.
References CHECKPVSBIT, mleaf_t::clusterindex, mleaf_t::firstleafsurface, host, i, cvar_t::integer, mleaf_t::maxs, mportal_t::maxs, mleaf_t::mins, mportal_t::mins, model, mportal_t::next, NULL, mleaf_t::numleafsurfaces, r_refdef_view_t::origin, mportal_t::past, mleaf_t::portals, R_CanSeeBox(), R_CullFrustum(), r_lockpvs, r_lockvisibility, r_main_mempool, r_nearclip, r_novis, r_refdef, r_stat_world_leafs, r_stat_world_portals, r_useportalculling, R_View_WorldVisibility_CullSurfaces(), r_vis_trace, r_vis_trace_delay, r_vis_trace_enlarge, r_vis_trace_expand, r_vis_trace_eyejitter, r_vis_trace_pad, r_vis_trace_samples, host_static_t::realtime, r_refdef_t::scene, r_refdef_t::stats, mportal_t::tracetime, r_refdef_view_t::usecustompvs, r_refdef_view_t::usevieworiginculling, cvar_t::value, r_refdef_t::view, r_refdef_t::viewcache, r_refdef_viewcache_t::world_leafvisible, r_refdef_viewcache_t::world_novis, r_refdef_viewcache_t::world_pvsbits, r_refdef_viewcache_t::world_surfacevisible, and r_refdef_scene_t::worldmodel.
Referenced by R_View_Update().
Definition at line 411 of file gl_rsurf.c.
References cvar_t::integer, maxs, msurface_t::maxs, mins, msurface_t::mins, model, r_refdef_view_t::origin, R_CanSeeBox(), R_CullFrustum(), r_refdef, r_trippy, r_usesurfaceculling, r_vis_trace_enlarge, r_vis_trace_expand, r_vis_trace_eyejitter, r_vis_trace_pad, r_vis_trace_samples, r_vis_trace_surfaces, r_refdef_t::scene, cvar_t::value, r_refdef_t::view, r_refdef_t::viewcache, r_refdef_viewcache_t::world_surfacevisible, and r_refdef_scene_t::worldmodel.
Referenced by R_View_WorldVisibility().
|
static |
Definition at line 1318 of file gl_rsurf.c.
Referenced by R_Mod_DrawLight(), and R_Mod_DrawShadowMap().
cvar_t r_lockpvs = {CF_CLIENT, "r_lockpvs", "0", "disables pvs switching, allows you to walk around and inspect what is visible from a given location in the map (anything not visible from your current location will not be drawn)"} |
Definition at line 29 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), R_View_WorldVisibility(), and R_Water_StartFrame().
cvar_t r_lockvisibility = {CF_CLIENT, "r_lockvisibility", "0", "disables visibility updates, allows you to walk around and inspect what is visible from a given viewpoint in the map (anything offscreen at the moment this is enabled will not be drawn)"} |
Definition at line 30 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), R_View_SetFrustum(), R_View_WorldVisibility(), and R_Water_StartFrame().
|
static |
Definition at line 1185 of file gl_rsurf.c.
Referenced by R_Mod_GetLightInfo(), and R_Q1BSP_GetLightInfo_comparefunc().
cvar_t r_q3bsp_renderskydepth = {CF_CLIENT, "r_q3bsp_renderskydepth", "0", "draws sky depth masking in q3 maps (as in q1 maps), this means for example that sky polygons can hide other things"} |
Definition at line 41 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), and R_DrawTextureSurfaceList_Sky().
|
extern |
Definition at line 188 of file r_shadow.c.
Referenced by R_Mod_GetLightInfo(), and R_Shadow_Init().
|
extern |
Definition at line 64 of file r_shadow.c.
Referenced by R_Mod_DrawLight().
cvar_t r_useportalculling = {CF_CLIENT, "r_useportalculling", "1", "improve framerate with r_novis 1 by using portal culling - still not as good as compiled visibility data in the map, but it helps (a value of 2 forces use of this even with vis data, which improves framerates in maps without too much complexity, but hurts in extremely complex maps, which is why 2 is not the default mode)"} |
Definition at line 31 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), and R_View_WorldVisibility().
cvar_t r_usesurfaceculling = {CF_CLIENT, "r_usesurfaceculling", "1", "skip off-screen surfaces (1 = cull surfaces if the map is likely to benefit, 2 = always cull surfaces)"} |
Definition at line 32 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), and R_View_WorldVisibility_CullSurfaces().
cvar_t r_vis_trace = {CF_CLIENT, "r_vis_trace", "0", "test if each portal or leaf is visible using tracelines"} |
Definition at line 33 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), and R_View_WorldVisibility().
cvar_t r_vis_trace_delay = {CF_CLIENT, "r_vis_trace_delay", "1", "keep a portal visible for this many seconds"} |
Definition at line 35 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), and R_View_WorldVisibility().
cvar_t r_vis_trace_enlarge = {CF_CLIENT, "r_vis_trace_enlarge", "0", "make portal bounds bigger for tests by (1+this)*size"} |
Definition at line 37 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), R_View_WorldVisibility(), and R_View_WorldVisibility_CullSurfaces().
cvar_t r_vis_trace_expand = {CF_CLIENT, "r_vis_trace_expand", "0", "make portal bounds bigger for tests by this many units"} |
Definition at line 38 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), R_View_WorldVisibility(), and R_View_WorldVisibility_CullSurfaces().
cvar_t r_vis_trace_eyejitter = {CF_CLIENT, "r_vis_trace_eyejitter", "8", "use a random offset of this much on the start of each traceline"} |
Definition at line 36 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), R_View_WorldVisibility(), and R_View_WorldVisibility_CullSurfaces().
cvar_t r_vis_trace_pad = {CF_CLIENT, "r_vis_trace_pad", "8", "accept traces that hit within this many units of the portal"} |
Definition at line 39 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), R_View_WorldVisibility(), and R_View_WorldVisibility_CullSurfaces().
cvar_t r_vis_trace_samples = {CF_CLIENT, "r_vis_trace_samples", "1", "use this many randomly positioned tracelines each frame to refresh the visible timer"} |
Definition at line 34 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), R_View_WorldVisibility(), and R_View_WorldVisibility_CullSurfaces().
cvar_t r_vis_trace_surfaces = {CF_CLIENT, "r_vis_trace_surfaces", "0", "also use tracelines to cull surfaces"} |
Definition at line 40 of file gl_rsurf.c.
Referenced by GL_Surf_Init(), and R_View_WorldVisibility_CullSurfaces().