Skip to content

Commit

Permalink
Update guiMaterialPreview.cpp
Browse files Browse the repository at this point in the history
use mSaveFrustm to keep states between object switches
  • Loading branch information
marauder2k7 committed Dec 4, 2024
1 parent 925b733 commit 291c5c7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Engine/source/T3D/guiMaterialPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,8 @@ void GuiMaterialPreview::renderWorld(const RectI &updateRect)
F32 left, right, top, bottom, nearPlane, farPlane;
bool isOrtho;
GFX->getFrustum( &left, &right, &bottom, &top, &nearPlane, &farPlane, &isOrtho);
Frustum frust( isOrtho, left, right, bottom, top, nearPlane, farPlane, MatrixF::Identity );
mSaveFrustum = Frustum( isOrtho, left, right, bottom, top, nearPlane, farPlane, MatrixF::Identity );
mSaveFrustum.setTransform(MatrixF::Identity);

FogData savedFogData = gClientSceneGraph->getFogData();
gClientSceneGraph->setFogData( FogData() ); // no fog in preview window
Expand All @@ -382,7 +383,7 @@ void GuiMaterialPreview::renderWorld(const RectI &updateRect)
(
gClientSceneGraph,
SPT_Diffuse,
SceneCameraState( GFX->getViewport(), frust, GFX->getWorldMatrix(), GFX->getProjectionMatrix() ),
SceneCameraState( GFX->getViewport(), mSaveFrustum, GFX->getWorldMatrix(), GFX->getProjectionMatrix() ),
renderPass,
true
);
Expand Down

0 comments on commit 291c5c7

Please sign in to comment.