Update ReflectionManager on Scene Field Change

During side-by-side rendering the refraction texture needs to be updated
for both the left and right fields.  These changes add a new GFXDevice
event type to track when a field is about to be rendered.  The
ReflectionManager listens to this new event and ensures that the
refraction texture will be updated if it is referenced by a material.
This commit is contained in:
DavidWyand-GG 2013-10-31 16:54:22 -04:00
parent f790d58978
commit 39ab93636c
4 changed files with 39 additions and 2 deletions

View file

@ -794,6 +794,8 @@ void GFXDevice::setCubeTexture( U32 stage, GFXCubemap *texture )
mCurrentTexture[stage] = NULL;
}
//------------------------------------------------------------------------------
inline bool GFXDevice::beginScene()
{
AssertFatal( mCanCurrentlyRender == false, "GFXDevice::beginScene() - The scene has already begun!" );
@ -806,8 +808,6 @@ inline bool GFXDevice::beginScene()
return beginSceneInternal();
}
//------------------------------------------------------------------------------
inline void GFXDevice::endScene()
{
AssertFatal( mCanCurrentlyRender == true, "GFXDevice::endScene() - The scene has already ended!" );
@ -819,6 +819,22 @@ inline void GFXDevice::endScene()
mDeviceStatistics.exportToConsole();
}
inline void GFXDevice::beginField()
{
AssertFatal( mCanCurrentlyRender == true, "GFXDevice::beginField() - The scene has not yet begun!" );
// Send the start of field signal.
getDeviceEventSignal().trigger( GFXDevice::deStartOfField );
}
inline void GFXDevice::endField()
{
AssertFatal( mCanCurrentlyRender == true, "GFXDevice::endField() - The scene has not yet begun!" );
// Send the end of field signal.
getDeviceEventSignal().trigger( GFXDevice::deEndOfField );
}
void GFXDevice::setViewport( const RectI &inRect )
{
// Clip the rect against the renderable size.