This commit is contained in:
[un usuario] 2025-04-02 20:36:30 -04:00 committed by GitHub
commit d01593b295
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 28 additions and 5 deletions

View file

@ -1196,7 +1196,7 @@ int RunVBSP( int argc, char **argv )
Warning(
"Other options :\n"
" -novconfig : Don't bring up graphical UI on vproject errors.\n"
" -threads : Control the number of threads vbsp uses (defaults to the # of\n"
" -threads # : Control the number of threads vbsp uses (defaults to the # of\n"
" processors on your machine).\n"
" -verboseentities: If -v is on, this disables verbose output for submodels.\n"
" -noweld : Don't join face vertices together.\n"

View file

@ -313,7 +313,7 @@ struct ambientsample_t
// be discarded. This has the effect of converging on the best samples when enough are added.
void AddSampleToList( CUtlVector<ambientsample_t> &list, const Vector &samplePosition, Vector *pCube )
{
const int MAX_SAMPLES = 16;
const int MAX_SAMPLES = ambientcubes_perleaf;
int index = list.AddToTail();
list[index].pos = samplePosition;
@ -698,7 +698,7 @@ void ComputePerLeafAmbientLighting()
{
if ( !(dleafs[i].contents & CONTENTS_SOLID) )
{
Msg("Bad leaf ambient for leaf %d\n", i );
Warning("Bad leaf ambient for leaf %d\n", i );
}
int refLeaf = NearestNeighborWithLight(i);

View file

@ -102,6 +102,7 @@ bool debug_extra = false;
qboolean do_fast = false;
qboolean do_centersamples = false;
int extrapasses = 4;
int ambientcubes_perleaf = 16;
float smoothing_threshold = 0.7071067; // cos(45.0*(M_PI/180))
// Cosine of smoothing angle(in radians)
float coring = 1.0; // Light threshold to force to blackness(minimizes lightmaps)
@ -2436,6 +2437,26 @@ int ParseCommandLine( int argc, char **argv, bool *onlydetail )
{
g_bLargeDispSampleRadius = true;
}
else if (!Q_stricmp(argv[i], "-AmbientCubesPerLeaf"))
{
if (++i < argc && *argv[i])
{
if (atof(argv[i]) > 0)
{
ambientcubes_perleaf = atof(argv[i]);
}
else
{
Warning("Error: expected a positive number after '-AmbientCubesPerLeaf'\n");
return -1;
}
}
else
{
Warning("Error: expected a number after '-AmbientCubesPerLeaf'\n");
return -1;
}
}
else if (!Q_stricmp( argv[i], "-dumppropmaps"))
{
g_bDumpPropLightmaps = true;
@ -2836,7 +2857,7 @@ void PrintUsage( int argc, char **argv )
" -dump : Write debugging .txt files.\n"
" -dumpnormals : Write normals to debug files.\n"
" -dumptrace : Write ray-tracing environment to debug files.\n"
" -threads : Control the number of threads vbsp uses (defaults to the #\n"
" -threads # : Control the number of threads vbsp uses (defaults to the #\n"
" or processors on your machine).\n"
" -lights <file> : Load a lights file in addition to lights.rad and the\n"
" level lights file.\n"
@ -2869,6 +2890,7 @@ void PrintUsage( int argc, char **argv )
" -LargeDispSampleRadius: This can be used if there are splotches of bounced light\n"
" on terrain. The compile will take longer, but it will gather\n"
" light across a wider area.\n"
" -AmbientCubesPerLeaf #: Lets you scale how many ambient lights your leaf has (default 16).\n"
" -StaticPropLighting : generate backed static prop vertex lighting\n"
" -StaticPropPolys : Perform shadow tests of static props at polygon precision\n"
" -OnlyStaticProps : Only perform direct static prop lighting (vrad debug option)\n"

View file

@ -54,6 +54,7 @@
extern float dispchop; // "-dispchop" tightest number of luxel widths for a patch, used on edges
extern float g_MaxDispPatchRadius;
extern int ambientcubes_perleaf;
//-----------------------------------------------------------------------------
// forward declarations

View file

@ -1039,7 +1039,7 @@ void PrintUsage( int argc, char **argv )
#ifdef MPI
" -mpi_pw <pw> : Use a password to choose a specific set of VMPI workers.\n"
#endif
" -threads : Control the number of threads vbsp uses (defaults to the #\n"
" -threads # : Control the number of threads vvis uses (defaults to the #\n"
" or processors on your machine).\n"
" -nosort : Don't sort portals (sorting is an optimization).\n"
" -tmpin : Make portals come from \\tmp\\<mapname>.\n"