Deferred Shading update

-Deferred Shading now use a dynamics pass system
-Forward Shading is now capable of rendering more than three lights
(Multipass)


Former-commit-id: 74ed0b998d72aa9eb3bd2aab938a75985ebb2bf6
This commit is contained in:
Lynix
2013-12-28 10:22:03 +01:00
parent 6568cc7995
commit a332579c80
31 changed files with 2431 additions and 1354 deletions

View File

@@ -0,0 +1,54 @@
// Copyright (C) 2013 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
#pragma once
#ifndef NAZARA_DEFERREDBLOOMPASS_HPP
#define NAZARA_DEFERREDBLOOMPASS_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Graphics/DeferredRenderPass.hpp>
#include <Nazara/Renderer/RenderStates.hpp>
#include <Nazara/Renderer/RenderTexture.hpp>
#include <Nazara/Renderer/ShaderProgram.hpp>
#include <Nazara/Renderer/Texture.hpp>
#include <Nazara/Renderer/TextureSampler.hpp>
class NAZARA_API NzDeferredBloomPass : public NzDeferredRenderPass
{
public:
NzDeferredBloomPass();
virtual ~NzDeferredBloomPass();
unsigned int GetBlurPassCount() const;
float GetBrightLuminance() const;
float GetBrightMiddleGrey() const;
float GetBrightThreshold() const;
NzTexture* GetTexture(unsigned int i) const;
bool Process(const NzScene* scene, unsigned int firstWorkTexture, unsigned secondWorkTexture) const;
bool Resize(const NzVector2ui& dimensions);
void SetBlurPassCount(unsigned int passCount);
void SetBrightLuminance(float luminance);
void SetBrightMiddleGrey(float middleGrey);
void SetBrightThreshold(float threshold);
protected:
NzRenderStates m_bloomStates;
NzRenderTexture m_bloomRTT;
NzShaderProgramRef m_bloomBrightProgram;
NzShaderProgramRef m_bloomFinalProgram;
NzShaderProgramRef m_gaussianBlurProgram;
NzTextureRef m_bloomTextures[2];
NzTextureSampler m_bilinearSampler;
mutable bool m_uniformUpdated;
float m_brightLuminance;
float m_brightMiddleGrey;
float m_brightThreshold;
int m_gaussianBlurProgramFilterLocation;
unsigned int m_blurPassCount;
};
#endif // NAZARA_DEFERREDBLOOMPASS_HPP