UFO: Alien Invasion
r_flare.cpp File Reference
#include "r_local.h"
Include dependency graph for r_flare.cpp:

Go to the source code of this file.

Functions

void R_CreateSurfaceFlare (mBspSurface_t *surf)
 
void R_DrawFlareSurfaces (const mBspSurfaces_t *surfs, glElementIndex_t *indexPtr)
 Flares are batched by their texture. Usually, this means one draw operation for all flares in view. Flare visibility is calculated every few millis, and flare alpha is ramped up or down depending on the results of the visibility trace. Flares are also faded according to the angle of their surface to the view origin. More...
 

Function Documentation

◆ R_CreateSurfaceFlare()

◆ R_DrawFlareSurfaces()

void R_DrawFlareSurfaces ( const mBspSurfaces_t surfs,
glElementIndex_t indexPtr 
)

Flares are batched by their texture. Usually, this means one draw operation for all flares in view. Flare visibility is calculated every few millis, and flare alpha is ramped up or down depending on the results of the visibility trace. Flares are also faded according to the angle of their surface to the view origin.

Todo:
better GL state handling

Definition at line 69 of file r_flare.cpp.

References rendererData_t::batchCount, rstate_t::blend_enabled, rstate_t::color_array, mBspSurfaces_t::count, default_texcoords, DotProduct, f, mBspSurface_t::flare, trace_t::fraction, rlocals_t::frame, mBspSurface_t::frame, i, cvar_t::integer, m, MASK_SOLID, mBspSurface_t::normal, R_BindTexture, R_BlendFunc(), R_Color(), R_DrawArrays(), R_EnableBlend(), R_EnableColorArray(), r_flares, r_flaretextures, r_locals, R_ResetArrayState(), r_state, R_Trace(), refdef, rlocals_t::right, scale, mBspSurfaces_t::surfaces, image_t::texnum, texunit_diffuse, rendererData_t::time, rendererData_t::trace, rlocals_t::up, cvar_t::value, VectorAdd, VectorNormalize(), VectorScale, VectorSubtract, rstate_t::vertex_array_3d, and rendererData_t::viewOrigin.

Referenced by R_RenderFlareBspRRefs().