Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
DeferredGeometryPass.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_DEFERREDGEOMETRYPASS_HPP
8 #define NAZARA_DEFERREDGEOMETRYPASS_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Graphics/DeferredRenderPass.hpp>
12 #include <Nazara/Renderer/RenderStates.hpp>
13 #include <Nazara/Renderer/Shader.hpp>
14 #include <unordered_map>
15 
16 namespace Nz
17 {
18  class NAZARA_GRAPHICS_API DeferredGeometryPass : public DeferredRenderPass
19  {
20  public:
22  virtual ~DeferredGeometryPass();
23 
24  bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
25  bool Resize(const Vector2ui& dimensions) override;
26 
27  protected:
28  struct ShaderUniforms;
29 
30  const ShaderUniforms* GetShaderUniforms(const Shader* shader) const;
31  void OnShaderInvalidated(const Shader* shader) const;
32 
33  struct ShaderUniforms
34  {
35  NazaraSlot(Shader, OnShaderUniformInvalidated, shaderUniformInvalidatedSlot);
36  NazaraSlot(Shader, OnShaderRelease, shaderReleaseSlot);
37 
38  int eyePosition;
39  int sceneAmbient;
40  int textureOverlay;
41  };
42 
43  mutable std::unordered_map<const Shader*, ShaderUniforms> m_shaderUniforms;
44  RenderStates m_clearStates;
45  ShaderRef m_clearShader;
46  };
47 }
48 
49 #endif // NAZARA_DEFERREDGEOMETRYPASS_HPP
Graphics class that represents the pass for geometries in deferred rendering.
Definition: DeferredGeometryPass.hpp:18
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the pass for rendering in deferred rendering.
Definition: DeferredRenderPass.hpp:22