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

View file

@ -31,6 +31,8 @@
#include "math/mathTypes.h" #include "math/mathTypes.h"
#include "gfx/gfxTransformSaver.h" #include "gfx/gfxTransformSaver.h"
#include "console/engineAPI.h" #include "console/engineAPI.h"
#include "renderInstance/renderProbeMgr.h"
#include "T3D/lighting/skylight.h"
IMPLEMENT_CONOBJECT( GuiObjectView ); IMPLEMENT_CONOBJECT( GuiObjectView );
@ -541,6 +543,12 @@ void GuiObjectView::renderWorld( const RectI& updateRect )
// Render primary model. // 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(mModelInstance)
{ {
if( mRunThread ) if( mRunThread )
@ -567,6 +575,7 @@ void GuiObjectView::renderWorld( const RectI& updateRect )
renderPass->renderPass( &state ); renderPass->renderPass( &state );
gClientSceneGraph->setFogData(savedFogData); // restore fog setting
// Make sure to remove our fake sun. // Make sure to remove our fake sun.
LIGHTMGR->unregisterAllLights(); LIGHTMGR->unregisterAllLights();
} }

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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