add separate spotlight scale -spotscale
This commit is contained in:
parent
98bf67071d
commit
2cc696a6e1
|
|
@ -400,7 +400,6 @@ void CreateEntityLights( void )
|
||||||
if(light->extraDist == 0.0f)
|
if(light->extraDist == 0.0f)
|
||||||
light->extraDist = extraDist;
|
light->extraDist = extraDist;
|
||||||
|
|
||||||
intensity = intensity * pointScale;
|
|
||||||
light->photons = intensity;
|
light->photons = intensity;
|
||||||
|
|
||||||
light->type = EMIT_POINT;
|
light->type = EMIT_POINT;
|
||||||
|
|
@ -424,6 +423,7 @@ void CreateEntityLights( void )
|
||||||
{
|
{
|
||||||
Sys_Printf( "WARNING: light at (%i %i %i) has missing target\n",
|
Sys_Printf( "WARNING: light at (%i %i %i) has missing target\n",
|
||||||
(int) light->origin[ 0 ], (int) light->origin[ 1 ], (int) light->origin[ 2 ] );
|
(int) light->origin[ 0 ], (int) light->origin[ 1 ], (int) light->origin[ 2 ] );
|
||||||
|
intensity = intensity * pointScale;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -461,7 +461,7 @@ void CreateEntityLights( void )
|
||||||
/* make a sun */
|
/* make a sun */
|
||||||
VectorScale( light->normal, -1.0f, sun.direction );
|
VectorScale( light->normal, -1.0f, sun.direction );
|
||||||
VectorCopy( light->color, sun.color );
|
VectorCopy( light->color, sun.color );
|
||||||
sun.photons = (intensity / pointScale);
|
sun.photons = intensity;
|
||||||
sun.deviance = deviance / 180.0f * Q_PI;
|
sun.deviance = deviance / 180.0f * Q_PI;
|
||||||
sun.numSamples = numSamples;
|
sun.numSamples = numSamples;
|
||||||
sun.style = noStyles ? LS_NORMAL : light->style;
|
sun.style = noStyles ? LS_NORMAL : light->style;
|
||||||
|
|
@ -477,8 +477,14 @@ void CreateEntityLights( void )
|
||||||
/* skip the rest of this love story */
|
/* skip the rest of this love story */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
intensity = intensity * spotScale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
intensity = intensity * pointScale;
|
||||||
|
|
||||||
/* jitter the light */
|
/* jitter the light */
|
||||||
for( j = 1; j < numSamples; j++ )
|
for( j = 1; j < numSamples; j++ )
|
||||||
|
|
@ -2127,10 +2133,27 @@ int LightMain( int argc, char **argv )
|
||||||
{
|
{
|
||||||
f = atof( argv[ i + 1 ] );
|
f = atof( argv[ i + 1 ] );
|
||||||
pointScale *= f;
|
pointScale *= f;
|
||||||
|
spotScale *= f;
|
||||||
Sys_Printf( "Point (entity) light scaled by %f to %f\n", f, pointScale );
|
Sys_Printf( "Point (entity) light scaled by %f to %f\n", f, pointScale );
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !strcmp( argv[ i ], "-pointonly" ) || !strcmp( argv[ i ], "-pointonlyscale" ) )
|
||||||
|
{
|
||||||
|
f = atof( argv[ i + 1 ] );
|
||||||
|
pointScale *= f;
|
||||||
|
Sys_Printf( "Point (entity) light scaled by %f to %f\n", f, pointScale );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( !strcmp( argv[ i ], "-spot" ) || !strcmp( argv[ i ], "-spotscale" ) )
|
||||||
|
{
|
||||||
|
f = atof( argv[ i + 1 ] );
|
||||||
|
spotScale *= f;
|
||||||
|
Sys_Printf( "Point (entity) light scaled by %f to %f\n", f, spotScale );
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
else if( !strcmp( argv[ i ], "-area" ) || !strcmp( argv[ i ], "-areascale" ) )
|
else if( !strcmp( argv[ i ], "-area" ) || !strcmp( argv[ i ], "-areascale" ) )
|
||||||
{
|
{
|
||||||
f = atof( argv[ i + 1 ] );
|
f = atof( argv[ i + 1 ] );
|
||||||
|
|
@ -2159,6 +2182,7 @@ int LightMain( int argc, char **argv )
|
||||||
{
|
{
|
||||||
f = atof( argv[ i + 1 ] );
|
f = atof( argv[ i + 1 ] );
|
||||||
pointScale *= f;
|
pointScale *= f;
|
||||||
|
spotScale *= f;
|
||||||
areaScale *= f;
|
areaScale *= f;
|
||||||
skyScale *= f;
|
skyScale *= f;
|
||||||
bounceScale *= f;
|
bounceScale *= f;
|
||||||
|
|
|
||||||
|
|
@ -2280,6 +2280,7 @@ Q_EXTERN float maxMapDistance Q_ASSIGN( 0 );
|
||||||
|
|
||||||
/* for run time tweaking of light sources */
|
/* for run time tweaking of light sources */
|
||||||
Q_EXTERN float pointScale Q_ASSIGN( 7500.0f );
|
Q_EXTERN float pointScale Q_ASSIGN( 7500.0f );
|
||||||
|
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 );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user