Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
DeferredBloomPass.hpp
1 // Copyright (C) 2017 Jérôme Leclercq
2 // This file is part of the "Nazara Engine - Graphics module"
3 // For conditions of distribution and use, see copyright notice in Config.hpp
4 
5 #pragma once
6 
7 #ifndef NAZARA_DEFERREDBLOOMPASS_HPP
8 #define NAZARA_DEFERREDBLOOMPASS_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Graphics/DeferredRenderPass.hpp>
12 #include <Nazara/Renderer/RenderStates.hpp>
13 #include <Nazara/Renderer/RenderTexture.hpp>
14 #include <Nazara/Renderer/Shader.hpp>
15 #include <Nazara/Renderer/Texture.hpp>
16 #include <Nazara/Renderer/TextureSampler.hpp>
17 
18 namespace Nz
19 {
20  class NAZARA_GRAPHICS_API DeferredBloomPass : public DeferredRenderPass
21  {
22  public:
24  virtual ~DeferredBloomPass();
25 
26  unsigned int GetBlurPassCount() const;
27  float GetBrightLuminance() const;
28  float GetBrightMiddleGrey() const;
29  float GetBrightThreshold() const;
30  Texture* GetTexture(unsigned int i) const;
31 
32  bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
33  bool Resize(const Vector2ui& dimensions) override;
34 
35  void SetBlurPassCount(unsigned int passCount);
36  void SetBrightLuminance(float luminance);
37  void SetBrightMiddleGrey(float middleGrey);
38  void SetBrightThreshold(float threshold);
39 
40  protected:
41  RenderStates m_bloomStates;
42  RenderTexture m_bloomRTT;
43  ShaderRef m_bloomBrightShader;
44  ShaderRef m_bloomFinalShader;
45  ShaderRef m_gaussianBlurShader;
46  TextureRef m_bloomTextures[2];
47  TextureSampler m_bilinearSampler;
48  mutable bool m_uniformUpdated;
49  float m_brightLuminance;
50  float m_brightMiddleGrey;
51  float m_brightThreshold;
52  int m_gaussianBlurShaderFilterLocation;
53  unsigned int m_blurPassCount;
54  };
55 }
56 
57 #endif // NAZARA_DEFERREDBLOOMPASS_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the pass for rendering in deferred rendering.
Definition: DeferredRenderPass.hpp:22
Graphics class that represents the pass for bloom in deferred rendering.
Definition: DeferredBloomPass.hpp:20