Files
NazaraEngine/src/Nazara/Graphics/DeferredForwardPass.cpp
Lynix c096756dab Happy thousandth commit Nazara
Updated copyright year (Yay, 515 file updated)
Regenerated global headers
Fixed some typo
Improved some shaders
-Blah blah blah-

Thank you all for supporting my project !
-Lynix


Former-commit-id: e4e741b318ba4f203da5ffd265bd5e516e7ffd7d
2014-01-12 20:16:21 +01:00

46 lines
1.5 KiB
C++

// Copyright (C) 2014 Jérôme Leclercq
// This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/Graphics/DeferredForwardPass.hpp>
#include <Nazara/Graphics/AbstractBackground.hpp>
#include <Nazara/Graphics/AbstractViewer.hpp>
#include <Nazara/Graphics/DeferredRenderTechnique.hpp>
#include <Nazara/Graphics/ForwardRenderTechnique.hpp>
#include <Nazara/Graphics/Scene.hpp>
#include <Nazara/Renderer/Renderer.hpp>
#include <Nazara/Graphics/Debug.hpp>
NzDeferredForwardPass::NzDeferredForwardPass() = default;
NzDeferredForwardPass::~NzDeferredForwardPass() = default;
void NzDeferredForwardPass::Initialize(NzDeferredRenderTechnique* technique)
{
NzDeferredRenderPass::Initialize(technique);
m_forwardTechnique = technique->GetForwardTechnique();
}
bool NzDeferredForwardPass::Process(const NzScene* scene, unsigned int workTexture, unsigned sceneTexture) const
{
NazaraUnused(workTexture);
m_workRTT->SetColorTarget(sceneTexture);
NzRenderer::SetTarget(m_workRTT);
NzRenderer::SetViewport(NzRecti(0, 0, m_dimensions.x, m_dimensions.y));
NzAbstractBackground* background = scene->GetBackground();
if (background)
background->Draw(scene);
NzAbstractViewer* viewer = scene->GetViewer();
NzRenderer::SetMatrix(nzMatrixType_Projection, viewer->GetProjectionMatrix());
NzRenderer::SetMatrix(nzMatrixType_View, viewer->GetViewMatrix());
m_forwardTechnique->Draw(scene);
return false;
}