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

View file

@ -246,7 +246,7 @@ void CreateEntityLights( void ){
const char *name; const char *name;
const char *target; const char *target;
vec3_t dest; vec3_t dest;
const char *_color, *_light_brightness; const char *_color, *_light_brightness, *_spread;
float intensity, scale, deviance, filterRadius; float intensity, scale, deviance, filterRadius;
int spawnflags, flags, numSamples; int spawnflags, flags, numSamples;
qboolean junior; qboolean junior;
@ -340,7 +340,14 @@ void CreateEntityLights( void ){
/* get filter radius from shader */ /* get filter radius from shader */
sun->filterRadius = FloatForKey( e, "filterradius" ); sun->filterRadius = FloatForKey( e, "filterradius" );
_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 = FloatForKey( e, "sunspreadangle" );
}
sun->deviance = sun->deviance / 180.0f * Q_PI; sun->deviance = sun->deviance / 180.0f * Q_PI;
sun->numSamples = IntForKey( e, "samples" ); sun->numSamples = IntForKey( e, "samples" );