Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
◆ BACKFACE_EPSILON
#define BACKFACE_EPSILON 0.01f |
◆ BSP_CullFace
#define BSP_CullFace |
( |
|
face, |
|
|
|
dot |
|
) |
| |
◆ GL_AddLights
◆ GL_MarkLights
#define GL_MarkLights |
( |
| ) |
(void)0 |
◆ GL_TransformLights
#define GL_TransformLights |
( |
| ) |
(void)0 |
◆ NODE_CLIPPED
◆ NODE_UNCLIPPED
#define NODE_UNCLIPPED 15 |
◆ _GL_LightPoint()
static qboolean _GL_LightPoint |
( |
vec3_t |
start, |
|
|
vec3_t |
color |
|
) |
| |
|
static |
Definition at line 75 of file world.c.
80 vec3_t end, mins, maxs;
86 if (!bsp || !bsp->lightmap)
91 end[2] = start[2] - 8192;
97 for (i = 0; i <
glr.
fd.num_entities; i++) {
98 ent = &
glr.
fd.entities[i];
100 if (!(index & 0x80000000))
104 if (index < 1 || index >= bsp->nummodels)
107 model = &bsp->models[index];
108 if (!model->numfaces)
112 if (ent->angles[0] || ent->angles[1] || ent->angles[2]) {
113 if (fabs(start[0] - ent->origin[0]) > model->radius)
115 if (fabs(start[1] - ent->origin[1]) > model->radius)
117 angles = ent->angles;
119 VectorAdd(model->mins, ent->origin, mins);
120 VectorAdd(model->maxs, ent->origin, maxs);
121 if (start[0] < mins[0] || start[0] > maxs[0])
123 if (start[1] < mins[1] || start[1] > maxs[1])
128 BSP_TransformedLightPoint(&pt, start, end, model->headnode,
129 ent->origin, angles);
Referenced by GL_LightPoint().
◆ GL_ClipNode()
static qboolean GL_ClipNode |
( |
mnode_t * |
node, |
|
|
int * |
clipflags |
|
) |
| |
|
inlinestatic |
Definition at line 446 of file world.c.
448 int flags = *clipflags;
454 for (i = 0, mask = 1; i < 4; i++, mask <<= 1) {
460 if (bits == BOX_BEHIND) {
463 if (bits == BOX_INFRONT) {
Referenced by GL_WorldNode_r().
◆ GL_DrawBspModel()
void GL_DrawBspModel |
( |
mmodel_t * |
model | ) |
|
Definition at line 358 of file world.c.
360 mface_t *face, *last;
363 vec3_t transformed, temp;
367 if (!model->numfaces)
377 VectorCopy(model->mins, bounds[0]);
378 VectorCopy(model->maxs, bounds[1]);
385 VectorSubtract(
glr.
fd.vieworg, ent->origin, temp);
386 transformed[0] = DotProduct(temp,
glr.
entaxis[0]);
387 transformed[1] = DotProduct(temp,
glr.
entaxis[1]);
388 transformed[2] = DotProduct(temp,
glr.
entaxis[2]);
390 VectorAdd(model->mins, ent->origin, bounds[0]);
391 VectorAdd(model->maxs, ent->origin, bounds[1]);
397 VectorSubtract(
glr.
fd.vieworg, ent->origin, transformed);
407 last = model->firstface + model->numfaces;
408 for (face = model->firstface; face < last; face++) {
409 dot = PlaneDiffFast(transformed, face->plane);
416 if (face->drawflags & SURF_SKY) {
423 if (face->drawflags & SURF_TRANS_MASK) {
Referenced by GL_DrawEntities().
◆ GL_DrawLeaf()
static void GL_DrawLeaf |
( |
mleaf_t * |
leaf | ) |
|
|
inlinestatic |
Definition at line 473 of file world.c.
475 mface_t **face, **last;
477 if (leaf->contents == CONTENTS_SOLID) {
480 if (
glr.
fd.areabits && !Q_IsBitSet(
glr.
fd.areabits, leaf->area)) {
484 last = leaf->firstleafface + leaf->numleaffaces;
485 for (face = leaf->firstleafface; face < last; face++) {
Referenced by GL_WorldNode_r().
◆ GL_DrawNode()
static void GL_DrawNode |
( |
mnode_t * |
node | ) |
|
|
inlinestatic |
Definition at line 492 of file world.c.
494 mface_t *face, *last = node->firstface + node->numfaces;
496 for (face = node->firstface; face < last; face++) {
501 if (face->drawflags & SURF_SKY) {
506 if (face->drawflags & SURF_TRANS_MASK) {
Referenced by GL_WorldNode_r().
◆ GL_DrawWorld()
◆ GL_LightPoint()
void GL_LightPoint |
( |
vec3_t |
origin, |
|
|
vec3_t |
color |
|
) |
| |
◆ GL_MarkLeaves()
Definition at line 265 of file world.c.
267 static int lastNodesVisible;
268 byte vis1[VIS_MAX_BYTES];
269 byte vis2[VIS_MAX_BYTES];
272 uint_fast32_t *src1, *src2;
273 int cluster1, cluster2, longs;
279 cluster1 = cluster2 = leaf->cluster;
280 VectorCopy(
glr.
fd.vieworg, tmp);
281 if (!leaf->contents) {
287 if (!(leaf->contents & CONTENTS_SOLID)) {
288 cluster2 = leaf->cluster;
303 if (!bsp->vis ||
gl_novis->integer || cluster1 == -1) {
305 for (i = 0; i < bsp->numnodes; i++) {
308 for (i = 0; i < bsp->numleafs; i++) {
311 lastNodesVisible = bsp->numnodes;
316 if (cluster1 != cluster2) {
318 longs = VIS_FAST_LONGS(bsp);
319 src1 = (uint_fast32_t *)vis1;
320 src2 = (uint_fast32_t *)vis2;
326 lastNodesVisible = 0;
327 for (i = 0, leaf = bsp->leafs; i < bsp->numleafs; i++, leaf++) {
328 cluster1 = leaf->cluster;
329 if (cluster1 == -1) {
332 if (Q_IsBitSet(vis1, cluster1)) {
333 node = (mnode_t *)leaf;
Referenced by GL_DrawWorld().
◆ GL_SampleLightPoint()
void GL_SampleLightPoint |
( |
vec3_t |
color | ) |
|
Definition at line 21 of file world.c.
26 byte *b1, *b2, *b3, *b4;
37 w1 = (16 - fracu) * (16 - fracv);
38 w2 = fracu * (16 - fracv);
40 w4 = (16 - fracu) * fracv;
49 size = smax * tmax * 3;
54 lightmap = surf->lightmap;
55 for (i = 0; i < surf->numstyles; i++) {
56 b1 = &lightmap[3 * ((t + 0) * smax + (s + 0))];
57 b2 = &lightmap[3 * ((t + 0) * smax + (s + 1))];
58 b3 = &lightmap[3 * ((t + 1) * smax + (s + 1))];
59 b4 = &lightmap[3 * ((t + 1) * smax + (s + 0))];
61 temp[0] = (w1 * b1[0] + w2 * b2[0] + w3 * b3[0] + w4 * b4[0]) >> 8;
62 temp[1] = (w1 * b1[1] + w2 * b2[1] + w3 * b3[1] + w4 * b4[1]) >> 8;
63 temp[2] = (w1 * b1[2] + w2 * b2[2] + w3 * b3[2] + w4 * b4[2]) >> 8;
67 color[0] += temp[0] * style->rgb[0];
68 color[1] += temp[1] * style->rgb[1];
69 color[2] += temp[2] * style->rgb[2];
Referenced by _GL_LightPoint(), and sample_surface_verts().
◆ GL_WorldNode_r()
static void GL_WorldNode_r |
( |
mnode_t * |
node, |
|
|
int |
clipflags |
|
) |
| |
|
static |
Definition at line 525 of file world.c.
541 dot = PlaneDiffFast(
glr.
fd.vieworg, node->plane);
548 node = node->children[side ^ 1];
Referenced by GL_DrawWorld().
◆ R_LightPoint_GL()
void R_LightPoint_GL |
( |
vec3_t |
origin, |
|
|
vec3_t |
color |
|
) |
| |
void GL_AdjustColor(vec3_t color)
static qboolean GL_ClipNode(mnode_t *node, int *clipflags)
void GL_PushLights(mface_t *surf)
byte * BSP_ClusterVis(bsp_t *bsp, byte *mask, int cluster, int vis)
static void GL_DrawLeaf(mleaf_t *leaf)
#define BSP_CullFace(face, dot)
void GL_AddAlphaFace(mface_t *face)
void GL_ClearSolidFaces(void)
glCullResult_t GL_CullSphere(const vec3_t origin, float radius)
mleaf_t * BSP_PointLeaf(mnode_t *node, vec3_t p)
#define GL_AddLights(origin, color)
void GL_RotateForEntity(vec3_t origin, float scale)
void GL_DrawFace(mface_t *surf)
struct glStatic_t::@11 world
void R_AddSkySurface(mface_t *surf)
cplane_t frustumPlanes[4]
glCullResult_t GL_CullLocalBox(const vec3_t origin, vec3_t bounds[2])
#define GL_TransformLights()
void GL_AddSolidFace(mface_t *face)
void GL_DrawSolidFaces(void)
static qboolean _GL_LightPoint(vec3_t start, vec3_t color)
void GL_LightPoint(vec3_t origin, vec3_t color)
static void GL_DrawNode(mnode_t *node)
cvar_t * gl_doublelight_entities
static void GL_LoadMatrix(const GLfloat *matrix)
#define LIGHT_STYLE(surf, i)
static void GL_WorldNode_r(mnode_t *node, int clipflags)
glCullResult_t GL_CullBox(vec3_t bounds[2])
CONST PIXELFORMATDESCRIPTOR int
static void GL_MarkLeaves(void)
int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, cplane_t *p)
void GL_SampleLightPoint(vec3_t color)