Commit 1ff107d9 authored by Johannes Braun's avatar Johannes Braun
Browse files

Some more moving around of members and commands.

parent dd667986
......@@ -19,10 +19,6 @@ namespace glare
onStart(*m_arguments);
glare::core::state::graph_root->addComponent(core::state::gbuffer->getSkybox());
gl::setEnabled(gl::EnableParameter::eMultisample, true);
m_texture_renderer = core::DefaultTextureRenderers::makeSimpleRenderer();
glare::core::state::window->loop([&](double delta)
{
......@@ -58,13 +54,12 @@ namespace glare
if (glare::core::state::graph_root)
glare::core::state::graph_root->draw();
onDraw();
glare::core::state::gbuffer->deactivate();
glare::core::state::gbuffer->draw();
}
break;
case RenderMode::ePathtrace:
{
m_texture_renderer->draw(m_pathtracer->render(core::state::window->getWidth(), core::state::window->getHeight()));
m_pathtracer->renderToScreen(core::state::window->getWidth(), core::state::window->getHeight());
}
break;
}
......
......@@ -66,7 +66,6 @@ namespace glare
std::unique_ptr<Arguments> m_arguments;
std::unique_ptr<raytrace::Pathtracer> m_pathtracer;
std::shared_ptr<core::TextureRenderer> m_texture_renderer;
};
}
}
......
......@@ -134,6 +134,7 @@ namespace glare
void GBuffer::draw() const
{
deactivate();
gl::setEnabled(gl::EnableParameter::eDepthTest, false);
m_texture_renderer->shader().use();
......
......@@ -77,7 +77,9 @@ namespace glare
break;
}
}
});
});
gl::setEnabled(gl::EnableParameter::eMultisample, true);
ImGui::glfw3::init(core::state::window->glfw(), false);
}
......
......@@ -194,6 +194,12 @@ namespace glare
return *m_render_target;
}
void Pathtracer::renderToScreen(uint32_t width, uint32_t height)
{
static const std::shared_ptr<core::TextureRenderer> texture_renderer = core::DefaultTextureRenderers::makeSimpleRenderer();
texture_renderer->draw(render(width, height));
}
void Pathtracer::saveRender(fs::path target) const
{
core::textures::saveTexture(target, *m_render_target);
......
......@@ -44,6 +44,7 @@ namespace glare
void loadSettings(const fs::path &xml_file);
const core::TextureRGBA_32F &render(uint32_t width, uint32_t height);
void renderToScreen(uint32_t width, uint32_t height);
void saveRender(fs::path target) const;
//template<typename DataStruct>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment