mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge pull request #294 from Areloch/LocalLightShadowsPref
Adds a pref to dictate if local lights can cast shadows or not.
This commit is contained in:
commit
fb7ae70676
|
|
@ -57,6 +57,8 @@ bool AdvancedLightBinManager::smUseLightFade = false;
|
|||
F32 AdvancedLightBinManager::smLightFadeStart = 50;
|
||||
F32 AdvancedLightBinManager::smLightFadeEnd = 75;
|
||||
|
||||
bool AdvancedLightBinManager::smAllowLocalLightShadows = true;
|
||||
|
||||
ImplementEnumType( ShadowFilterMode,
|
||||
"The shadow filtering modes for Advanced Lighting shadows.\n"
|
||||
"@ingroup AdvancedLighting" )
|
||||
|
|
@ -192,6 +194,8 @@ void AdvancedLightBinManager::consoleInit()
|
|||
Con::addVariable("$pref::lightFadeStart", TypeF32, &smLightFadeStart, "Distance at which light fading begins if $pref::useLightFade is on.\n");
|
||||
Con::addVariable("$pref::lightFadeEnd", TypeF32, &smLightFadeEnd, "Distance at which light fading should have fully faded if $pref::useLightFade is on.\n");
|
||||
|
||||
Con::addVariable("$pref::allowLocalLightShadows", TypeBool, &smAllowLocalLightShadows, "Indicates if local lights(point/spot) can cast shadows.\n");
|
||||
|
||||
}
|
||||
|
||||
bool AdvancedLightBinManager::setTargetSize(const Point2I &newTargetSize)
|
||||
|
|
@ -240,7 +244,7 @@ void AdvancedLightBinManager::addLight( LightInfo *light )
|
|||
|
||||
// Get the right shadow type.
|
||||
ShadowType shadowType = ShadowType_None;
|
||||
if ( light->getCastShadows() &&
|
||||
if ( light->getCastShadows() && smAllowLocalLightShadows &&
|
||||
lsm && lsm->hasShadowTex() &&
|
||||
!ShadowMapPass::smDisableShadows )
|
||||
shadowType = lsm->getShadowType();
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ public:
|
|||
static F32 smLightFadeEnd;
|
||||
static F32 smLightFadeStart;
|
||||
|
||||
static bool smAllowLocalLightShadows;
|
||||
|
||||
// Used for console init
|
||||
AdvancedLightBinManager( AdvancedLightManager *lm = NULL,
|
||||
ShadowMapManager *sm = NULL,
|
||||
|
|
|
|||
Loading…
Reference in a new issue