mirror of
https://github.com/UberGames/ioef.git
synced 2025-05-30 08:50:56 +00:00
Fix for flares. Can be enabled by setting r_flares 1
This commit is contained in:
parent
7aed801011
commit
c552a46e5f
5 changed files with 121 additions and 86 deletions
|
@ -1214,71 +1214,12 @@ void RB_SurfaceBad( surfaceType_t *surfType ) {
|
|||
ri.Printf( PRINT_ALL, "Bad surface tesselated.\n" );
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
void RB_SurfaceFlare( srfFlare_t *surf ) {
|
||||
vec3_t left, up;
|
||||
float radius;
|
||||
byte color[4];
|
||||
vec3_t dir;
|
||||
vec3_t origin;
|
||||
float d;
|
||||
|
||||
// calculate the xyz locations for the four corners
|
||||
radius = 30;
|
||||
VectorScale( backEnd.viewParms.or.axis[1], radius, left );
|
||||
VectorScale( backEnd.viewParms.or.axis[2], radius, up );
|
||||
if ( backEnd.viewParms.isMirror ) {
|
||||
VectorSubtract( vec3_origin, left, left );
|
||||
}
|
||||
|
||||
color[0] = color[1] = color[2] = color[3] = 255;
|
||||
|
||||
VectorMA( surf->origin, 3, surf->normal, origin );
|
||||
VectorSubtract( origin, backEnd.viewParms.or.origin, dir );
|
||||
VectorNormalize( dir );
|
||||
VectorMA( origin, r_ignore->value, dir, origin );
|
||||
|
||||
d = -DotProduct( dir, surf->normal );
|
||||
if ( d < 0 ) {
|
||||
return;
|
||||
}
|
||||
#if 0
|
||||
color[0] *= d;
|
||||
color[1] *= d;
|
||||
color[2] *= d;
|
||||
#endif
|
||||
|
||||
RB_AddQuadStamp( origin, left, up, color );
|
||||
void RB_SurfaceFlare(srfFlare_t *surf)
|
||||
{
|
||||
if (r_flares->integer)
|
||||
RB_AddFlare(surf, tess.fogNum, surf->origin, surf->color, surf->normal);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void RB_SurfaceFlare( srfFlare_t *surf ) {
|
||||
#if 0
|
||||
vec3_t left, up;
|
||||
byte color[4];
|
||||
|
||||
color[0] = surf->color[0] * 255;
|
||||
color[1] = surf->color[1] * 255;
|
||||
color[2] = surf->color[2] * 255;
|
||||
color[3] = 255;
|
||||
|
||||
VectorClear( left );
|
||||
VectorClear( up );
|
||||
|
||||
left[0] = r_ignore->value;
|
||||
|
||||
up[1] = r_ignore->value;
|
||||
|
||||
RB_AddQuadStampExt( surf->origin, left, up, color, 0, 0, 1, 1 );
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void RB_SurfaceDisplayList( srfDisplayList_t *surf ) {
|
||||
// all apropriate state must be set in RB_BeginSurface
|
||||
// this isn't implemented yet...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue