}
}
-
-
/*
FixWinding() - ydnar
removes degenerate edges from a winding
------------------------------------------------------------------------------- */
-
/*
ProcessAdvertisements()
copies advertisement info into the BSP structures
char level[ 2 ], shader[ 1024 ];
const char *value;
-
/* sets integer blockSize from worldspawn "_blocksize" key if it exists */
value = ValueForKey( &entities[ 0 ], "_blocksize" );
if( value[ 0 ] == '\0' )
buf = bspEntData;
end = buf;
*end = 0;
+
/* run through entity list */
for( i = 0; i < numBSPEntities && i < numEntities; i++ )
{
const char *value;
-
/* get cast shadows */
if( castShadows != NULL )
{
plane = &mapplanes[ splitPlaneNum ];
childLists[0] = NULL;
childLists[1] = NULL;
+
for( split = list; split; split = next )
{
/* set next */
{ "nodlight", 0, 0, Q_SURF_NODLIGHT, 0, 0, 0 },
{ "dust", 0, 0, Q_SURF_DUST, 0, 0, 0 },
+
/* null */
{ NULL, 0, 0, 0, 0, 0, 0 }
}
intensity = intensity * pointScale;
light->photons = intensity;
-
+
light->type = EMIT_POINT;
/* set falloff threshold */
float d;
vec3_t pushedOrigin;
-
/* project sample point into light plane */
d = DotProduct( trace->origin, light->normal ) - light->dist;
if( d < 3.0f )
{
float distByNormal, radiusAtDist, sampleRadius;
vec3_t pointAtDist, distToSample;
-
-
+
/* do cone calculation */
distByNormal = -DotProduct( trace->displacement, light->normal );
if( distByNormal < 0.0f )
/* clamp the distance to prevent super hot spots */
if( dist < 16.0f )
dist = 16.0f;
-
+
/* attenuate */
add = light->photons / (dist * dist);
}
contribution_t contributions[ MAX_CONTRIBUTIONS ];
trace_t trace;
-
/* get grid points */
gp = &rawGridPoints[ num ];
bgp = &bspGridPoints[ num ];
if( dirty )
{
Sys_Printf( "--- DirtyRawLightmap ---\n" );
-
-
-
-
RunThreadsOnIndividual( numRawLightmaps, qtrue, DirtyRawLightmap );
}
Sys_Printf( "Dark lightmap seams enabled\n" );
}
-
-
-
-
-
-
else if( !strcmp( argv[ i ], "-shadeangle" ) )
{
shadeAngleDegrees = atof( argv[ i + 1 ] );
if( ti->castShadows != 1 )
return qfalse;
}
-
+
/* receive shadows from same group and worldspawn group */
else if( trace->recvShadows > 1 )
{
lm->superLuxels[ lightmapNum ] = safe_malloc( size );
memset( lm->superLuxels[ lightmapNum ], 0, size );
}
-
+
/* set style */
if( lightmapNum > 0 )
{
if( *cluster < 0 ||
(lm->splotchFix && (luxel[ 0 ] <= ambientColor[ 0 ] || luxel[ 1 ] <= ambientColor[ 1 ] || luxel[ 2 ] <= ambientColor[ 2 ])) )
filterColor = qtrue;
+
if( deluxemap && lightmapNum == 0 && (*cluster < 0 || filter) )
filterDir = qtrue;
-/* -------------------------------------------------------------------------------
+/* -------------------------------------------------------------------------------;
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
/* dependencies */
#include "q3map2.h"
+
+
/*
Random()
returns a pseudorandom number between 0 and 1
/* set exit call */
atexit( ExitQ3Map );
-
+
/* read general options first */
for( i = 1; i < argc; i++ )
{
argv[ i ] = NULL;
}
}
-
+
/* init model library */
PicoInit();
PicoSetMallocFunc( safe_malloc );
brush_t *b;
parseMesh_t *p;
-
/* walk brush list */
for( b = ent->brushes; b != NULL; b = b->next )
{
float longestCurve;
int maxIterations;
-
MatchToken( "{" );
/* get texture */
// plane the same way vis will, and flip the side orders if needed
// FIXME: is this still relevent?
WindingPlane (w, normal, &dist);
+
if ( DotProduct (p->plane.normal, normal) < 0.99 )
{ // backwards...
fprintf (pf,"%i %i %i ",w->numpoints, p->nodes[1]->cluster, p->nodes[0]->cluster);
int maxIterations;
int patchWidth, patchHeight;
vec3_t bounds[ 2 ];
-
+
/* ydnar/sd: for foliage */
int numFoliageInstances;
}
surfaceInfo_t;
-
-
/* -------------------------------------------------------------------------------
prototypes
int i;
shaderInfo_t *si;
char shader[ MAX_QPATH ];
-
-
+
/* dummy check */
if( shaderName == NULL || shaderName[ 0 ] == '\0' )
{
{
surfaceModel_t *model;
-
/* allocate new model and attach it */
model = safe_malloc( sizeof( *model ) );
memset( model, 0, sizeof( *model ) );
numSurfacesByType[ ds->type ]++;
}
-
-
/*
EmitPatchSurface()
emits a bsp patch drawsurface
if( ds->backSide || ds->shaderInfo->invert )
{
bspDrawVert_t *dv1, *dv2, temp;
-
/* walk the verts, flip the normal */
for( i = 0; i < ds->numVerts; i++ )
/* invert facing */
VectorScale( ds->lightmapVecs[ 2 ], -1.0f, ds->lightmapVecs[ 2 ] );
}
-
+
/* allocate a new surface */
if( numBSPDrawSurfaces == MAX_MAP_DRAW_SURFS )
Error( "MAX_MAP_DRAW_SURFS" );
ds->outputNum = numBSPDrawSurfaces;
numBSPDrawSurfaces++;
memset( out, 0, sizeof( *out ) );
-
+
/* set it up */
out->surfaceType = MST_PATCH;
if( debugSurfaces )
numSurfacesByType[ ds->type ]++;
}
-
-
/*
OptimizeTriangleSurface() - ydnar
optimizes the vertex/index data in a triangle surface
{
int i, temp;
bspDrawSurface_t *out;
-
-
+
/* invert the surface if necessary */
if( ds->backSide || ds->shaderInfo->invert )
{
ds->indexes[ i ] = ds->indexes[ i + 1 ];
ds->indexes[ i + 1 ] = temp;
}
-
+
/* walk the verts, flip the normal */
for( i = 0; i < ds->numVerts; i++ )
VectorScale( ds->verts[ i ].normal, -1.0f, ds->verts[ i ].normal );
-
+
/* invert facing */
VectorScale( ds->lightmapVecs[ 2 ], -1.0f, ds->lightmapVecs[ 2 ] );
}
-
+
/* allocate a new surface */
if( numBSPDrawSurfaces == MAX_MAP_DRAW_SURFS )
Error( "MAX_MAP_DRAW_SURFS" );
}
-
/*
MakeDebugPortalSurfs_r() - ydnar
generates drawsurfaces for passable portals in the bsp
/* get shader */
si = ds->shaderInfo;
-
+
/* ydnar: skybox surfaces are special */
if( ds->skybox )
{
{
int i;
bspDrawVert_t *v, *temp;
-
+
/* try to find an existing drawvert */
for( i = firstSearchMetaVert, v = &metaVerts[ i ]; i < numMetaVerts; i++, v++ )
case SURFACE_TRIANGLES:
break;
-
+
case SURFACE_FORCED_META:
case SURFACE_META:
SurfaceToMetaTriangles( ds );
int indexes[ MAX_SAMPLES ];
vec3_t votes[ MAX_SAMPLES ];
-
/* note it */
Sys_FPrintf( SYS_VRB, "--- SmoothMetaTriangles ---\n" );
shadeAngle = DEG2RAD( tri->si->shadeAngleDegrees );
else
shadeAngle = defaultShadeAngle;
+
if( shadeAngle > maxShadeAngle )
maxShadeAngle = shadeAngle;
}
else
+ {
Sys_Printf( "WARNING: Unknown option \"%s\"\n", argv[ i ] );
+ }
}
if( i != argc - 1 )