@@ -117,6 +117,8 @@ unsigned num_degenerate_faces;
117
117
qboolean g_bLowPriority = false ;
118
118
qboolean g_bLogHashData = false ;
119
119
bool g_bNoDetailLighting = false ;
120
+ // dimhotepus: Original VRAD has 30 non-point sun light samples count which is not enough for large surfaces.
121
+ int g_sunSamplesAreaLight = 1024 ;
120
122
double g_flStartTime;
121
123
bool g_bStaticPropLighting = false ;
122
124
bool g_bStaticPropPolys = false ;
@@ -2614,6 +2616,26 @@ static int ParseCommandLine( int argc, char **argv, bool *onlydetail )
2614
2616
return -1 ;
2615
2617
}
2616
2618
}
2619
+ // dimhotepus: Allow to configure non-point sun light samples count.
2620
+ else if (!Q_stricmp (argv[i], " -sunSamplesAreaLight" ))
2621
+ {
2622
+ if (++i < argc)
2623
+ {
2624
+ int sunSamplesAreaLight = atoi (argv[i]);
2625
+ if (sunSamplesAreaLight < 0 )
2626
+ {
2627
+ Error (" Expected non-negative samples count value after '-sunSamplesAreaLight'\n " );
2628
+ return -1 ;
2629
+ }
2630
+ g_sunSamplesAreaLight = sunSamplesAreaLight;
2631
+ Msg (" --sun-samples-area-light: %d\n " , g_sunSamplesAreaLight);
2632
+ }
2633
+ else
2634
+ {
2635
+ Error (" Expected a samples count value after '-sunSamplesAreaLight'\n " );
2636
+ return -1 ;
2637
+ }
2638
+ }
2617
2639
else if ( !Q_stricmp ( argv[i], " -maxdispsamplesize" ) )
2618
2640
{
2619
2641
if ( ++i < argc )
@@ -2857,67 +2879,68 @@ void PrintUsage( int argc, char **argv )
2857
2879
" \n "
2858
2880
" Common options:\n "
2859
2881
" \n "
2860
- " -v (or -verbose): Turn on verbose output (also shows more command\n "
2861
- " -bounce # : Set max number of bounces (default: 100).\n "
2862
- " -fast : Quick and dirty lighting.\n "
2863
- " -fastambient : Per-leaf ambient sampling is lower quality to save compute time.\n "
2864
- " -final : High quality processing. equivalent to -extrasky 16.\n "
2865
- " -extrasky n : trace N times as many rays for indirect light and sky ambient.\n "
2866
- " -low : Run as an idle-priority process.\n "
2867
- " -mpi : Use VMPI to distribute computations.\n "
2868
- " -rederror : Show errors in red.\n "
2882
+ " -v (or -verbose) : Turn on verbose output (also shows more command\n "
2883
+ " -bounce # : Set max number of bounces (default: 100).\n "
2884
+ " -fast : Quick and dirty lighting.\n "
2885
+ " -fastambient : Per-leaf ambient sampling is lower quality to save compute time.\n "
2886
+ " -final : High quality processing. equivalent to -extrasky 16.\n "
2887
+ " -extrasky n : trace N times as many rays for indirect light and sky ambient.\n "
2888
+ " -low : Run as an idle-priority process.\n "
2889
+ " -mpi : Use VMPI to distribute computations.\n "
2890
+ " -rederror : Show errors in red.\n "
2869
2891
" \n "
2870
- " -vproject <directory> : Override the VPROJECT environment variable.\n "
2871
- " -game <directory> : Same as -vproject.\n "
2892
+ " -vproject <directory> : Override the VPROJECT environment variable.\n "
2893
+ " -game <directory> : Same as -vproject.\n "
2872
2894
" \n "
2873
2895
" Other options:\n "
2874
- " -novconfig : Don't bring up graphical UI on vproject errors.\n "
2875
- " -dump : Write debugging .txt files.\n "
2876
- " -dumpnormals : Write normals to debug files.\n "
2877
- " -dumptrace : Write ray-tracing environment to debug files.\n "
2878
- " -threads : Control the number of threads vbsp uses (defaults to the #\n "
2879
- " or processors on your machine).\n "
2880
- " -lights <file> : Load a lights file in addition to lights.rad and the\n "
2881
- " level lights file.\n "
2882
- " -noextra : Disable supersampling.\n "
2883
- " -debugextra : Places debugging data in lightmaps to visualize\n "
2884
- " supersampling.\n "
2885
- " -smooth # : Set the threshold for smoothing groups, in degrees\n "
2886
- " (default 45).\n "
2887
- " -dlightmap : Force direct lighting into different lightmap than\n "
2888
- " radiosity.\n "
2889
- " -stoponexit : Wait for a keypress on exit.\n "
2890
- " -mpi_pw <pw> : Use a password to choose a specific set of VMPI workers.\n "
2891
- " -nodetaillight : Don't light detail props.\n "
2892
- " -centersamples : Move sample centers.\n "
2893
- " -luxeldensity # : Rescale all luxels by the specified amount (default: 1.0).\n "
2894
- " The number specified must be less than 1.0 or it will be\n "
2895
- " ignored.\n "
2896
- " -loghash : Log the sample hash table to samplehash.txt.\n "
2897
- " -onlydetail : Only light detail props and per-leaf lighting.\n "
2898
- " -maxdispsamplesize #: Set max displacement sample size (default: 512).\n "
2899
- " -softsun <n> : Treat the sun as an area light source of size <n> degrees."
2900
- " Produces soft shadows.\n "
2901
- " Recommended values are between 0 and 5. Default is 0.\n "
2902
- " -FullMinidumps : Write large minidumps on crash.\n "
2903
- " -chop : Smallest number of luxel widths for a bounce patch, used on edges\n "
2904
- " -maxchop : Coarsest allowed number of luxel widths for a patch, used in face interiors\n "
2896
+ " -novconfig : Don't bring up graphical UI on vproject errors.\n "
2897
+ " -dump : Write debugging .txt files.\n "
2898
+ " -dumpnormals : Write normals to debug files.\n "
2899
+ " -dumptrace : Write ray-tracing environment to debug files.\n "
2900
+ " -threads : Control the number of threads vbsp uses (defaults to the #\n "
2901
+ " or processors on your machine).\n "
2902
+ " -lights <file> : Load a lights file in addition to lights.rad and the\n "
2903
+ " level lights file.\n "
2904
+ " -noextra : Disable supersampling.\n "
2905
+ " -debugextra : Places debugging data in lightmaps to visualize\n "
2906
+ " supersampling.\n "
2907
+ " -smooth # : Set the threshold for smoothing groups, in degrees\n "
2908
+ " (default 45).\n "
2909
+ " -dlightmap : Force direct lighting into different lightmap than\n "
2910
+ " radiosity.\n "
2911
+ " -stoponexit : Wait for a keypress on exit.\n "
2912
+ " -mpi_pw <pw> : Use a password to choose a specific set of VMPI workers.\n "
2913
+ " -nodetaillight : Don't light detail props.\n "
2914
+ " -centersamples : Move sample centers.\n "
2915
+ " -luxeldensity # : Rescale all luxels by the specified amount (default: 1.0).\n "
2916
+ " The number specified must be less than 1.0 or it will be\n "
2917
+ " ignored.\n "
2918
+ " -loghash : Log the sample hash table to samplehash.txt.\n "
2919
+ " -onlydetail : Only light detail props and per-leaf lighting.\n "
2920
+ " -maxdispsamplesize # : Set max displacement sample size (default: 512).\n "
2921
+ " -softsun <n> : Treat the sun as an area light source of size <n> degrees."
2922
+ " Produces soft shadows.\n "
2923
+ " Recommended values are between 0 and 5 (default: 0).\n "
2924
+ " -sunSamplesAreaLight # : Set max number of samples from the light_enviroment (default: 1024).\n "
2925
+ " -FullMinidumps : Write large minidumps on crash.\n "
2926
+ " -chop : Smallest number of luxel widths for a bounce patch, used on edges\n "
2927
+ " -maxchop : Coarsest allowed number of luxel widths for a patch, used in face interiors\n "
2905
2928
" \n "
2906
- " -LargeDispSampleRadius: This can be used if there are splotches of bounced light\n "
2907
- " on terrain. The compile will take longer, but it will gather\n "
2908
- " light across a wider area.\n "
2909
- " -StaticPropLighting : generate backed static prop vertex lighting\n "
2910
- " -StaticPropPolys : Perform shadow tests of static props at polygon precision\n "
2911
- " -OnlyStaticProps : Only perform direct static prop lighting (vrad debug option)\n "
2912
- " -StaticPropNormals : when lighting static props, just show their normal vector\n "
2913
- " -textureshadows : Allows texture alpha channels to block light - rays intersecting alpha surfaces will sample the texture\n "
2914
- " -noskyboxrecurse : Turn off recursion into 3d skybox (skybox shadows on world)\n "
2915
- " -nossprops : Globally disable self-shadowing on static props\n "
2929
+ " -LargeDispSampleRadius : This can be used if there are splotches of bounced light\n "
2930
+ " on terrain. The compile will take longer, but it will gather\n "
2931
+ " light across a wider area.\n "
2932
+ " -StaticPropLighting : generate backed static prop vertex lighting\n "
2933
+ " -StaticPropPolys : Perform shadow tests of static props at polygon precision\n "
2934
+ " -OnlyStaticProps : Only perform direct static prop lighting (vrad debug option)\n "
2935
+ " -StaticPropNormals : when lighting static props, just show their normal vector\n "
2936
+ " -textureshadows : Allows texture alpha channels to block light - rays intersecting alpha surfaces will sample the texture\n "
2937
+ " -noskyboxrecurse : Turn off recursion into 3d skybox (skybox shadows on world)\n "
2938
+ " -nossprops : Globally disable self-shadowing on static props\n "
2916
2939
" \n "
2917
2940
#if 1 // Disabled for the initial SDK release with VMPI so we can get feedback from selected users.
2918
2941
);
2919
2942
#else
2920
- " -mpi_ListParams : Show a list of VMPI parameters.\n"
2943
+ " -mpi_ListParams : Show a list of VMPI parameters.\n"
2921
2944
"\n"
2922
2945
);
2923
2946
0 commit comments