Rendering pipeline fixes across the board and base work on refactored editor

This commit is contained in:
2016-01-17 06:29:25 +01:00
parent e34856468a
commit 4786986abd
27 changed files with 1134 additions and 1002 deletions
+3 -12
View File
@@ -15,15 +15,6 @@ void Renderer::Initialize()
m_UnitSphere = ResourceManager::Load<Model>("Models/Core/UnitSphere.obj");
m_ImGuiRenderPass = new ImGuiRenderPass(this, m_EventBroker);
// Create default camera
m_DefaultCamera = new ::Camera((float)m_Resolution.Width / m_Resolution.Height, glm::radians(45.f), 0.01f, 5000.f);
m_DefaultCamera->SetPosition(glm::vec3(0, 0, 10));
if (m_Camera == nullptr) {
m_Camera = m_DefaultCamera;
}
}
void Renderer::InitializeWindow()
@@ -92,14 +83,14 @@ void Renderer::Update(double dt)
void Renderer::Draw(RenderFrame& frame)
{
glClearColor(255.f / 255, 163.f / 255, 176.f / 255, 0.f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_PickingPass->ClearPicking();
for (auto scene : frame.RenderScenes){
if (scene->ClearDepth) {
glClear(GL_DEPTH_BUFFER_BIT);
}
m_Camera = scene->Camera; // remove renderer camera when Editor uses the render scene cameras.
FillDepth(*scene);
m_PickingPass->Draw(*scene);
m_LightCullingPass->GenerateNewFrustum(*scene);