Merge pull request #1213 from Azaezel/alpha41/ProbesInPreviewers

fix guishapeedpreview not displaying IBL
This commit is contained in:
Brian Roberts 2024-02-10 14:50:23 -06:00 committed by GitHub
commit 5afbfec3b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 29 additions and 7 deletions

View file

@ -33,6 +33,8 @@
#include "core/resourceManager.h"
#include "scene/sceneManager.h"
#include "scene/sceneRenderState.h"
#include "renderInstance/renderProbeMgr.h"
#include "T3D/lighting/skylight.h"
// GuiMaterialPreview
GuiMaterialPreview::GuiMaterialPreview()
@ -372,6 +374,9 @@ void GuiMaterialPreview::renderWorld(const RectI &updateRect)
FogData savedFogData = gClientSceneGraph->getFogData();
gClientSceneGraph->setFogData( FogData() ); // no fog in preview window
if (Skylight::smSkylightProbe.isValid())
PROBEMGR->submitProbe(Skylight::smSkylightProbe->getProbeInfo());
RenderPassManager* renderPass = gClientSceneGraph->getDefaultRenderPass();
SceneRenderState state
(

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();
}

View file

@ -378,6 +378,7 @@ public:
/// Invokes a cubemap bake action for this probe
/// </summary>
void bake();
ProbeInfo* getProbeInfo() { return &mProbeInfo; }
};
typedef ReflectionProbe::ProbeInfo::ProbeShapeType ReflectProbeType;

View file

@ -59,6 +59,8 @@ extern bool gEditingMission;
extern ColorI gCanvasClearColor;
bool Skylight::smRenderSkylights = true;
SimObjectPtr<Skylight> Skylight::smSkylightProbe = nullptr;
IMPLEMENT_CO_NETOBJECT_V1(Skylight);
ConsoleDocClass(Skylight,
@ -117,6 +119,8 @@ bool Skylight::onAdd()
if (!Parent::onAdd())
return false;
if (isClientObject())
smSkylightProbe = this;
return true;
}

View file

@ -108,6 +108,7 @@ public:
void prepRenderImage(SceneRenderState *state);
void setPreviewMatParameters(SceneRenderState* renderState, BaseMatInstance* mat);
static SimObjectPtr<Skylight> smSkylightProbe;
};
#endif // _Skylight_H_

View file

@ -37,6 +37,8 @@
#include "T3D/assets/ShapeAsset.h"
#include "T3D/assets/ShapeAnimationAsset.h"
#include "renderInstance/renderProbeMgr.h"
#include "T3D/lighting/skylight.h"
#ifdef TORQUE_COLLADA
#include "collision/optimizedPolyList.h"
@ -1409,6 +1411,8 @@ void GuiShapeEdPreview::renderWorld(const RectI &updateRect)
FogData savedFogData = gClientSceneGraph->getFogData();
gClientSceneGraph->setFogData( FogData() ); // no fog in preview window
if (Skylight::smSkylightProbe.isValid())
PROBEMGR->submitProbe(Skylight::smSkylightProbe->getProbeInfo());
SceneRenderState state
(
gClientSceneGraph,

View file

@ -41,7 +41,7 @@
<Setting
name="doubleClickAction">Edit Asset</Setting>
<Setting
name="LastPosExt">0 976 2200 360</Setting>
name="LastPosExt">0 634 1560 360</Setting>
<Setting
name="previewTileSize">1</Setting>
<Setting
@ -245,7 +245,7 @@
<Setting
name="AdvancedWndVisible">1</Setting>
<Setting
name="backgroundColor">0 0 0 100</Setting>
name="backgroundColor">128 128 128 100</Setting>
<Setting
name="gridDimension">40 40</Setting>
<Setting
@ -367,12 +367,10 @@
name="dropType">screenCenter</Setting>
<Setting
name="EditorLayoutMode">Modern</Setting>
<Setting
name="forceLoadDAE">0</Setting>
<Setting
name="forceSidebarToSide">1</Setting>
<Setting
name="orthoFOV">4.60158014</Setting>
name="orthoFOV">1.21430779</Setting>
<Setting
name="orthoShowGrid">1</Setting>
<Setting

View file

@ -41,7 +41,7 @@ $guiContent = new GuiControl() {
canSave = "1";
Visible = "1";
hovertime = "1000";
color = "0 0 0 .39";
color = "0.5 0.5 0.5 .39";
};
new GuiShapeEdPreview(ShapeEdShapeView) {
canSaveDynamicFields = "0";

View file

@ -354,7 +354,7 @@ function ShapeEditorPlugin::initSettings( %this )
EditorSettings.beginGroup( "ShapeEditor", true );
// Display options
EditorSettings.setDefaultValue( "BackgroundColor", "0 0 0 100" );
EditorSettings.setDefaultValue( "BackgroundColor", "128 128 128 100" );
EditorSettings.setDefaultValue( "HighlightMaterial", 1 );
EditorSettings.setDefaultValue( "ShowNodes", 1 );
EditorSettings.setDefaultValue( "ShowBounds", 0 );