* -bounceColorRatio 0..1 (ratio of colorizing sample by texture)
	* -debugclip: autoclip debug, uses shaders debugclip, debugclip2
	* >2GB makefile option, allows up to 3GB ram on 32bit, 4GB on 64bit
	* speedup patch to use fast sqrt at some points of light phase, where precision is not needed

Radiant:

binds...
	* paste to camera - shift+v (alt+v was leading to texBro-View menu)
This commit is contained in:
Garux 2017-08-01 13:33:37 +03:00
parent 7ca7a54fe6
commit bf803dd851
12 changed files with 209 additions and 118 deletions

View File

@ -482,7 +482,7 @@ endif
%.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check %.o: %.c $(if $(findstring $(DEPEND_ON_MAKEFILE),yes),$(wildcard Makefile*),) | dependencies-check
$(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@ $(CC) $< $(CFLAGS) $(CFLAGS_COMMON) $(CPPFLAGS_EXTRA) $(CPPFLAGS_COMMON) $(CPPFLAGS) $(TARGET_ARCH) -c -o $@
$(INSTALLDIR)/q3map2.$(EXE): LDFLAGS_EXTRA := -Wl,--large-address-aware
$(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_ZLIB) $(INSTALLDIR)/q3map2.$(EXE): LIBS_EXTRA := $(LIBS_XML) $(LIBS_GLIB) $(LIBS_PNG) $(LIBS_JPEG) $(LIBS_ZLIB)
$(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) $(CPPFLAGS_JPEG) -Itools/quake3/common -Ilibs -Iinclude $(INSTALLDIR)/q3map2.$(EXE): CPPFLAGS_EXTRA := $(CPPFLAGS_XML) $(CPPFLAGS_GLIB) $(CPPFLAGS_PNG) $(CPPFLAGS_JPEG) -Itools/quake3/common -Ilibs -Iinclude
$(INSTALLDIR)/q3map2.$(EXE): \ $(INSTALLDIR)/q3map2.$(EXE): \

View File

@ -101,7 +101,13 @@ void _CrossProduct( vec3_t v1, vec3_t v2, vec3_t cross );
// I need this define in order to test some of the regression tests from time to time. // I need this define in order to test some of the regression tests from time to time.
// This define affect the precision of VectorNormalize() function only. // This define affect the precision of VectorNormalize() function only.
#define MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX 1 #define MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX 1
vec_t VectorNormalize( const vec3_t in, vec3_t out ); vec_t VectorAccurateNormalize( const vec3_t in, vec3_t out );
vec_t VectorFastNormalize( const vec3_t in, vec3_t out );
#if MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX
#define VectorNormalize VectorAccurateNormalize
#else
#define VectorNormalize VectorFastNormalize
#endif
vec_t ColorNormalize( const vec3_t in, vec3_t out ); vec_t ColorNormalize( const vec3_t in, vec3_t out );
void VectorInverse( vec3_t v ); void VectorInverse( vec3_t v );
void VectorPolar( vec3_t v, float radius, float theta, float phi ); void VectorPolar( vec3_t v, float radius, float theta, float phi );

View File

@ -153,9 +153,7 @@ void _VectorCopy( vec3_t in, vec3_t out ){
out[2] = in[2]; out[2] = in[2];
} }
vec_t VectorNormalize( const vec3_t in, vec3_t out ) { vec_t VectorAccurateNormalize( const vec3_t in, vec3_t out ) {
#if MATHLIB_VECTOR_NORMALIZE_PRECISION_FIX
// The sqrt() function takes double as an input and returns double as an // The sqrt() function takes double as an input and returns double as an
// output according the the man pages on Debian and on FreeBSD. Therefore, // output according the the man pages on Debian and on FreeBSD. Therefore,
@ -179,26 +177,30 @@ vec_t VectorNormalize( const vec3_t in, vec3_t out ) {
out[2] = (vec_t) ( z / length ); out[2] = (vec_t) ( z / length );
return (vec_t) length; return (vec_t) length;
#else
vec_t length, ilength;
length = (vec_t)sqrt( in[0] * in[0] + in[1] * in[1] + in[2] * in[2] );
if ( length == 0 ) {
VectorClear( out );
return 0;
} }
ilength = 1.0f / length; vec_t VectorFastNormalize( const vec3_t in, vec3_t out ) {
// SmileTheory: This is ioquake3's VectorNormalize2
// for when accuracy matters less than speed
float length, ilength;
length = in[0] * in[0] + in[1] * in[1] + in[2] * in[2];
if ( length ) {
/* writing it this way allows gcc to recognize that rsqrt can be used */
ilength = 1 / (float)sqrt( length );
/* sqrt(length) = length * (1 / sqrt(length)) */
length *= ilength;
out[0] = in[0] * ilength; out[0] = in[0] * ilength;
out[1] = in[1] * ilength; out[1] = in[1] * ilength;
out[2] = in[2] * ilength; out[2] = in[2] * ilength;
}
else {
VectorClear( out );
}
return length; return length;
#endif
} }
vec_t ColorNormalize( const vec3_t in, vec3_t out ) { vec_t ColorNormalize( const vec3_t in, vec3_t out ) {

View File

@ -1024,6 +1024,9 @@ filter_brush_any_face g_filter_brush_liquids( &g_filter_face_liquids );
filter_face_shader g_filter_face_hint( "textures/common/hint" ); filter_face_shader g_filter_face_hint( "textures/common/hint" );
filter_brush_any_face g_filter_brush_hint( &g_filter_face_hint ); filter_brush_any_face g_filter_brush_hint( &g_filter_face_hint );
filter_face_shader g_filter_face_hintlocal( "textures/common/hintlocal" );
filter_brush_any_face g_filter_brush_hintlocal( &g_filter_face_hintlocal );
filter_face_shader g_filter_face_hint_q2( "textures/hint" ); filter_face_shader g_filter_face_hint_q2( "textures/hint" );
filter_brush_any_face g_filter_brush_hint_q2( &g_filter_face_hint_q2 ); filter_brush_any_face g_filter_brush_hint_q2( &g_filter_face_hint_q2 );
@ -1065,6 +1068,7 @@ void BrushFilters_construct(){
add_face_filter( g_filter_face_caulk_ja, EXCLUDE_CAULK ); add_face_filter( g_filter_face_caulk_ja, EXCLUDE_CAULK );
add_brush_filter( g_filter_brush_liquids, EXCLUDE_LIQUIDS ); add_brush_filter( g_filter_brush_liquids, EXCLUDE_LIQUIDS );
add_brush_filter( g_filter_brush_hint, EXCLUDE_HINTSSKIPS ); add_brush_filter( g_filter_brush_hint, EXCLUDE_HINTSSKIPS );
add_brush_filter( g_filter_brush_hintlocal, EXCLUDE_HINTSSKIPS );
add_brush_filter( g_filter_brush_hint_q2, EXCLUDE_HINTSSKIPS ); add_brush_filter( g_filter_brush_hint_q2, EXCLUDE_HINTSSKIPS );
add_brush_filter( g_filter_brush_hint_ja, EXCLUDE_HINTSSKIPS ); add_brush_filter( g_filter_brush_hint_ja, EXCLUDE_HINTSSKIPS );
add_brush_filter( g_filter_brush_clusterportal, EXCLUDE_CLUSTERPORTALS ); add_brush_filter( g_filter_brush_clusterportal, EXCLUDE_CLUSTERPORTALS );

View File

@ -3198,7 +3198,7 @@ void MainFrame_Construct(){
GlobalCommands_insert( "Redo", FreeCaller<Redo>(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) ); GlobalCommands_insert( "Redo", FreeCaller<Redo>(), Accelerator( 'Y', (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "Copy", FreeCaller<Copy>(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) ); GlobalCommands_insert( "Copy", FreeCaller<Copy>(), Accelerator( 'C', (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "Paste", FreeCaller<Paste>(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) ); GlobalCommands_insert( "Paste", FreeCaller<Paste>(), Accelerator( 'V', (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "PasteToCamera", FreeCaller<PasteToCamera>(), Accelerator( 'V', (GdkModifierType)GDK_MOD1_MASK ) ); GlobalCommands_insert( "PasteToCamera", FreeCaller<PasteToCamera>(), Accelerator( 'V', (GdkModifierType)GDK_SHIFT_MASK ) );
GlobalCommands_insert( "CloneSelection", FreeCaller<Selection_Clone>(), Accelerator( GDK_space ) ); GlobalCommands_insert( "CloneSelection", FreeCaller<Selection_Clone>(), Accelerator( GDK_space ) );
GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller<Selection_Clone_MakeUnique>(), Accelerator( GDK_space, (GdkModifierType)GDK_SHIFT_MASK ) ); GlobalCommands_insert( "CloneSelectionAndMakeUnique", FreeCaller<Selection_Clone_MakeUnique>(), Accelerator( GDK_space, (GdkModifierType)GDK_SHIFT_MASK ) );
// GlobalCommands_insert( "DeleteSelection", FreeCaller<deleteSelection>(), Accelerator( GDK_BackSpace ) ); // GlobalCommands_insert( "DeleteSelection", FreeCaller<deleteSelection>(), Accelerator( GDK_BackSpace ) );

View File

@ -319,6 +319,10 @@ void ProcessWorldModel( void ){
/* check for patches with adjacent edges that need to lod together */ /* check for patches with adjacent edges that need to lod together */
PatchMapDrawSurfs( e ); PatchMapDrawSurfs( e );
if ( debugClip ) {
AddTriangleModels( e );
}
/* build an initial bsp tree using all of the sides of all of the structural brushes */ /* build an initial bsp tree using all of the sides of all of the structural brushes */
faces = MakeStructuralBSPFaceList( entities[ 0 ].brushes ); faces = MakeStructuralBSPFaceList( entities[ 0 ].brushes );
tree = FaceBSP( faces ); tree = FaceBSP( faces );
@ -387,7 +391,9 @@ void ProcessWorldModel( void ){
FloodAreas( tree ); FloodAreas( tree );
/* create drawsurfs for triangle models */ /* create drawsurfs for triangle models */
if ( !debugClip ) {
AddTriangleModels( e ); AddTriangleModels( e );
}
/* create drawsurfs for surface models */ /* create drawsurfs for surface models */
AddEntitySurfaceModels( e ); AddEntitySurfaceModels( e );
@ -945,6 +951,14 @@ int BSPMain( int argc, char **argv ){
Sys_Printf( "Debug portal surfaces enabled\n" ); Sys_Printf( "Debug portal surfaces enabled\n" );
debugPortals = qtrue; debugPortals = qtrue;
} }
else if ( !strcmp( argv[ i ], "-debugclip" ) ) {
Sys_Printf( "Debug model clip enabled\n" );
debugClip = qtrue;
}
else if ( !strcmp( argv[ i ], "-snapmodelclip" ) ) {
Sys_Printf( "Snapping model clip enabled\n" );
snapModelClip = qtrue;
}
else if ( !strcmp( argv[ i ], "-sRGBtex" ) ) { else if ( !strcmp( argv[ i ], "-sRGBtex" ) ) {
texturesRGB = qtrue; texturesRGB = qtrue;
Sys_Printf( "Textures are in sRGB\n" ); Sys_Printf( "Textures are in sRGB\n" );

View File

@ -720,7 +720,7 @@ float PointToPolygonFormFactor( const vec3_t point, const vec3_t normal, const w
for ( i = 0; i < w->numpoints; i++ ) for ( i = 0; i < w->numpoints; i++ )
{ {
VectorSubtract( w->p[ i ], point, dirs[ i ] ); VectorSubtract( w->p[ i ], point, dirs[ i ] );
VectorNormalize( dirs[ i ], dirs[ i ] ); VectorFastNormalize( dirs[ i ], dirs[ i ] );
} }
/* duplicate first vertex to avoid mod operation */ /* duplicate first vertex to avoid mod operation */
@ -746,7 +746,7 @@ float PointToPolygonFormFactor( const vec3_t point, const vec3_t normal, const w
angle = acos( dot ); angle = acos( dot );
CrossProduct( dirs[ i ], dirs[ j ], triVector ); CrossProduct( dirs[ i ], dirs[ j ], triVector );
if ( VectorNormalize( triVector, triNormal ) < 0.0001f ) { if ( VectorFastNormalize( triVector, triNormal ) < 0.0001f ) {
continue; continue;
} }
@ -2260,6 +2260,19 @@ int LightMain( int argc, char **argv ){
Sys_Printf( "No lightmaps yo\n" ); Sys_Printf( "No lightmaps yo\n" );
} }
else if ( !strcmp( argv[ i ], "-bouncecolorratio" ) ) {
f = atof( argv[ i + 1 ] );
bounceColorRatio *= f;
if ( bounceColorRatio > 1 ) {
bounceColorRatio = 1;
}
if ( bounceColorRatio < 0 ) {
bounceColorRatio = 0;
}
Sys_Printf( "Bounce color ratio set to %f\n", bounceColorRatio );
i++;
}
else if ( !strcmp( argv[ i ], "-bouncescale" ) ) { else if ( !strcmp( argv[ i ], "-bouncescale" ) ) {
f = atof( argv[ i + 1 ] ); f = atof( argv[ i + 1 ] );
bounceScale *= f; bounceScale *= f;
@ -2760,7 +2773,7 @@ int LightMain( int argc, char **argv ){
if ( ( atof( argv[ i + 1 ] ) != 0 ) && ( atof( argv[ i + 1 ] )) < 1 ) { if ( ( atof( argv[ i + 1 ] ) != 0 ) && ( atof( argv[ i + 1 ] )) < 1 ) {
noVertexLighting = ( atof( argv[ i + 1 ] ) ); noVertexLighting = ( atof( argv[ i + 1 ] ) );
i++; i++;
Sys_Printf( "Setting vertex lighting globally to %d\n", noVertexLighting ); Sys_Printf( "Setting vertex lighting globally to %f\n", noVertexLighting );
} }
else{ else{
Sys_Printf( "Disabling vertex lighting\n" ); Sys_Printf( "Disabling vertex lighting\n" );

View File

@ -256,7 +256,7 @@ qboolean RadSampleImage( byte *pixels, int width, int height, float st[ 2 ], flo
#define SAMPLE_GRANULARITY 6 #define SAMPLE_GRANULARITY 6
static void RadSample( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm, shaderInfo_t *si, radWinding_t *rw, vec3_t average, vec3_t gradient, int *style ){ static void RadSample( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm, shaderInfo_t *si, radWinding_t *rw, vec3_t average, vec3_t gradient, int *style ){
int i, j, k, l, v, x, y, samples; int i, j, k, l, v, x, y, samples, avgcolor;
vec3_t color, mins, maxs; vec3_t color, mins, maxs;
vec4_t textureColor; vec4_t textureColor;
float alpha, alphaI, bf; float alpha, alphaI, bf;
@ -290,8 +290,10 @@ static void RadSample( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm,
VectorCopy( si->averageColor, textureColor ); VectorCopy( si->averageColor, textureColor );
textureColor[ 4 ] = 255.0f; textureColor[ 4 ] = 255.0f;
} }
avgcolor = ( textureColor[ 0 ] + textureColor[ 1 ] + textureColor[ 2 ] ) / 3;
for ( i = 0; i < 3; i++ ) for ( i = 0; i < 3; i++ )
color[ i ] = ( textureColor[ i ] / 255 ) * ( rw->verts[ samples ].color[ lightmapNum ][ i ] / 255.0f ); color[ i ] = ( ( textureColor[ i ] * bounceColorRatio + ( avgcolor * ( 1 - bounceColorRatio ) ) ) / 255 ) * ( rw->verts[ samples ].color[ lightmapNum ][ i ] / 255.0f );
// color[ i ] = ( textureColor[ i ] / 255 ) * ( rw->verts[ samples ].color[ lightmapNum ][ i ] / 255.0f );
AddPointToBounds( color, mins, maxs ); AddPointToBounds( color, mins, maxs );
VectorAdd( average, color, average ); VectorAdd( average, color, average );
@ -374,9 +376,11 @@ static void RadSample( int lightmapNum, bspDrawSurface_t *ds, rawLightmap_t *lm,
VectorCopy( si->averageColor, textureColor ); VectorCopy( si->averageColor, textureColor );
textureColor[ 4 ] = 255; textureColor[ 4 ] = 255;
} }
for ( i = 0; i < 3; i++ ) avgcolor = ( textureColor[ 0 ] + textureColor[ 1 ] + textureColor[ 2 ] ) / 3;
color[ i ] = ( textureColor[ i ] / 255 ) * ( radLuxel[ i ] / 255 ); for ( l = 0; l < 3; l++ ){
color[ l ] = ( ( textureColor[ l ] * bounceColorRatio + ( avgcolor * ( 1 - bounceColorRatio ) ) ) / 255 ) * ( radLuxel[ l ] / 255 );
//Sys_Printf( "%i %i %i %i %i \n", (int) textureColor[ 0 ], (int) textureColor[ 1 ], (int) textureColor[ 2 ], (int) avgcolor, (int) color[ i ] );
}
AddPointToBounds( color, mins, maxs ); AddPointToBounds( color, mins, maxs );
VectorAdd( average, color, average ); VectorAdd( average, color, average );

View File

@ -1618,16 +1618,30 @@ qboolean TraceWinding( traceWinding_t *tw, trace_t *trace ){
/* /*
TraceLine_r() TraceLine_r()
returns qtrue if something is hit and tracing can stop returns qtrue if something is hit and tracing can stop
SmileTheory: made half-iterative
*/ */
static qboolean TraceLine_r( int nodeNum, vec3_t origin, vec3_t end, trace_t *trace ){ #define TRACELINE_R_HALF_ITERATIVE 1
#if TRACELINE_R_HALF_ITERATIVE
static qboolean TraceLine_r( int nodeNum, const vec3_t start, const vec3_t end, trace_t *trace )
#else
static qboolean TraceLine_r( int nodeNum, const vec3_t origin, const vec3_t end, trace_t *trace )
#endif
{
traceNode_t *node; traceNode_t *node;
int side; int side;
float front, back, frac; float front, back, frac;
vec3_t mid; vec3_t origin, mid;
qboolean r; qboolean r;
#if TRACELINE_R_HALF_ITERATIVE
VectorCopy( start, origin );
while ( 1 )
#endif
{
/* bogus node number means solid, end tracing unless testing all */ /* bogus node number means solid, end tracing unless testing all */
if ( nodeNum < 0 ) { if ( nodeNum < 0 ) {
VectorCopy( origin, trace->hit ); VectorCopy( origin, trace->hit );
@ -1685,12 +1699,22 @@ static qboolean TraceLine_r( int nodeNum, vec3_t origin, vec3_t end, trace_t *tr
/* entirely in front side? */ /* entirely in front side? */
if ( front >= -TRACE_ON_EPSILON && back >= -TRACE_ON_EPSILON ) { if ( front >= -TRACE_ON_EPSILON && back >= -TRACE_ON_EPSILON ) {
#if TRACELINE_R_HALF_ITERATIVE
nodeNum = node->children[ 0 ];
continue;
#else
return TraceLine_r( node->children[ 0 ], origin, end, trace ); return TraceLine_r( node->children[ 0 ], origin, end, trace );
#endif
} }
/* entirely on back side? */ /* entirely on back side? */
if ( front < TRACE_ON_EPSILON && back < TRACE_ON_EPSILON ) { if ( front < TRACE_ON_EPSILON && back < TRACE_ON_EPSILON ) {
#if TRACELINE_R_HALF_ITERATIVE
nodeNum = node->children[ 1 ];
continue;
#else
return TraceLine_r( node->children[ 1 ], origin, end, trace ); return TraceLine_r( node->children[ 1 ], origin, end, trace );
#endif
} }
/* select side */ /* select side */
@ -1708,13 +1732,18 @@ static qboolean TraceLine_r( int nodeNum, vec3_t origin, vec3_t end, trace_t *tr
//% VectorCopy( mid, trace->hit ); //% VectorCopy( mid, trace->hit );
/* trace first side */ /* trace first side */
r = TraceLine_r( node->children[ side ], origin, mid, trace ); if ( TraceLine_r( node->children[ side ], origin, mid, trace ) ) {
if ( r ) { return qtrue;
return r;
} }
/* trace other side */ /* trace other side */
#if TRACELINE_R_HALF_ITERATIVE
nodeNum = node->children[ !side ];
VectorCopy( mid, origin );
#else
return TraceLine_r( node->children[ !side ], mid, end, trace ); return TraceLine_r( node->children[ !side ], mid, end, trace );
#endif
}
} }
@ -1791,7 +1820,7 @@ void TraceLine( trace_t *trace ){
float SetupTrace( trace_t *trace ){ float SetupTrace( trace_t *trace ){
VectorSubtract( trace->end, trace->origin, trace->displacement ); VectorSubtract( trace->end, trace->origin, trace->displacement );
trace->distance = VectorNormalize( trace->displacement, trace->direction ); trace->distance = VectorFastNormalize( trace->displacement, trace->direction );
VectorCopy( trace->origin, trace->hit ); VectorCopy( trace->origin, trace->hit );
return trace->distance; return trace->distance;
} }

View File

@ -237,7 +237,7 @@ qboolean SnapNormal( vec3_t normal ){
snaps a plane to normal/distance epsilons snaps a plane to normal/distance epsilons
*/ */
void SnapPlane( vec3_t normal, vec_t *dist, vec3_t center ){ void SnapPlane( vec3_t normal, vec_t *dist ){
// SnapPlane disabled by LordHavoc because it often messes up collision // SnapPlane disabled by LordHavoc because it often messes up collision
// brushes made from triangles of embedded models, and it has little effect // brushes made from triangles of embedded models, and it has little effect
// on anything else (axial planes are usually derived from snapped points) // on anything else (axial planes are usually derived from snapped points)
@ -326,7 +326,12 @@ int FindFloatPlane( vec3_t innormal, vec_t dist, int numPoints, vec3_t *points )
VectorCopy( innormal, normal ); VectorCopy( innormal, normal );
#if Q3MAP2_EXPERIMENTAL_SNAP_PLANE_FIX #if Q3MAP2_EXPERIMENTAL_SNAP_PLANE_FIX
if ( !doingModelClip ) {
SnapPlaneImproved( normal, &dist, numPoints, (const vec3_t *) points ); SnapPlaneImproved( normal, &dist, numPoints, (const vec3_t *) points );
}
if ( doingModelClip && snapModelClip ) {
SnapPlane( normal, &dist );
}
#else #else
SnapPlane( normal, &dist ); SnapPlane( normal, &dist );
#endif #endif

View File

@ -652,8 +652,15 @@ void InsertModel( const char *name, int skin, int frame, m4x4_t transform, remap
/* set up brush sides */ /* set up brush sides */
buildBrush->numsides = 5; buildBrush->numsides = 5;
buildBrush->sides[ 0 ].shaderInfo = si; buildBrush->sides[ 0 ].shaderInfo = si;
for ( j = 1; j < buildBrush->numsides; j++ ) for ( j = 1; j < buildBrush->numsides; j++ ) {
if ( debugClip ) {
buildBrush->sides[ 0 ].shaderInfo = ShaderInfoForShader( "debugclip2" );
buildBrush->sides[ j ].shaderInfo = ShaderInfoForShader( "debugclip" );
}
else {
buildBrush->sides[ j ].shaderInfo = NULL; // don't emit these faces as draw surfaces, should make smaller BSPs; hope this works buildBrush->sides[ j ].shaderInfo = NULL; // don't emit these faces as draw surfaces, should make smaller BSPs; hope this works
}
}
buildBrush->sides[ 0 ].planenum = FindFloatPlane( plane, plane[ 3 ], 3, points ); buildBrush->sides[ 0 ].planenum = FindFloatPlane( plane, plane[ 3 ], 3, points );
buildBrush->sides[ 1 ].planenum = FindFloatPlane( pa, pa[ 3 ], 2, &points[ 1 ] ); // pa contains points[1] and points[2] buildBrush->sides[ 1 ].planenum = FindFloatPlane( pa, pa[ 3 ], 2, &points[ 1 ] ); // pa contains points[1] and points[2]
@ -714,6 +721,8 @@ void AddTriangleModels( entity_t *e ){
/* note it */ /* note it */
Sys_FPrintf( SYS_VRB, "--- AddTriangleModels ---\n" ); Sys_FPrintf( SYS_VRB, "--- AddTriangleModels ---\n" );
doingModelClip = qtrue;
/* get current brush entity targetname */ /* get current brush entity targetname */
if ( e == entities ) { if ( e == entities ) {
targetName = ""; targetName = "";
@ -962,4 +971,6 @@ void AddTriangleModels( entity_t *e ){
remap = remap2; remap = remap2;
} }
} }
doingModelClip = qfalse;
} }

View File

@ -2001,7 +2001,8 @@ Q_EXTERN float jitters[ MAX_JITTERS ];
/*can't code*/ /*can't code*/
Q_EXTERN qboolean doingBSP Q_ASSIGN( qfalse ); Q_EXTERN qboolean doingBSP Q_ASSIGN( qfalse );
Q_EXTERN qboolean doingModelClip Q_ASSIGN( qfalse );
Q_EXTERN qboolean snapModelClip Q_ASSIGN( qfalse );
/* commandline arguments */ /* commandline arguments */
Q_EXTERN qboolean nocmdline Q_ASSIGN( qfalse ); Q_EXTERN qboolean nocmdline Q_ASSIGN( qfalse );
@ -2043,6 +2044,7 @@ Q_EXTERN qboolean emitFlares Q_ASSIGN( qfalse );
Q_EXTERN qboolean debugSurfaces Q_ASSIGN( qfalse ); Q_EXTERN qboolean debugSurfaces Q_ASSIGN( qfalse );
Q_EXTERN qboolean debugInset Q_ASSIGN( qfalse ); Q_EXTERN qboolean debugInset Q_ASSIGN( qfalse );
Q_EXTERN qboolean debugPortals Q_ASSIGN( qfalse ); Q_EXTERN qboolean debugPortals Q_ASSIGN( qfalse );
Q_EXTERN qboolean debugClip Q_ASSIGN( qfalse ); /* debug model autoclipping */
Q_EXTERN qboolean lightmapTriangleCheck Q_ASSIGN( qfalse ); Q_EXTERN qboolean lightmapTriangleCheck Q_ASSIGN( qfalse );
Q_EXTERN qboolean lightmapExtraVisClusterNudge Q_ASSIGN( qfalse ); Q_EXTERN qboolean lightmapExtraVisClusterNudge Q_ASSIGN( qfalse );
Q_EXTERN qboolean lightmapFill Q_ASSIGN( qfalse ); Q_EXTERN qboolean lightmapFill Q_ASSIGN( qfalse );
@ -2302,6 +2304,7 @@ Q_EXTERN float spotScale Q_ASSIGN( 7500.0f );
Q_EXTERN float areaScale Q_ASSIGN( 0.25f ); Q_EXTERN float areaScale Q_ASSIGN( 0.25f );
Q_EXTERN float skyScale Q_ASSIGN( 1.0f ); Q_EXTERN float skyScale Q_ASSIGN( 1.0f );
Q_EXTERN float bounceScale Q_ASSIGN( 0.25f ); Q_EXTERN float bounceScale Q_ASSIGN( 0.25f );
Q_EXTERN float bounceColorRatio Q_ASSIGN( 1.0f );
Q_EXTERN float vertexglobalscale Q_ASSIGN( 1.0f ); Q_EXTERN float vertexglobalscale Q_ASSIGN( 1.0f );
/* jal: alternative angle attenuation curve */ /* jal: alternative angle attenuation curve */