Merge pull request #270 from Areloch/lightFieldsCleanup

Some cleanup and adjusting of local light fields and default settings.
This commit is contained in:
Brian Roberts 2020-08-03 14:05:01 -05:00 committed by GitHub
commit 4da43119b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 4 deletions

View file

@ -47,7 +47,7 @@ struct LightAnimState
{ {
/// Constructor. /// Constructor.
LightAnimState() LightAnimState()
: active( true ), : active( false ),
animationPhase( 1.0f ), animationPhase( 1.0f ),
animationPeriod( 1.0f ), animationPeriod( 1.0f ),
brightness( 1.0f ), brightness( 1.0f ),
@ -177,4 +177,4 @@ public:
AnimValue<1> mBrightness; AnimValue<1> mBrightness;
}; };
#endif // _LIGHTANIMDATA_H_ #endif // _LIGHTANIMDATA_H_

View file

@ -27,6 +27,7 @@
#include "core/stream/bitStream.h" #include "core/stream/bitStream.h"
#include "gfx/gfxDrawUtil.h" #include "gfx/gfxDrawUtil.h"
#include "lighting/shadowMap/lightShadowMap.h"
IMPLEMENT_CO_NETOBJECT_V1( PointLight ); IMPLEMENT_CO_NETOBJECT_V1( PointLight );
@ -83,6 +84,13 @@ PointLight::PointLight()
// We set the type here to ensure the extended // We set the type here to ensure the extended
// parameter validation works when setting fields. // parameter validation works when setting fields.
mLight->setType( LightInfo::Point ); mLight->setType( LightInfo::Point );
//This lets us override the default shadowmap properties for point lights specifically
//We'll set the overdark factor to a lower value to mitigate visible aliasing from over-darkening the cubemap
//And then use cubemaps as the default shadowmap type
ShadowMapParams* p = mLight->getExtended<ShadowMapParams>();
p->overDarkFactor = Point4F(10, 5, 4, 1);
p->shadowType = ShadowType::ShadowType_CubeMap;
} }
PointLight::~PointLight() PointLight::~PointLight()
@ -104,6 +112,11 @@ void PointLight::initPersistFields()
// Remove the scale field... it's already // Remove the scale field... it's already
// defined by the light radius. // defined by the light radius.
removeField( "scale" ); removeField( "scale" );
//These are particular fields for PSSM, so useless for point lights
removeField("numSplits");
removeField("logWeight");
removeField("lastSplitTerrainOnly");
} }
void PointLight::_conformLights() void PointLight::_conformLights()

View file

@ -110,6 +110,11 @@ void SpotLight::initPersistFields()
// Remove the scale field... it's already // Remove the scale field... it's already
// defined by the range and angle. // defined by the range and angle.
removeField( "scale" ); removeField( "scale" );
//These are particular fields for PSSM, so useless for point lights
removeField("numSplits");
removeField("logWeight");
removeField("lastSplitTerrainOnly");
} }
void SpotLight::_conformLights() void SpotLight::_conformLights()

View file

@ -99,7 +99,7 @@ const String AdvancedLightBinManager::smShadowTypeMacro[] =
{ {
"", // ShadowType_Spot "", // ShadowType_Spot
"", // ShadowType_PSSM, "", // ShadowType_PSSM,
"SHADOW_PARABOLOID", // ShadowType_Paraboloid, "", // ShadowType_Paraboloid,
"SHADOW_DUALPARABOLOID_SINGLE_PASS", // ShadowType_DualParaboloidSinglePass, "SHADOW_DUALPARABOLOID_SINGLE_PASS", // ShadowType_DualParaboloidSinglePass,
"SHADOW_DUALPARABOLOID", // ShadowType_DualParaboloid, "SHADOW_DUALPARABOLOID", // ShadowType_DualParaboloid,
"SHADOW_CUBE", // ShadowType_CubeMap, "SHADOW_CUBE", // ShadowType_CubeMap,

View file

@ -48,7 +48,6 @@ ImplementEnumType( ShadowType,
"@ingroup AdvancedLighting" ) "@ingroup AdvancedLighting" )
{ ShadowType_Spot, "Spot" }, { ShadowType_Spot, "Spot" },
{ ShadowType_PSSM, "PSSM" }, { ShadowType_PSSM, "PSSM" },
{ ShadowType_Paraboloid, "Paraboloid" },
{ ShadowType_DualParaboloidSinglePass, "DualParaboloidSinglePass" }, { ShadowType_DualParaboloidSinglePass, "DualParaboloidSinglePass" },
{ ShadowType_DualParaboloid, "DualParaboloid" }, { ShadowType_DualParaboloid, "DualParaboloid" },
{ ShadowType_CubeMap, "CubeMap" }, { ShadowType_CubeMap, "CubeMap" },