minor tweaks
This commit is contained in:
parent
09c78ec0dc
commit
1d4424f4c6
|
|
@ -201,7 +201,6 @@ td.formatted_questions ol { margin-top: 0px; margin-bottom: 0px; }
|
|||
<li><strong><code>-debugnormals</code>:</strong> Color the lightmaps according to the direction of the surface normal</li>
|
||||
<li><strong><code>-debugorigin</code>:</strong> Color the lightmaps according to the origin of the luxels</li>
|
||||
<li><strong><code>-debugsurfaces</code>, <code>-debugsurface</code>:</strong> Color the lightmaps according to the index of the surface</li>
|
||||
<li><strong><code>-debugunused</code>:</strong> This option does nothing</li>
|
||||
<li><strong><code>-debug</code>:</strong> Mark the lightmaps according to the cluster: unmapped clusters get yellow, occluded ones get pink, flooded ones get blue overlay color, otherwise red</li>
|
||||
<li><strong><code>-deluxemode 0</code>:</strong> Use modelspace deluxemaps (DarkPlaces)</li>
|
||||
<li><strong><code>-deluxemode 1</code>:</strong> Use tangentspace deluxemaps</li>
|
||||
|
|
|
|||
|
|
@ -286,9 +286,6 @@ int BSPInfo( int count, char **fileNames ){
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* enable info mode */
|
||||
infoMode = true;
|
||||
|
||||
/* walk file list */
|
||||
for ( i = 0; i < count; i++ )
|
||||
{
|
||||
|
|
@ -442,7 +439,7 @@ int ScaleBSPMain( int argc, char **argv ){
|
|||
|
||||
uniform = ( ( scale[0] == scale[1] ) && ( scale[1] == scale[2] ) );
|
||||
|
||||
if ( scale[0] == 0.0f || scale[1] == 0.0f || scale[2] == 0.0f ) {
|
||||
if ( scale == g_vector3_identity ) {
|
||||
Sys_Printf( "Usage: q3map2 [-v] -scale [-tex] [-spawn_ref <value>] <value> <mapname>\n" );
|
||||
Sys_Printf( "Non-zero scale value required.\n" );
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -887,7 +887,7 @@ static void ConvertModel( FILE *f, bspModel_t *model, int modelNum, const Vector
|
|||
buildBrush->entityNum = 0;
|
||||
buildBrush->original = buildBrush;
|
||||
|
||||
if ( origin[0] != 0 || origin[1] != 0 || origin[2] != 0 ) {
|
||||
if ( origin != g_vector3_identity ) {
|
||||
ConvertOriginBrush( f, -1, origin, brushPrimitives );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -215,21 +215,21 @@ static bool MakeTextureMatrix( decalProjector_t *dp, const Plane3f& projection,
|
|||
/* test texture matrix */
|
||||
s = vector3_dot( a->xyz, dp->texMat[ 0 ].vec3() ) + dp->texMat[ 0 ][ 3 ];
|
||||
t = vector3_dot( a->xyz, dp->texMat[ 1 ].vec3() ) + dp->texMat[ 1 ][ 3 ];
|
||||
if ( fabs( s - a->st[ 0 ] ) > 0.01 || fabs( t - a->st[ 1 ] ) > 0.01 ) {
|
||||
if ( !float_equal_epsilon( s, a->st[ 0 ], 0.01 ) || !float_equal_epsilon( t, a->st[ 1 ], 0.01 ) ) {
|
||||
Sys_Printf( "Bad texture matrix! (A) (%f, %f) != (%f, %f)\n",
|
||||
s, t, a->st[ 0 ], a->st[ 1 ] );
|
||||
//% return false;
|
||||
}
|
||||
s = vector3_dot( b->xyz, dp->texMat[ 0 ].vec3() ) + dp->texMat[ 0 ][ 3 ];
|
||||
t = vector3_dot( b->xyz, dp->texMat[ 1 ].vec3() ) + dp->texMat[ 1 ][ 3 ];
|
||||
if ( fabs( s - b->st[ 0 ] ) > 0.01 || fabs( t - b->st[ 1 ] ) > 0.01 ) {
|
||||
if ( !float_equal_epsilon( s, b->st[ 0 ], 0.01 ) || !float_equal_epsilon( t, b->st[ 1 ], 0.01 ) ) {
|
||||
Sys_Printf( "Bad texture matrix! (B) (%f, %f) != (%f, %f)\n",
|
||||
s, t, b->st[ 0 ], b->st[ 1 ] );
|
||||
//% return false;
|
||||
}
|
||||
s = vector3_dot( c->xyz, dp->texMat[ 0 ].vec3() ) + dp->texMat[ 0 ][ 3 ];
|
||||
t = vector3_dot( c->xyz, dp->texMat[ 1 ].vec3() ) + dp->texMat[ 1 ][ 3 ];
|
||||
if ( fabs( s - c->st[ 0 ] ) > 0.01 || fabs( t - c->st[ 1 ] ) > 0.01 ) {
|
||||
if ( !float_equal_epsilon( s, c->st[ 0 ], 0.01 ) || !float_equal_epsilon( t, c->st[ 1 ], 0.01 ) ) {
|
||||
Sys_Printf( "Bad texture matrix! (C) (%f, %f) != (%f, %f)\n",
|
||||
s, t, c->st[ 0 ], c->st[ 1 ] );
|
||||
//% return false;
|
||||
|
|
|
|||
|
|
@ -183,7 +183,6 @@ void HelpLight()
|
|||
{"-debugnormals", "Color the lightmaps according to the direction of the surface normal"},
|
||||
{"-debugorigin", "Color the lightmaps according to the origin of the luxels"},
|
||||
{"-debugsurfaces, -debugsurface", "Color the lightmaps according to the index of the surface"},
|
||||
{"-debugunused", "This option does nothing"},
|
||||
{"-debug", "Mark the lightmaps according to the cluster: unmapped clusters get yellow, occluded ones get pink, flooded ones get blue overlay color, otherwise red"},
|
||||
{"-deluxemode 0", "Use modelspace deluxemaps (DarkPlaces)"},
|
||||
{"-deluxemode 1", "Use tangentspace deluxemaps"},
|
||||
|
|
|
|||
|
|
@ -708,7 +708,6 @@ int LightContributionToSample( trace_t *trace ){
|
|||
/* clear color */
|
||||
trace->forceSubsampling = 0.0f; /* to make sure */
|
||||
trace->color.set( 0 );
|
||||
trace->colorNoShadow.set( 0 );
|
||||
trace->directionContribution.set( 0 );
|
||||
|
||||
colorBrightness = RGBTOGRAY( light->color ) * ( 1.0f / 255.0f );
|
||||
|
|
@ -1013,9 +1012,6 @@ int LightContributionToSample( trace_t *trace ){
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* VorteX: set noShadow color */
|
||||
trace->colorNoShadow = light->color * add;
|
||||
|
||||
addDeluxe *= colorBrightness;
|
||||
|
||||
if ( bouncing ) {
|
||||
|
|
@ -1049,9 +1045,6 @@ int LightContributionToSample( trace_t *trace ){
|
|||
Error( "Light of undefined type!" );
|
||||
}
|
||||
|
||||
/* VorteX: set noShadow color */
|
||||
trace->colorNoShadow = light->color * add;
|
||||
|
||||
/* ydnar: changed to a variable number */
|
||||
if ( add <= 0.0f || ( add <= light->falloffTolerance && ( light->flags & LightFlags::FastActual ) ) ) {
|
||||
return 0;
|
||||
|
|
@ -1118,9 +1111,7 @@ void LightingAtSample( trace_t *trace, byte styles[ MAX_LIGHTMAPS ], Vector3 (&c
|
|||
|
||||
/* ydnar: normalmap */
|
||||
if ( normalmap ) {
|
||||
colors[ 0 ][ 0 ] = ( trace->normal[ 0 ] + 1.0f ) * 127.5f;
|
||||
colors[ 0 ][ 1 ] = ( trace->normal[ 1 ] + 1.0f ) * 127.5f;
|
||||
colors[ 0 ][ 2 ] = ( trace->normal[ 2 ] + 1.0f ) * 127.5f;
|
||||
colors[ 0 ] = ( trace->normal + Vector3( 1 ) ) * 127.5f;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1151,7 +1142,7 @@ void LightingAtSample( trace_t *trace, byte styles[ MAX_LIGHTMAPS ], Vector3 (&c
|
|||
|
||||
/* sample light */
|
||||
LightContributionToSample( trace );
|
||||
if ( trace->color[ 0 ] == 0.0f && trace->color[ 1 ] == 0.0f && trace->color[ 2 ] == 0.0f ) {
|
||||
if ( trace->color == g_vector3_identity ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -2537,11 +2528,6 @@ int LightMain( int argc, char **argv ){
|
|||
Sys_Printf( "Lightmap surface debugging enabled\n" );
|
||||
}
|
||||
|
||||
else if ( striEqual( argv[ i ], "-debugunused" ) ) {
|
||||
debugUnused = true;
|
||||
Sys_Printf( "Unused luxel debugging enabled\n" );
|
||||
}
|
||||
|
||||
else if ( striEqual( argv[ i ], "-debugaxis" ) ) {
|
||||
debugAxis = true;
|
||||
Sys_Printf( "Lightmap axis debugging enabled\n" );
|
||||
|
|
|
|||
|
|
@ -514,7 +514,6 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
|
|||
light->photons = value * area * areaScale;
|
||||
light->add = value * formFactorValueScale * areaScale;
|
||||
light->color = si->color;
|
||||
light->emitColor = light->color * light->add;
|
||||
light->style = noStyles ? LS_NORMAL : si->lightStyle;
|
||||
if ( light->style < LS_NORMAL || light->style >= LS_NONE ) {
|
||||
light->style = LS_NORMAL;
|
||||
|
|
@ -576,7 +575,6 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
|
|||
splash->fade = 1.0f;
|
||||
splash->si = si;
|
||||
splash->color = si->color;
|
||||
splash->emitColor = splash->color * splash->add;
|
||||
splash->falloffTolerance = falloffTolerance;
|
||||
splash->style = noStyles ? LS_NORMAL : si->lightStyle;
|
||||
if ( splash->style < LS_NORMAL || splash->style >= LS_NONE ) {
|
||||
|
|
@ -606,7 +604,6 @@ static void RadSubdivideDiffuseLight( int lightmapNum, bspDrawSurface_t *ds, raw
|
|||
light->photons = value * area * bounceScale;
|
||||
light->add = value * formFactorValueScale * bounceScale;
|
||||
light->color = color;
|
||||
light->emitColor = light->color * light->add;
|
||||
light->style = noStyles ? LS_NORMAL : style;
|
||||
if ( light->style < LS_NORMAL || light->style >= LS_NONE ) {
|
||||
light->style = LS_NORMAL;
|
||||
|
|
@ -906,7 +903,6 @@ void RadCreateDiffuseLights( void ){
|
|||
numBrushDiffuseLights = 0;
|
||||
numTriangleDiffuseLights = 0;
|
||||
numPatchDiffuseLights = 0;
|
||||
numAreaLights = 0;
|
||||
|
||||
/* hit every surface (threaded) */
|
||||
RunThreadsOnIndividual( numBSPDrawSurfaces, true, RadLight );
|
||||
|
|
|
|||
|
|
@ -1307,7 +1307,6 @@ bool TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){
|
|||
float u, v, w, s, t;
|
||||
int is, it;
|
||||
byte *pixel;
|
||||
float shadow;
|
||||
shaderInfo_t *si;
|
||||
|
||||
|
||||
|
|
@ -1437,18 +1436,14 @@ bool TraceTriangle( traceInfo_t *ti, traceTriangle_t *tt, trace_t *trace ){
|
|||
/* ydnar: color filter */
|
||||
if ( si->compileFlags & C_LIGHTFILTER ) {
|
||||
/* filter by texture color */
|
||||
trace->color[ 0 ] *= ( ( 1.0f / 255.0f ) * pixel[ 0 ] );
|
||||
trace->color[ 1 ] *= ( ( 1.0f / 255.0f ) * pixel[ 1 ] );
|
||||
trace->color[ 2 ] *= ( ( 1.0f / 255.0f ) * pixel[ 2 ] );
|
||||
trace->color *= Vector3( pixel[0], pixel[1], pixel[2] ) * ( 1.0f / 255.0f );
|
||||
}
|
||||
|
||||
/* ydnar: alpha filter */
|
||||
if ( si->compileFlags & C_ALPHASHADOW ) {
|
||||
/* filter by inverse texture alpha */
|
||||
shadow = ( 1.0f / 255.0f ) * ( 255 - pixel[ 3 ] );
|
||||
trace->color[ 0 ] *= shadow;
|
||||
trace->color[ 1 ] *= shadow;
|
||||
trace->color[ 2 ] *= shadow;
|
||||
const float shadow = ( 1.0f / 255.0f ) * ( 255 - pixel[ 3 ] );
|
||||
trace->color *= shadow;
|
||||
}
|
||||
|
||||
/* check filter for opaque */
|
||||
|
|
|
|||
|
|
@ -776,7 +776,7 @@ static bool MapTriangle( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *
|
|||
const Vector2& b = dv[ ( i + 1 ) % 3 ]->lightmap[ 0 ];
|
||||
|
||||
/* make degenerate triangles for mapping edges */
|
||||
if ( fabs( a[ 0 ] - b[ 0 ] ) < 0.01f || fabs( a[ 1 ] - b[ 1 ] ) < 0.01f ) {
|
||||
if ( float_equal_epsilon( a[ 0 ], b[ 0 ], 0.01f ) || float_equal_epsilon( a[ 1 ], b[ 1 ], 0.01f ) ) {
|
||||
dv2[ 0 ] = dv[ i ];
|
||||
dv2[ 1 ] = dv[ ( i + 1 ) % 3 ];
|
||||
dv2[ 2 ] = dv[ ( i + 1 ) % 3 ];
|
||||
|
|
@ -2071,7 +2071,7 @@ void IlluminateRawLightmap( int rawLightmapNum ){
|
|||
|
||||
#if 0
|
||||
////////// 27's temp hack for testing edge clipping ////
|
||||
if ( origin[0] == 0 && origin[1] == 0 && origin[2] == 0 ) {
|
||||
if ( lm->getSuperOrigin( x, y ) == g_vector3_identity ) {
|
||||
lightLuxel.value[ 1 ] = 255;
|
||||
lightLuxel.count = 1.0f;
|
||||
totalLighted++;
|
||||
|
|
@ -2102,7 +2102,7 @@ void IlluminateRawLightmap( int rawLightmapNum ){
|
|||
lm->getSuperFlag( x, y ) |= FLAG_FORCE_SUBSAMPLING; /* force */
|
||||
}
|
||||
/* add to count */
|
||||
else if ( trace.color[ 0 ] || trace.color[ 1 ] || trace.color[ 2 ] ) {
|
||||
else if ( trace.color != g_vector3_identity ) {
|
||||
totalLighted++;
|
||||
}
|
||||
}
|
||||
|
|
@ -2711,7 +2711,7 @@ void IlluminateVertexes( int num ){
|
|||
z1 = ( ( z >> 1 ) ^ ( z & 1 ? -1 : 0 ) ) + ( z & 1 );
|
||||
|
||||
/* nudge origin */
|
||||
trace.origin = verts[ i ].xyz + Vector3( x1, y1, z1 ) * Vector3( VERTEX_NUDGE );
|
||||
trace.origin = verts[ i ].xyz + Vector3( x1, y1, z1 ) * VERTEX_NUDGE;
|
||||
|
||||
/* try at nudged origin */
|
||||
trace.cluster = ClusterForPointExtFilter( origin, VERTEX_EPSILON, info->numSurfaceClusters, &surfaceClusters[ info->firstSurfaceCluster ] );
|
||||
|
|
@ -3339,7 +3339,6 @@ void SetupEnvelopes( bool forGrid, bool fastFlag ){
|
|||
int i, x, y, z, x1, y1, z1;
|
||||
light_t *light, *light2, **owner;
|
||||
bspLeaf_t *leaf;
|
||||
Vector3 origin;
|
||||
float radius, intensity;
|
||||
light_t *buckets[ 256 ];
|
||||
|
||||
|
|
@ -3400,9 +3399,7 @@ void SetupEnvelopes( bool forGrid, bool fastFlag ){
|
|||
z1 = ( ( z >> 1 ) ^ ( z & 1 ? -1 : 0 ) ) + ( z & 1 );
|
||||
|
||||
/* nudge origin */
|
||||
origin[ 0 ] = light->origin[ 0 ] + ( LIGHT_NUDGE * x1 );
|
||||
origin[ 1 ] = light->origin[ 1 ] + ( LIGHT_NUDGE * y1 );
|
||||
origin[ 2 ] = light->origin[ 2 ] + ( LIGHT_NUDGE * z1 );
|
||||
const Vector3 origin = light->origin + Vector3( x1, y1, z1 ) * LIGHT_NUDGE;
|
||||
|
||||
/* try at nudged origin */
|
||||
light->cluster = ClusterForPointExt( origin, LIGHT_EPSILON );
|
||||
|
|
@ -3446,7 +3443,7 @@ void SetupEnvelopes( bool forGrid, bool fastFlag ){
|
|||
const Vector3 dir = -light->normal;
|
||||
for ( radius = 100.0f; radius < MAX_WORLD_COORD * 8.0f; radius += 10.0f )
|
||||
{
|
||||
origin = light->origin + light->normal * radius;
|
||||
const Vector3 origin = light->origin + light->normal * radius;
|
||||
const float factor = std::abs( PointToPolygonFormFactor( origin, dir, light->w ) );
|
||||
if ( ( factor * light->add ) <= light->falloffTolerance ) {
|
||||
light->envelope = radius;
|
||||
|
|
@ -3649,7 +3646,7 @@ void SetupEnvelopes( bool forGrid, bool fastFlag ){
|
|||
void CreateTraceLightsForBounds( const MinMax& minmax, const Vector3 *normal, int numClusters, int *clusters, LightFlags flags, trace_t *trace ){
|
||||
int i;
|
||||
light_t *light;
|
||||
float dist, length;
|
||||
float length;
|
||||
|
||||
|
||||
/* potential pre-setup */
|
||||
|
|
@ -3717,8 +3714,7 @@ void CreateTraceLightsForBounds( const MinMax& minmax, const Vector3 *normal, in
|
|||
}
|
||||
|
||||
/* if the light's bounding sphere intersects with the bounding sphere then this light needs to be tested */
|
||||
dist = vector3_length( light->origin - origin ) - light->envelope - radius;
|
||||
if ( dist > 0 ) {
|
||||
if ( vector3_length( light->origin - origin ) - light->envelope - radius > 0 ) {
|
||||
lightsEnvelopeCulled++;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,9 +327,6 @@ void FinishRawLightmap( rawLightmap_t *lm ){
|
|||
lm->sw = lm->w * superSample;
|
||||
lm->sh = lm->h * superSample;
|
||||
|
||||
/* add to super luxel count */
|
||||
numRawSuperLuxels += ( lm->sw * lm->sh );
|
||||
|
||||
/* manipulate origin/vecs for supersampling */
|
||||
if ( superSample > 1 && lm->vecs != NULL ) {
|
||||
/* calc inverse supersample */
|
||||
|
|
@ -629,7 +626,7 @@ bool AddSurfaceToRawLightmap( int num, rawLightmap_t *lm ){
|
|||
|
||||
/* check to see if this is a non-planar patch */
|
||||
if ( ds->surfaceType == MST_PATCH &&
|
||||
lm->axis[ 0 ] == 0.0f && lm->axis[ 1 ] == 0.0f && lm->axis[ 2 ] == 0.0f ) {
|
||||
lm->axis == g_vector3_identity ) {
|
||||
return AddPatchToRawLightmap( num, lm );
|
||||
}
|
||||
|
||||
|
|
@ -1062,9 +1059,6 @@ void SetupSurfaceLightmaps( void ){
|
|||
}
|
||||
}
|
||||
|
||||
/* find longest map distance */
|
||||
maxMapDistance = vector3_length( g_mapMinmax.maxs - g_mapMinmax.mins );
|
||||
|
||||
/* sort the surfaces info list */
|
||||
std::sort( sortSurfaces, sortSurfaces + numBSPDrawSurfaces, CompareSurfaceInfo() );
|
||||
|
||||
|
|
@ -1073,7 +1067,6 @@ void SetupSurfaceLightmaps( void ){
|
|||
lightSurfaces = safe_calloc( numSurfsLightmapped * sizeof( int ) );
|
||||
|
||||
/* allocate a list of raw lightmaps */
|
||||
numRawSuperLuxels = 0;
|
||||
numRawLightmaps = 0;
|
||||
rawLightmaps = safe_calloc( numSurfsLightmapped * sizeof( *rawLightmaps ) );
|
||||
|
||||
|
|
@ -1340,18 +1333,14 @@ void StitchSurfaceLightmaps( void ){
|
|||
compares two surface lightmaps' bsp luxels, ignoring occluded luxels
|
||||
*/
|
||||
|
||||
#define SOLID_EPSILON 0.0625
|
||||
#define SOLID_EPSILON 0.0625f
|
||||
#define LUXEL_TOLERANCE 0.0025
|
||||
#define LUXEL_COLOR_FRAC 0.001302083 /* 1 / 3 / 256 */
|
||||
|
||||
static bool CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int bNum ){
|
||||
int x, y;
|
||||
double delta, total, rd, gd, bd;
|
||||
|
||||
|
||||
/* styled lightmaps will never be collapsed to non-styled lightmaps when there is _minlight */
|
||||
if ( ( minLight[ 0 ] || minLight[ 1 ] || minLight[ 2 ] ) &&
|
||||
( ( aNum == 0 && bNum != 0 ) || ( aNum != 0 && bNum == 0 ) ) ) {
|
||||
if ( minLight != g_vector3_identity &&
|
||||
( aNum == 0 ) != ( bNum == 0 ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1365,13 +1354,8 @@ static bool CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int
|
|||
|
||||
/* compare solid color lightmaps */
|
||||
if ( a->solid[ aNum ] && b->solid[ bNum ] ) {
|
||||
/* get deltas */
|
||||
rd = fabs( a->solidColor[ aNum ][ 0 ] - b->solidColor[ bNum ][ 0 ] );
|
||||
gd = fabs( a->solidColor[ aNum ][ 1 ] - b->solidColor[ bNum ][ 1 ] );
|
||||
bd = fabs( a->solidColor[ aNum ][ 2 ] - b->solidColor[ bNum ][ 2 ] );
|
||||
|
||||
/* compare color */
|
||||
if ( rd > SOLID_EPSILON || gd > SOLID_EPSILON || bd > SOLID_EPSILON ) {
|
||||
if ( !vector3_equal_epsilon( a->solidColor[ aNum ], b->solidColor[ bNum ], SOLID_EPSILON ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1385,11 +1369,11 @@ static bool CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int
|
|||
}
|
||||
|
||||
/* compare luxels */
|
||||
delta = 0.0;
|
||||
total = 0.0;
|
||||
for ( y = 0; y < a->h; y++ )
|
||||
double delta = 0.0;
|
||||
double total = 0.0;
|
||||
for ( int y = 0; y < a->h; y++ )
|
||||
{
|
||||
for ( x = 0; x < a->w; x++ )
|
||||
for ( int x = 0; x < a->w; x++ )
|
||||
{
|
||||
/* increment total */
|
||||
total += 1.0;
|
||||
|
|
@ -1403,20 +1387,16 @@ static bool CompareBSPLuxels( rawLightmap_t *a, int aNum, rawLightmap_t *b, int
|
|||
continue;
|
||||
}
|
||||
|
||||
/* get deltas */
|
||||
rd = fabs( aLuxel[ 0 ] - bLuxel[ 0 ] );
|
||||
gd = fabs( aLuxel[ 1 ] - bLuxel[ 1 ] );
|
||||
bd = fabs( aLuxel[ 2 ] - bLuxel[ 2 ] );
|
||||
|
||||
/* 2003-09-27: compare individual luxels */
|
||||
if ( rd > 3.0 || gd > 3.0 || bd > 3.0 ) {
|
||||
if ( !vector3_equal_epsilon( aLuxel, bLuxel, 3.f ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* compare (fixme: take into account perceptual differences) */
|
||||
delta += rd * LUXEL_COLOR_FRAC;
|
||||
delta += gd * LUXEL_COLOR_FRAC;
|
||||
delta += bd * LUXEL_COLOR_FRAC;
|
||||
Vector3 diff = aLuxel - bLuxel;
|
||||
for( int i = 0; i < 3; ++i )
|
||||
diff[i] = fabs( diff[i] );
|
||||
delta += vector3_dot( diff, Vector3( LUXEL_COLOR_FRAC ) );
|
||||
|
||||
/* is the change too high? */
|
||||
if ( total > 0.0 && ( ( delta / total ) > LUXEL_TOLERANCE ) ) {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ bool PortalPassable( portal_t *p ){
|
|||
}
|
||||
|
||||
/* both leaves on either side of the portal must be passable */
|
||||
if ( p->nodes[ 0 ]->opaque == false && p->nodes[ 1 ]->opaque == false ) {
|
||||
if ( !p->nodes[ 0 ]->opaque && !p->nodes[ 1 ]->opaque ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1271,9 +1271,8 @@ struct light_t
|
|||
int cluster; /* ydnar: cluster light falls into */
|
||||
|
||||
winding_t *w;
|
||||
Vector3 emitColor; /* full out-of-gamut value */
|
||||
|
||||
float falloffTolerance; /* ydnar: minimum attenuation threshold */
|
||||
float falloffTolerance; /* ydnar: minimum attenuation threshold */
|
||||
float filterRadius; /* ydnar: lightmap filter radius in world units, 0 == default */
|
||||
};
|
||||
|
||||
|
|
@ -1307,7 +1306,6 @@ struct trace_t
|
|||
|
||||
/* input and output */
|
||||
Vector3 color; /* starts out at full color, may be reduced if transparent surfaces are crossed */
|
||||
Vector3 colorNoShadow; /* result color with no shadow casting */
|
||||
Vector3 directionContribution; /* result contribution to the deluxe map */
|
||||
|
||||
/* output */
|
||||
|
|
@ -2008,7 +2006,6 @@ Q_EXTERN picoModel_t *picoModels[ MAX_MODELS ];
|
|||
|
||||
Q_EXTERN shaderInfo_t *shaderInfo Q_ASSIGN( NULL );
|
||||
Q_EXTERN int numShaderInfo Q_ASSIGN( 0 );
|
||||
Q_EXTERN int numVertexRemaps Q_ASSIGN( 0 );
|
||||
|
||||
Q_EXTERN surfaceParm_t custSurfaceParms[ MAX_CUST_SURFACEPARMS ];
|
||||
Q_EXTERN int numCustSurfaceParms Q_ASSIGN( 0 );
|
||||
|
|
@ -2026,9 +2023,7 @@ Q_EXTERN bool doingBSP Q_ASSIGN( false );
|
|||
/* commandline arguments */
|
||||
Q_EXTERN bool verboseEntities Q_ASSIGN( false );
|
||||
Q_EXTERN bool force Q_ASSIGN( false );
|
||||
Q_EXTERN bool infoMode Q_ASSIGN( false );
|
||||
Q_EXTERN bool useCustomInfoParms Q_ASSIGN( false );
|
||||
Q_EXTERN bool noprune Q_ASSIGN( false );
|
||||
Q_EXTERN bool leaktest Q_ASSIGN( false );
|
||||
Q_EXTERN bool nodetail Q_ASSIGN( false );
|
||||
Q_EXTERN bool nosubdivide Q_ASSIGN( false );
|
||||
|
|
@ -2037,7 +2032,6 @@ Q_EXTERN bool fulldetail Q_ASSIGN( false );
|
|||
Q_EXTERN bool nowater Q_ASSIGN( false );
|
||||
Q_EXTERN bool noCurveBrushes Q_ASSIGN( false );
|
||||
Q_EXTERN bool fakemap Q_ASSIGN( false );
|
||||
Q_EXTERN bool coplanar Q_ASSIGN( false );
|
||||
Q_EXTERN bool nofog Q_ASSIGN( false );
|
||||
Q_EXTERN bool noHint Q_ASSIGN( false ); /* ydnar */
|
||||
Q_EXTERN bool renameModelShaders Q_ASSIGN( false ); /* ydnar */
|
||||
|
|
@ -2146,7 +2140,6 @@ Q_EXTERN mapDrawSurface_t *mapDrawSurfs Q_ASSIGN( NULL );
|
|||
Q_EXTERN int numMapDrawSurfs;
|
||||
|
||||
Q_EXTERN int numSurfacesByType[ static_cast<std::size_t>( ESurfaceType::Shader ) + 1 ];
|
||||
Q_EXTERN int numClearedSurfaces;
|
||||
Q_EXTERN int numStripSurfaces;
|
||||
Q_EXTERN int numMaxAreaSurfaces;
|
||||
Q_EXTERN int numFanSurfaces;
|
||||
|
|
@ -2214,13 +2207,7 @@ Q_EXTERN leaf_t *faceleafs;
|
|||
|
||||
Q_EXTERN int numfaces;
|
||||
|
||||
Q_EXTERN byte *vismap, *vismap_p, *vismap_end;
|
||||
|
||||
Q_EXTERN int testlevel;
|
||||
|
||||
Q_EXTERN byte *uncompressed;
|
||||
|
||||
Q_EXTERN int leafbytes, leaflongs;
|
||||
Q_EXTERN int leafbytes;
|
||||
Q_EXTERN int portalbytes, portallongs;
|
||||
|
||||
Q_EXTERN vportal_t *sorted_portals[ MAX_MAP_PORTALS * 2 ];
|
||||
|
|
@ -2305,7 +2292,6 @@ Q_EXTERN float floodlightDirectionScale Q_ASSIGN( 1.0f );
|
|||
|
||||
Q_EXTERN bool dump Q_ASSIGN( false );
|
||||
Q_EXTERN bool debug Q_ASSIGN( false );
|
||||
Q_EXTERN bool debugUnused Q_ASSIGN( false );
|
||||
Q_EXTERN bool debugAxis Q_ASSIGN( false );
|
||||
Q_EXTERN bool debugCluster Q_ASSIGN( false );
|
||||
Q_EXTERN bool debugOrigin Q_ASSIGN( false );
|
||||
|
|
@ -2313,9 +2299,6 @@ Q_EXTERN bool lightmapBorder Q_ASSIGN( false );
|
|||
//1=warn; 0=warn if lmsize>128
|
||||
Q_EXTERN int debugSampleSize Q_ASSIGN( 0 );
|
||||
|
||||
/* longest distance across the map */
|
||||
Q_EXTERN float maxMapDistance Q_ASSIGN( 0 );
|
||||
|
||||
/* for run time tweaking of light sources */
|
||||
Q_EXTERN float pointScale Q_ASSIGN( 7500.0f );
|
||||
Q_EXTERN float spotScale Q_ASSIGN( 7500.0f );
|
||||
|
|
@ -2362,7 +2345,6 @@ Q_EXTERN light_t *lights;
|
|||
Q_EXTERN int numPointLights;
|
||||
Q_EXTERN int numSpotLights;
|
||||
Q_EXTERN int numSunLights;
|
||||
Q_EXTERN int numAreaLights;
|
||||
|
||||
/* ydnar: for luxel placement */
|
||||
Q_EXTERN int numSurfaceClusters, maxSurfaceClusters;
|
||||
|
|
@ -2377,26 +2359,12 @@ Q_EXTERN int numPatchDiffuseLights;
|
|||
/* ydnar: general purpose extra copy of drawvert list */
|
||||
Q_EXTERN bspDrawVert_t *yDrawVerts;
|
||||
|
||||
/* ydnar: for tracing statistics */
|
||||
Q_EXTERN int minSurfacesTested;
|
||||
Q_EXTERN int maxSurfacesTested;
|
||||
Q_EXTERN int totalSurfacesTested;
|
||||
Q_EXTERN int totalTraces;
|
||||
|
||||
Q_EXTERN FILE *dumpFile;
|
||||
|
||||
Q_EXTERN int defaultLightSubdivide Q_ASSIGN( 999 );
|
||||
|
||||
Q_EXTERN Vector3 ambientColor;
|
||||
Q_EXTERN Vector3 minLight, minVertexLight, minGridLight;
|
||||
Q_EXTERN float maxLight Q_ASSIGN( 255.f );
|
||||
|
||||
Q_EXTERN int *entitySurface;
|
||||
Q_EXTERN Vector3 *surfaceOrigin;
|
||||
|
||||
Q_EXTERN Vector3 sunDirection;
|
||||
Q_EXTERN Vector3 sunLight;
|
||||
|
||||
/* ydnar: light optimization */
|
||||
Q_EXTERN float subdivideThreshold Q_ASSIGN( DEFAULT_SUBDIVIDE_THRESHOLD );
|
||||
|
||||
|
|
@ -2430,7 +2398,6 @@ Q_EXTERN int numLightSurfaces Q_ASSIGN( 0 );
|
|||
Q_EXTERN int *lightSurfaces Q_ASSIGN( NULL );
|
||||
|
||||
/* raw lightmaps */
|
||||
Q_EXTERN int numRawSuperLuxels Q_ASSIGN( 0 );
|
||||
Q_EXTERN int numRawLightmaps Q_ASSIGN( 0 );
|
||||
Q_EXTERN rawLightmap_t *rawLightmaps Q_ASSIGN( NULL );
|
||||
Q_EXTERN int *sortLightmaps Q_ASSIGN( NULL );
|
||||
|
|
@ -2539,9 +2506,6 @@ Q_EXTERN bspBrushSide_t* bspBrushSides Q_ASSIGN( NULL );
|
|||
Q_EXTERN int numBSPLightBytes Q_ASSIGN( 0 );
|
||||
Q_EXTERN byte *bspLightBytes Q_ASSIGN( NULL );
|
||||
|
||||
//% Q_EXTERN int numBSPGridPoints Q_ASSIGN( 0 );
|
||||
//% Q_EXTERN byte *bspGridPoints Q_ASSIGN( NULL );
|
||||
|
||||
Q_EXTERN int numBSPGridPoints Q_ASSIGN( 0 );
|
||||
Q_EXTERN bspGridPoint_t *bspGridPoints Q_ASSIGN( NULL );
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,6 @@ void ClearSurface( mapDrawSurface_t *ds ){
|
|||
ds->numIndexes = 0;
|
||||
free( ds->indexes );
|
||||
ds->indexes = NULL;
|
||||
numClearedSurfaces++;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -873,7 +873,6 @@ void LoadPortals( char *name ){
|
|||
|
||||
// these counts should take advantage of 64 bit systems automatically
|
||||
leafbytes = ( ( portalclusters + 63 ) & ~63 ) >> 3;
|
||||
leaflongs = leafbytes / sizeof( long );
|
||||
|
||||
portalbytes = ( ( numportals * 2 + 63 ) & ~63 ) >> 3;
|
||||
portallongs = portalbytes / sizeof( long );
|
||||
|
|
@ -915,17 +914,10 @@ void LoadPortals( char *name ){
|
|||
|
||||
for ( j = 0 ; j < numpoints ; j++ )
|
||||
{
|
||||
double v[3];
|
||||
int k;
|
||||
|
||||
// scanf into double, then assign to vec_t
|
||||
// so we don't care what size vec_t is
|
||||
if ( fscanf( f, "(%lf %lf %lf ) "
|
||||
, &v[0], &v[1], &v[2] ) != 3 ) {
|
||||
if ( fscanf( f, "(%f %f %f ) ",
|
||||
&w->points[j][0], &w->points[j][1], &w->points[j][2] ) != 3 ) {
|
||||
Error( "LoadPortals: reading portal %i", i );
|
||||
}
|
||||
for ( k = 0 ; k < 3 ; k++ )
|
||||
w->points[j][k] = v[k];
|
||||
}
|
||||
if ( fscanf( f, "\n" ) != 0 ) {
|
||||
// silence gcc warning
|
||||
|
|
@ -989,17 +981,10 @@ void LoadPortals( char *name ){
|
|||
|
||||
for ( j = 0 ; j < numpoints ; j++ )
|
||||
{
|
||||
double v[3];
|
||||
int k;
|
||||
|
||||
// scanf into double, then assign to vec_t
|
||||
// so we don't care what size vec_t is
|
||||
if ( fscanf( f, "(%lf %lf %lf ) "
|
||||
, &v[0], &v[1], &v[2] ) != 3 ) {
|
||||
if ( fscanf( f, "(%f %f %f ) ",
|
||||
&w->points[j][0], &w->points[j][1], &w->points[j][2] ) != 3 ) {
|
||||
Error( "LoadPortals: reading portal %i", i );
|
||||
}
|
||||
for ( k = 0 ; k < 3 ; k++ )
|
||||
w->points[j][k] = v[k];
|
||||
}
|
||||
if ( fscanf( f, "\n" ) != 0 ) {
|
||||
// silence gcc warning
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user