mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-13 08:27:39 +00:00
Get global fog working in mtex mode.
This commit is contained in:
parent
d470094a55
commit
8919aec663
4 changed files with 19 additions and 7 deletions
|
@ -770,7 +770,9 @@ R_DrawAliasModel (entity_t *e)
|
||||||
qfglColor4fv (e->colormod);
|
qfglColor4fv (e->colormod);
|
||||||
|
|
||||||
qfglBindTexture (GL_TEXTURE_2D, fb_texture);
|
qfglBindTexture (GL_TEXTURE_2D, fb_texture);
|
||||||
|
Fog_StartAdditive ();
|
||||||
GL_DrawAliasFrameTri (vo);
|
GL_DrawAliasFrameTri (vo);
|
||||||
|
Fog_StopAdditive ();
|
||||||
|
|
||||||
if (gl_vector_light->int_val) {
|
if (gl_vector_light->int_val) {
|
||||||
qfglEnable (GL_LIGHTING);
|
qfglEnable (GL_LIGHTING);
|
||||||
|
@ -790,7 +792,9 @@ R_DrawAliasModel (entity_t *e)
|
||||||
qfglColor4fv (e->colormod);
|
qfglColor4fv (e->colormod);
|
||||||
|
|
||||||
qfglBindTexture (GL_TEXTURE_2D, fb_texture);
|
qfglBindTexture (GL_TEXTURE_2D, fb_texture);
|
||||||
|
Fog_StartAdditive ();
|
||||||
GL_DrawAliasFrame (vo);
|
GL_DrawAliasFrame (vo);
|
||||||
|
Fog_StopAdditive ();
|
||||||
|
|
||||||
if (gl_vector_light->int_val) {
|
if (gl_vector_light->int_val) {
|
||||||
qfglEnable (GL_LIGHTING);
|
qfglEnable (GL_LIGHTING);
|
||||||
|
|
|
@ -407,6 +407,8 @@ R_SetupFrame (void)
|
||||||
|
|
||||||
r_framecount++;
|
r_framecount++;
|
||||||
|
|
||||||
|
Fog_SetupFrame ();
|
||||||
|
|
||||||
// build the transformation matrix for the given view angles
|
// build the transformation matrix for the given view angles
|
||||||
VectorCopy (r_refdef.vieworg, r_origin);
|
VectorCopy (r_refdef.vieworg, r_origin);
|
||||||
|
|
||||||
|
@ -524,6 +526,7 @@ R_RenderScene (void)
|
||||||
|
|
||||||
R_SetupFrame ();
|
R_SetupFrame ();
|
||||||
R_SetupGL ();
|
R_SetupGL ();
|
||||||
|
Fog_EnableGFog ();
|
||||||
R_MarkLeaves (); // done here so we know if we're in water
|
R_MarkLeaves (); // done here so we know if we're in water
|
||||||
R_PushDlights (vec3_origin);
|
R_PushDlights (vec3_origin);
|
||||||
R_DrawWorld (); // adds static entities to the list
|
R_DrawWorld (); // adds static entities to the list
|
||||||
|
@ -531,6 +534,13 @@ R_RenderScene (void)
|
||||||
R_DrawEntitiesOnList ();
|
R_DrawEntitiesOnList ();
|
||||||
R_RenderDlights ();
|
R_RenderDlights ();
|
||||||
|
|
||||||
|
R_DrawWaterSurfaces ();
|
||||||
|
R_DrawParticles ();
|
||||||
|
|
||||||
|
Fog_DisableGFog ();
|
||||||
|
|
||||||
|
R_DrawViewModel ();
|
||||||
|
|
||||||
if (R_TestErrors (0))
|
if (R_TestErrors (0))
|
||||||
R_DisplayErrors ();
|
R_DisplayErrors ();
|
||||||
R_ClearErrors ();
|
R_ClearErrors ();
|
||||||
|
@ -628,9 +638,6 @@ R_RenderView_ (void)
|
||||||
|
|
||||||
// render normal view
|
// render normal view
|
||||||
R_RenderScene ();
|
R_RenderScene ();
|
||||||
R_DrawViewModel ();
|
|
||||||
R_DrawWaterSurfaces ();
|
|
||||||
R_DrawParticles ();
|
|
||||||
|
|
||||||
// render mirror view
|
// render mirror view
|
||||||
R_Mirror ();
|
R_Mirror ();
|
||||||
|
|
|
@ -153,6 +153,7 @@ R_Init (void)
|
||||||
r_init = 1;
|
r_init = 1;
|
||||||
R_InitParticles ();
|
R_InitParticles ();
|
||||||
R_InitSprites ();
|
R_InitSprites ();
|
||||||
|
Fog_Init ();
|
||||||
}
|
}
|
||||||
|
|
||||||
VISIBLE void
|
VISIBLE void
|
||||||
|
|
|
@ -638,10 +638,11 @@ test_node (mnode_t *node)
|
||||||
static void
|
static void
|
||||||
R_RecursiveWorldNode (mnode_t *node)
|
R_RecursiveWorldNode (mnode_t *node)
|
||||||
{
|
{
|
||||||
|
#define NODE_STACK 1024
|
||||||
struct {
|
struct {
|
||||||
mnode_t *node;
|
mnode_t *node;
|
||||||
int side;
|
int side;
|
||||||
} *node_ptr, node_stack[1024];
|
} *node_ptr, node_stack[NODE_STACK];
|
||||||
mnode_t *front;
|
mnode_t *front;
|
||||||
int side;
|
int side;
|
||||||
|
|
||||||
|
@ -652,8 +653,7 @@ R_RecursiveWorldNode (mnode_t *node)
|
||||||
side = get_side (node);
|
side = get_side (node);
|
||||||
front = node->children[side];
|
front = node->children[side];
|
||||||
if (test_node (front)) {
|
if (test_node (front)) {
|
||||||
if (node_ptr - node_stack
|
if (node_ptr - node_stack == NODE_STACK)
|
||||||
== sizeof (node_stack) / sizeof (node_stack[0]))
|
|
||||||
Sys_Error ("node_stack overflow");
|
Sys_Error ("node_stack overflow");
|
||||||
node_ptr->node = node;
|
node_ptr->node = node;
|
||||||
node_ptr->side = side;
|
node_ptr->side = side;
|
||||||
|
|
Loading…
Reference in a new issue