Support for ZHLT's sun spread angle

Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
Joshua Ashton 2021-08-22 19:15:45 +01:00
parent ab6c146ddb
commit c5215a0737
No known key found for this signature in database
GPG Key ID: C85A08669126BE8D
1 changed files with 9 additions and 2 deletions

View File

@ -246,7 +246,7 @@ void CreateEntityLights( void ){
const char *name;
const char *target;
vec3_t dest;
const char *_color, *_light_brightness;
const char *_color, *_light_brightness, *_spread;
float intensity, scale, deviance, filterRadius;
int spawnflags, flags, numSamples;
qboolean junior;
@ -340,7 +340,14 @@ void CreateEntityLights( void ){
/* get filter radius from shader */
sun->filterRadius = FloatForKey( e, "filterradius" );
sun->deviance = FloatForKey( e, "sunspreadangle" );
_spread = ValueForKey( e, "_spread" );
if ( _spread && _spread[ 0 ] ) {
/* ZHLT's sun spread angle. */
sun->deviance = atof( _spread );
}
else {
sun->deviance = FloatForKey( e, "sunspreadangle" );
}
sun->deviance = sun->deviance / 180.0f * Q_PI;
sun->numSamples = IntForKey( e, "samples" );