GPU culling work

This commit is contained in:
2025-03-17 14:46:50 -04:00
parent f482c37d17
commit 3a55398364
91 changed files with 1083 additions and 1749 deletions

View File

@@ -5,15 +5,14 @@
#include "engine/gameobjects/components/ModelComponent.hpp"
#include "engine/assets/model/Model.hpp"
#include "engine/gameobjects/components/drawers.hpp"
#include "gui/safe_include.hpp"
namespace fgl::engine
namespace fgl::engine::components
{
void ModelComponent::drawImGui()
{
drawComponentTransform( m_transform );
// drawComponentTransform( m_transform );
// TODO: If the model is not set then we should be able to set it to one from the file selection
if ( this->m_model == nullptr )

View File

@@ -16,7 +16,6 @@
#include "engine/debug/DEBUG_NAMES.hpp"
#include "engine/descriptors/DescriptorPool.hpp"
#include "engine/rendering/Renderer.hpp"
#include "engine/tree/octtree/OctTreeNode.hpp"
#include "gui_window_names.hpp"
#include "safe_include.hpp"

View File

@@ -14,6 +14,7 @@ namespace fgl::engine::gui
ImGui::InputText( "Name", &name_input_temp );
if ( game_object.getName() != name_input_temp ) game_object.setName( name_input_temp );
/*
auto& transform { game_object.getTransform() };
// Transform - Position
@@ -29,6 +30,7 @@ namespace fgl::engine::gui
}
dragFloat3( "Scale", transform.scale );
*/
}
static GameObjectComponentPtr SELECTED_COMPONENT { nullptr };

View File

@@ -7,7 +7,6 @@
#include "engine/flags.hpp"
#include "engine/math/literals/size.hpp"
#include "engine/memory/buffers/Buffer.hpp"
#include "engine/tree/octtree/OctTreeNode.hpp"
#include "safe_include.hpp"
namespace fgl::engine::gui
@@ -128,8 +127,6 @@ namespace fgl::engine::gui
debug::timing::render();
}
imGuiOctTreeSettings( info );
if ( ImGui::Button( "Reload shaders" ) )
{
flags::triggerShaderReload();

View File

@@ -10,9 +10,7 @@
#include "engine/camera/Camera.hpp"
#include "engine/filesystem/scanner/FileScanner.hpp"
#include "engine/filesystem/types.hpp"
#include "engine/gameobjects/components/ModelComponent.hpp"
#include "engine/rendering/PresentSwapChain.hpp"
#include "engine/tree/octtree/OctTreeNode.hpp"
#include "safe_include.hpp"
namespace fgl::engine::gui
@@ -47,12 +45,16 @@ namespace fgl::engine::gui
GameObject obj { GameObject::createGameObject() };
std::shared_ptr< Model > model {
Model::createModel( data->m_path, info.model_vertex_buffer, info.model_index_buffer )
Model::
createModel( data->m_path, info.model_vertex_buffer, info.model_index_buffer )
};
obj.addFlag( IsEntity | IsVisible );
auto component { std::make_unique< ModelComponent >( std::move( model ) ) };
info.context.models()
.loadModel( data->m_path, info.model_vertex_buffer, info.model_index_buffer );
auto component { std::make_unique< components::ModelComponent >( std::move( model ) ) };
obj.addComponent( std::move( component ) );

View File

@@ -9,7 +9,6 @@
#include "engine/debug/timing/FlameGraph.hpp"
#include "engine/gameobjects/components/CameraComponent.hpp"
#include "gui/EditorGuiContext.hpp"
#include "gui/core.hpp"
int main()
{
@@ -63,12 +62,22 @@ int main()
editor_camera->setFOV( glm::radians( 90.0f ) );
// Create a default world to assign to the engine before we load or create a new one.
World world {};
constexpr bool playing { false };
//! Will be true until the window says it wants to close.
while ( engine_ctx.good() )
{
debug::timing::reset();
engine_ctx.tickDeltaTime();
engine_ctx.setWorld( world );
if ( playing ) world = engine_ctx.tickSimulation();
engine_ctx.handleTransfers();
// Process input