Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added data/Animations/RoboATT/SKIN_ROBOT.env
Binary file not shown.
Binary file added data/Meshes/Road/Road.max
Binary file not shown.
Binary file modified editor.exe
Binary file not shown.
122 changes: 80 additions & 42 deletions imgui.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Window][Game]
Pos=0,0
Size=2560,1369
Size=2194,1171
Collapsed=0

[Window][Debug##Default]
Expand All @@ -10,73 +10,73 @@ Collapsed=0

[Window][ Platform]
Pos=0,22
Size=290,149
Size=290,127
Collapsed=0
DockId=0x00000005,2

[Window][ Shaders]
Pos=0,22
Size=290,149
Size=290,127
Collapsed=0
DockId=0x00000005,1

[Window][ FPS]
Pos=0,22
Size=290,149
Size=290,127
Collapsed=0
DockId=0x00000005,0

[Window][ Resources]
Pos=290,1108
Size=1980,261
Pos=290,910
Size=1614,261
Collapsed=0
DockId=0x0000000E,1

[Window][###Scene]
Pos=0,171
Size=290,936
Pos=0,149
Size=290,798
Collapsed=0
DockId=0x00000007,0

[Window][###Prefab]
Pos=0,171
Size=290,936
Pos=0,149
Size=290,798
Collapsed=0
DockId=0x00000007,1

[Window][ Inspector]
Pos=2270,612
Size=290,500
Pos=1904,525
Size=290,427
Collapsed=0
DockId=0x0000000C,0

[Window][ Editor]
Pos=2270,22
Size=290,590
Pos=1904,22
Size=290,503
Collapsed=0
DockId=0x0000000B,3

[Window][ Renderer]
Pos=2270,22
Size=290,590
Pos=1904,22
Size=290,503
Collapsed=0
DockId=0x0000000B,1

[Window][ Physics]
Pos=2270,22
Size=290,590
Pos=1904,22
Size=290,503
Collapsed=0
DockId=0x0000000B,2

[Window][ Engine]
Pos=2270,22
Size=290,590
Pos=1904,22
Size=290,503
Collapsed=0
DockId=0x0000000B,0

[Window][### Game]
Pos=1281,44
Size=989,1064
Pos=1277,44
Size=627,866
Collapsed=0
DockId=0x00000010,0

Expand All @@ -87,38 +87,38 @@ Collapsed=0
DockId=0x00000008,1

[Window][ Statistics]
Pos=2270,612
Size=290,500
Pos=1904,525
Size=290,427
Collapsed=0
DockId=0x0000000C,1

[Window][ Time]
Pos=0,1107
Size=290,262
Pos=0,947
Size=290,224
Collapsed=0
DockId=0x00000008,0

[Window][ Undo/Redo]
Pos=2270,1112
Size=290,257
Pos=1904,952
Size=290,219
Collapsed=0
DockId=0x0000000A,0

[Window][Main Toolbar]
Pos=290,22
Size=1980,22
Size=1614,22
Collapsed=0
DockId=0x00000011,0

[Window][ Console]
Pos=290,1108
Size=1980,261
Pos=290,910
Size=1614,261
Collapsed=0
DockId=0x0000000E,0

[Window][### Editor]
Pos=290,44
Size=991,1064
Size=987,866
Collapsed=0
DockId=0x0000000F,0

Expand All @@ -138,20 +138,20 @@ Size=2560,1369
Collapsed=0

[Window][ Game]
Pos=2270,22
Size=290,590
Pos=1904,22
Size=290,503
Collapsed=0
DockId=0x0000000B,5

[Window][ Input]
Pos=0,1107
Size=290,262
Pos=0,947
Size=290,224
Collapsed=0
DockId=0x00000008,1

[Window][ Audio]
Pos=2270,22
Size=290,590
Pos=1904,22
Size=290,503
Collapsed=0
DockId=0x0000000B,4

Expand Down Expand Up @@ -501,8 +501,46 @@ Column 0 Width=96
Column 1 Width=96
Column 2 Weight=1.0000

[Table][0x47250C01,11]
RefScale=14
Column 0 Weight=1.0000 Sort=0v
Column 1 Width=0
Column 2 Width=0
Column 3 Width=0
Column 4 Width=0
Column 5 Width=0
Column 6 Width=0
Column 7 Width=0
Column 8 Width=0
Column 9 Weight=1.0000
Column 10 Width=0

[Table][0xAC8E4A04,3]
RefScale=14
Column 0 Width=96
Column 1 Width=96
Column 2 Weight=1.0000

[Table][0x407F83B7,3]
RefScale=14
Column 0 Width=96
Column 1 Width=96
Column 2 Weight=1.0000

[Table][0x76B37378,3]
RefScale=14
Column 0 Width=96
Column 1 Width=96
Column 2 Weight=1.0000

[Table][0xA67089BC,3]
RefScale=14
Column 0 Width=96
Column 1 Width=96
Column 2 Weight=1.0000

[Docking][Data]
DockSpace ID=0x245145B4 Window=0x6D36DD32 Pos=0,22 Size=2560,1347 Split=X
DockSpace ID=0x245145B4 Window=0x6D36DD32 Pos=0,22 Size=2194,1149 Split=X
DockNode ID=0x00000003 Parent=0x245145B4 SizeRef=290,1347 Split=Y Selected=0x568B9410
DockNode ID=0x00000005 Parent=0x00000003 SizeRef=290,149 Selected=0x9F98B8AF
DockNode ID=0x00000006 Parent=0x00000003 SizeRef=290,1198 Split=Y Selected=0x568B9410
Expand All @@ -512,9 +550,9 @@ DockSpace ID=0x245145B4 Window=0x6D36DD32 Pos=0,22 Size=2560,1347 Spli
DockNode ID=0x00000001 Parent=0x00000004 SizeRef=2270,1347 Split=Y Selected=0xA601DFD0
DockNode ID=0x0000000D Parent=0x00000001 SizeRef=1980,1086 Split=Y Selected=0xA601DFD0
DockNode ID=0x00000011 Parent=0x0000000D SizeRef=999,22 Selected=0x37EAA1FD
DockNode ID=0x00000012 Parent=0x0000000D SizeRef=999,1064 Split=X Selected=0xA601DFD0
DockNode ID=0x0000000F Parent=0x00000012 SizeRef=991,1064 CentralNode=1 Selected=0xA601DFD0
DockNode ID=0x00000010 Parent=0x00000012 SizeRef=989,1064 Selected=0x260566DD
DockNode ID=0x00000012 Parent=0x0000000D SizeRef=999,866 Split=X Selected=0xA601DFD0
DockNode ID=0x0000000F Parent=0x00000012 SizeRef=713,1064 CentralNode=1 Selected=0xA601DFD0
DockNode ID=0x00000010 Parent=0x00000012 SizeRef=627,1064 Selected=0x260566DD
DockNode ID=0x0000000E Parent=0x00000001 SizeRef=1980,261 Selected=0x04DD4A87
DockNode ID=0x00000002 Parent=0x00000004 SizeRef=290,1347 Split=Y Selected=0xE59A54D7
DockNode ID=0x00000009 Parent=0x00000002 SizeRef=290,1090 Split=Y Selected=0xE59A54D7
Expand Down
18 changes: 18 additions & 0 deletions src/editor/Editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "core/IResource.h"
#include "core/IGameObject.h"
#include "core/File/File.h"
#include "core/Time/Time.h"
#include "core/Time/Timer.h"
#include "core/UndoRedo/UndoRedo.h"
#include "renderer/IUIRenderer.h"
Expand Down Expand Up @@ -314,6 +315,23 @@ namespace vg::editor
else if (input->IsKeyJustPressed(Key::Y))
Kernel::getUndoRedoManager()->Redo();
}

// Update editor cameras *before* the renderer builds and renders the FrameGraph.
// The editor GUI is drawn from ImGuiPass::Render, so updating the views from ImGuiView::DrawGUI
// would change the camera (and its settings) while the render passes are being recorded.
{
VG_PROFILE_CPU("EditorCameras");

const float dt = getEngine()->GetTime().m_realDeltaTime;

for (uint i = 0; i < m_imGuiWindows.size(); ++i)
{
auto * imGuiView = dynamic_cast<ImGuiView *>(m_imGuiWindows[i]);

if (nullptr != imGuiView && imGuiView->isVisible() && gfx::ViewportTarget::Editor == imGuiView->getViewportTarget())
imGuiView->updateEditorCamera(dt);
}
}
}

//--------------------------------------------------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions src/editor/ImGui/Window/View/ImGuiView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,8 @@ namespace vg::editor
{
float padding = 1;

// TODO : update editor camera *BEFORE* render?
if (m_target == gfx::ViewportTarget::Editor)
updateEditorCamera(getEngine()->GetTime().m_realDeltaTime);
// Editor cameras are updated by Editor::RunOneFrame, before the renderer builds the FrameGraph:
// 'DrawGUI' is called from ImGuiPass::Render, i.e. while the render passes are being recorded.

// Update
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ namespace vg::renderer
private:
gfx::RootSignatureHandle m_computeDeferredLightingRootSignature;
gfx::ComputeShaderKey m_computeDeferredLightingShaderKey;
bool m_useScreenSpaceAmbient = false; // Set during Setup so that Render uses the resources actually declared in the FrameGraph
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,13 @@ namespace vg::renderer
const View * view = static_cast<const View *>(_renderPassContext.getView());
readDepthStencil(view->getShadowMaps());

if (ScreenSpaceAmbient::None != view->GetScreenSpaceAmbient())
m_useScreenSpaceAmbient = ScreenSpaceAmbient::None != view->GetScreenSpaceAmbient();
if (m_useScreenSpaceAmbient)
{
const auto screenSpaceAmbientID = _renderPassContext.getFrameGraphID("ScreenSpaceAmbient");
readRWTexture(screenSpaceAmbientID);
}

const MSAA msaa = options->GetMSAA();
if (MSAA::None != msaa)
{
Expand Down Expand Up @@ -171,7 +172,7 @@ namespace vg::renderer
deferredLighting.setStencil(stencil);
deferredLighting.setRWBufferOut(dstTex->getRWTextureHandle());

if (ScreenSpaceAmbient::None != view->GetScreenSpaceAmbient())
if (m_useScreenSpaceAmbient)
{
const auto screenSpaceAmbientID = _renderPassContext.getFrameGraphID("ScreenSpaceAmbient");
auto screenSpaceAmbient= getRWTexture(screenSpaceAmbientID)->getTextureHandle();
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,10 @@ namespace vg::renderer
{
View * view = (View *)visibleViews[v];

// Camera settings can be updated by the editor GUI while the FrameGraph is rendered,
// so freeze the values used to build the graph before registering the passes
view->snapshotRenderSettings();

gfx::RenderPassContext rc;
rc.setView(view);
rc.setWorld(view->getWorld());
Expand Down
Loading
Loading