|
@@ -68,7 +68,7 @@ extern ColorI gCanvasClearColor;
|
|
|
|
|
|
/// @see DecalManager
|
|
/// @see DecalManager
|
|
extern F32 gDecalBias;
|
|
extern F32 gDecalBias;
|
|
-
|
|
|
|
|
|
+extern LinearColorF gFallbackAmbient;
|
|
/// @see AccumulationVolume
|
|
/// @see AccumulationVolume
|
|
extern GFXTexHandle gLevelAccuMap;
|
|
extern GFXTexHandle gLevelAccuMap;
|
|
|
|
|
|
@@ -86,6 +86,7 @@ LevelInfo::LevelInfo()
|
|
mDecalBias( 0.0015f ),
|
|
mDecalBias( 0.0015f ),
|
|
mCanvasClearColor( 255, 0, 255, 255 ),
|
|
mCanvasClearColor( 255, 0, 255, 255 ),
|
|
mAmbientLightBlendPhase( 1.f ),
|
|
mAmbientLightBlendPhase( 1.f ),
|
|
|
|
+ mFallbackAmbient(LinearColorF(0.1f, 0.1f, 0.1f, 1.0f)),
|
|
mSoundAmbience( NULL ),
|
|
mSoundAmbience( NULL ),
|
|
mSoundDistanceModel( SFXDistanceModelLinear ),
|
|
mSoundDistanceModel( SFXDistanceModelLinear ),
|
|
mSoundscape( NULL )
|
|
mSoundscape( NULL )
|
|
@@ -163,6 +164,8 @@ void LevelInfo::initPersistFields()
|
|
addField( "ambientLightBlendCurve", TypeEaseF, Offset( mAmbientLightBlendCurve, LevelInfo ),
|
|
addField( "ambientLightBlendCurve", TypeEaseF, Offset( mAmbientLightBlendCurve, LevelInfo ),
|
|
"Interpolation curve to use for blending from one ambient light color to a different one." );
|
|
"Interpolation curve to use for blending from one ambient light color to a different one." );
|
|
|
|
|
|
|
|
+ addField("fallbackAmbient", TypeColorF, Offset(mFallbackAmbient, LevelInfo),
|
|
|
|
+ "Ambient Color to use if no global light source exists.");
|
|
//addField( "advancedLightmapSupport", TypeBool, Offset( mAdvancedLightmapSupport, LevelInfo ),
|
|
//addField( "advancedLightmapSupport", TypeBool, Offset( mAdvancedLightmapSupport, LevelInfo ),
|
|
// "Enable expanded support for mixing static and dynamic lighting (more costly)" );
|
|
// "Enable expanded support for mixing static and dynamic lighting (more costly)" );
|
|
|
|
|
|
@@ -211,6 +214,7 @@ U32 LevelInfo::packUpdate(NetConnection *conn, U32 mask, BitStream *stream)
|
|
stream->writeFlag( mAdvancedLightmapSupport );
|
|
stream->writeFlag( mAdvancedLightmapSupport );
|
|
stream->write( mAmbientLightBlendPhase );
|
|
stream->write( mAmbientLightBlendPhase );
|
|
mathWrite( *stream, mAmbientLightBlendCurve );
|
|
mathWrite( *stream, mAmbientLightBlendCurve );
|
|
|
|
+ stream->write(mFallbackAmbient);
|
|
|
|
|
|
sfxWrite( stream, mSoundAmbience );
|
|
sfxWrite( stream, mSoundAmbience );
|
|
stream->writeInt( mSoundDistanceModel, 1 );
|
|
stream->writeInt( mSoundDistanceModel, 1 );
|
|
@@ -241,6 +245,7 @@ void LevelInfo::unpackUpdate(NetConnection *conn, BitStream *stream)
|
|
mAdvancedLightmapSupport = stream->readFlag();
|
|
mAdvancedLightmapSupport = stream->readFlag();
|
|
stream->read( &mAmbientLightBlendPhase );
|
|
stream->read( &mAmbientLightBlendPhase );
|
|
mathRead( *stream, &mAmbientLightBlendCurve );
|
|
mathRead( *stream, &mAmbientLightBlendCurve );
|
|
|
|
+ stream->read(&mFallbackAmbient);
|
|
|
|
|
|
String errorStr;
|
|
String errorStr;
|
|
if( !sfxReadAndResolve( stream, &mSoundAmbience, errorStr ) )
|
|
if( !sfxReadAndResolve( stream, &mSoundAmbience, errorStr ) )
|
|
@@ -323,8 +328,8 @@ void LevelInfo::_updateSceneGraph()
|
|
scene->setVisibleGhostDistance( mVisibleGhostDistance );
|
|
scene->setVisibleGhostDistance( mVisibleGhostDistance );
|
|
|
|
|
|
gDecalBias = mDecalBias;
|
|
gDecalBias = mDecalBias;
|
|
-
|
|
|
|
// Set ambient lighting properties.
|
|
// Set ambient lighting properties.
|
|
|
|
+ gFallbackAmbient = mFallbackAmbient;
|
|
|
|
|
|
scene->setAmbientLightTransitionTime( mAmbientLightBlendPhase * 1000.f );
|
|
scene->setAmbientLightTransitionTime( mAmbientLightBlendPhase * 1000.f );
|
|
scene->setAmbientLightTransitionCurve( mAmbientLightBlendCurve );
|
|
scene->setAmbientLightTransitionCurve( mAmbientLightBlendCurve );
|