- added a 'lightsizefactor' command to gldefs.
This is for mitigating the recently discovered problem with attenuated lights getting reduced in size, even on OpenGL 3+. The intent of the shrinking was to account for higher brightness of non-attenuated lights on OpenGL 2 and was never meant to be active on more modern versions. The factor will apply to any attenuated light defined after it and will be inherited by included sub-lumps, but it will only last for the lunp it is set in. If you have a definition for the broken behavior, AddLightAssociation 'lightsizefactor 0.667' at the top of your GLDEFS.
This commit is contained in:
parent
4ab6034a36
commit
e77cba1fd8
2 changed files with 20 additions and 9 deletions
|
|
@ -137,7 +137,7 @@ void FLightDefaults::ApplyProperties(ADynamicLight * light) const
|
|||
|
||||
extern int ScriptDepth;
|
||||
|
||||
void AddLightDefaults(FLightDefaults *defaults)
|
||||
void AddLightDefaults(FLightDefaults *defaults, double attnFactor)
|
||||
{
|
||||
FLightDefaults *temp;
|
||||
unsigned int i;
|
||||
|
|
@ -153,6 +153,11 @@ void AddLightDefaults(FLightDefaults *defaults)
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (defaults->GetAttenuate())
|
||||
{
|
||||
defaults->SetArg(LIGHT_INTENSITY, int(defaults->GetArg(LIGHT_INTENSITY) * attnFactor));
|
||||
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, int(defaults->GetArg(LIGHT_SECONDARY_INTENSITY) * attnFactor));
|
||||
}
|
||||
|
||||
LightDefaults.Push(defaults);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue