Merge branch 'TorqueGameEngines:development' into development_gld

This commit is contained in:
GoldenThumbs 2022-08-27 20:35:13 -05:00 committed by GitHub
commit 6832086ecb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 28 deletions

View file

@ -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,7 +86,6 @@ 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 )
@ -164,8 +163,6 @@ 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)" );
@ -214,7 +211,6 @@ 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 );
@ -245,7 +241,6 @@ 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 ) )
@ -328,8 +323,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 );

View file

@ -78,7 +78,7 @@ class LevelInfo : public NetObject
/// Interpolation for going from one global ambient color /// Interpolation for going from one global ambient color
/// to a different one. /// to a different one.
EaseF mAmbientLightBlendCurve; EaseF mAmbientLightBlendCurve;
LinearColorF mFallbackAmbient;
/// @} /// @}
/// @name Sound Properties /// @name Sound Properties

View file

@ -817,7 +817,7 @@ void ReflectionProbe::createEditorResources()
void ReflectionProbe::prepRenderImage(SceneRenderState *state) void ReflectionProbe::prepRenderImage(SceneRenderState *state)
{ {
if (!mEnabled || (!RenderProbeMgr::smRenderReflectionProbes && Con::getVariable("$Probes::Capturing", "0") == "0")) if (!mEnabled || (!RenderProbeMgr::smRenderReflectionProbes && dStrcmp(Con::getVariable("$Probes::Capturing", "0"),"1")))
return; return;
Point3F distVec = getRenderPosition() - state->getCameraPosition(); Point3F distVec = getRenderPosition() - state->getCameraPosition();

View file

@ -42,7 +42,6 @@
Signal<void(const char*,bool)> LightManager::smActivateSignal; Signal<void(const char*,bool)> LightManager::smActivateSignal;
LightManager *LightManager::smActiveLM = NULL; LightManager *LightManager::smActiveLM = NULL;
LinearColorF gFallbackAmbient;
LightManager::LightManager( const char *name, const char *id ) LightManager::LightManager( const char *name, const char *id )
: mName( name ), : mName( name ),
@ -163,28 +162,19 @@ LightInfo* LightManager::getDefaultLight()
{ {
// The sun is always our default light when // The sun is always our default light when
// when its registered. // when its registered.
if (mSpecialLights[LightManager::slSunLightType]) if ( mSpecialLights[ LightManager::slSunLightType ] )
{ return mSpecialLights[ LightManager::slSunLightType ];
mSpecialLights[LightManager::slSunLightType]->setAmbient(gFallbackAmbient);
return mSpecialLights[LightManager::slSunLightType];
}
// Else return a dummy special light. // Else return a dummy special light.
if (!mDefaultLight) if ( !mDefaultLight )
{
mDefaultLight = createLightInfo(); mDefaultLight = createLightInfo();
}
mDefaultLight->setAmbient(gFallbackAmbient);
return mDefaultLight; return mDefaultLight;
} }
LightInfo* LightManager::getSpecialLight( LightManager::SpecialLightTypesEnum type, bool useDefault ) LightInfo* LightManager::getSpecialLight( LightManager::SpecialLightTypesEnum type, bool useDefault )
{ {
if (mSpecialLights[type]) if ( mSpecialLights[type] )
{
mSpecialLights[LightManager::slSunLightType]->setAmbient(gFallbackAmbient);
return mSpecialLights[type]; return mSpecialLights[type];
}
if ( useDefault ) if ( useDefault )
return getDefaultLight(); return getDefaultLight();

View file

@ -798,7 +798,7 @@ void RenderProbeMgr::render( SceneRenderState *state )
_setupPerFrameParameters(state); _setupPerFrameParameters(state);
// Early out if nothing to draw. // Early out if nothing to draw.
if ((!RenderProbeMgr::smRenderReflectionProbes && Con::getVariable("$Probes::Capturing", "0") == "0") || (!mHasSkylight && mProbeData.effectiveProbeCount == 0)) if ((!RenderProbeMgr::smRenderReflectionProbes && dStrcmp(Con::getVariable("$Probes::Capturing", "0"), "1")) || (!mHasSkylight && mProbeData.effectiveProbeCount == 0))
{ {
getProbeArrayEffect()->setSkip(true); getProbeArrayEffect()->setSkip(true);
mActiveProbes.clear(); mActiveProbes.clear();

View file

@ -500,7 +500,7 @@ vec4 computeForwardProbes(Surface surface,
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N)); float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
horizon *= horizon; horizon *= horizon;
#if CAPTURING == 1 #if CAPTURING == 1
return vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0); return vec4(mix((irradiance + specular* horizon),surface.baseColor.rgb,surface.metalness),0);
#else #else
return vec4((irradiance + specular* horizon) , 0);//alpha writes disabled return vec4((irradiance + specular* horizon) , 0);//alpha writes disabled
#endif #endif

View file

@ -506,7 +506,7 @@ float4 computeForwardProbes(Surface surface,
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N)); float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
horizon *= horizon; horizon *= horizon;
#if CAPTURING == 1 #if CAPTURING == 1
return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0); return float4(lerp((irradiance + specular* horizon),surface.baseColor.rgb,surface.metalness),0);
#else #else
return float4((irradiance + specular* horizon) , 0);//alpha writes disabled return float4((irradiance + specular* horizon) , 0);//alpha writes disabled
#endif #endif

View file

@ -205,7 +205,7 @@ void main()
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N)); float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
horizon *= horizon; horizon *= horizon;
#if CAPTURING == 1 #if CAPTURING == 1
OUT_col = vec4(mix(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0); OUT_col = vec4(mix((irradiance + specular* horizon),surface.baseColor.rgb, surface.metalness),0);
#else #else
OUT_col = vec4((irradiance + specular* horizon)*ambientColor, 0);//alpha writes disabled OUT_col = vec4((irradiance + specular* horizon)*ambientColor, 0);//alpha writes disabled
#endif #endif

View file

@ -191,7 +191,7 @@ float4 main(PFXVertToPix IN) : SV_TARGET
float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N)); float horizon = saturate( 1 + horizonOcclusion * dot(surface.R, surface.N));
horizon *= horizon; horizon *= horizon;
#if CAPTURING == 1 #if CAPTURING == 1
return float4(lerp(surface.baseColor.rgb,(irradiance + specular* horizon) ,surface.metalness/2),0); return float4(lerp((irradiance + specular* horizon), surface.baseColor.rgb,surface.metalness),0);
#else #else
return float4((irradiance + specular* horizon)*ambientColor, 0);//alpha writes disabled return float4((irradiance + specular* horizon)*ambientColor, 0);//alpha writes disabled
#endif #endif