fix guishapeedpreview not displaying IBL

note this *does* require a baked skylight in the main scene
todo: track down why a similar protocol does not operate for guimaterialpreview and guiobjectview
This commit is contained in:
AzaezelX 2024-02-10 13:36:55 -06:00
parent 25a3c3325f
commit de87d2f6ad
6 changed files with 24 additions and 0 deletions

View file

@ -31,6 +31,8 @@
#include "math/mathTypes.h"
#include "gfx/gfxTransformSaver.h"
#include "console/engineAPI.h"
#include "renderInstance/renderProbeMgr.h"
#include "T3D/lighting/skylight.h"
IMPLEMENT_CONOBJECT( GuiObjectView );
@ -541,6 +543,12 @@ void GuiObjectView::renderWorld( const RectI& updateRect )
// Render primary model.
if (Skylight::smSkylightProbe.isValid())
PROBEMGR->submitProbe(Skylight::smSkylightProbe->getProbeInfo());
FogData savedFogData = gClientSceneGraph->getFogData();
gClientSceneGraph->setFogData(FogData()); // no fog in preview window
if(mModelInstance)
{
if( mRunThread )
@ -567,6 +575,7 @@ void GuiObjectView::renderWorld( const RectI& updateRect )
renderPass->renderPass( &state );
gClientSceneGraph->setFogData(savedFogData); // restore fog setting
// Make sure to remove our fake sun.
LIGHTMGR->unregisterAllLights();
}