Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
DeferredPhongLightingPass.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_DEFERREDPHONGLIGHTINGPASS_HPP
8 #define NAZARA_DEFERREDPHONGLIGHTINGPASS_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Graphics/DeferredRenderPass.hpp>
12 #include <Nazara/Graphics/Light.hpp>
13 #include <Nazara/Renderer/Shader.hpp>
14 #include <Nazara/Renderer/TextureSampler.hpp>
15 #include <Nazara/Utility/Mesh.hpp>
16 
17 namespace Nz
18 {
19  class StaticMesh;
20 
21  class NAZARA_GRAPHICS_API DeferredPhongLightingPass : public DeferredRenderPass
22  {
23  public:
25  virtual ~DeferredPhongLightingPass();
26 
27  void EnableLightMeshesDrawing(bool enable);
28 
29  bool IsLightMeshesDrawingEnabled() const;
30 
31  bool Process(const SceneData& sceneData, unsigned int firstWorkTexture, unsigned int secondWorkTexture) const override;
32 
33  protected:
34  LightUniforms m_directionalLightUniforms;
35  LightUniforms m_pointSpotLightUniforms;
36  MeshRef m_cone;
37  MeshRef m_sphere;
38  ShaderRef m_directionalLightShader;
39  ShaderRef m_pointSpotLightShader;
40  TextureSampler m_pointSampler;
41  StaticMesh* m_coneMesh;
42  StaticMesh* m_sphereMesh;
43  bool m_lightMeshesDrawing;
44  int m_directionalLightShaderEyePositionLocation;
45  int m_directionalLightShaderSceneAmbientLocation;
46  int m_pointSpotLightShaderDiscardLocation;
47  int m_pointSpotLightShaderEyePositionLocation;
48  int m_pointSpotLightShaderSceneAmbientLocation;
49  };
50 }
51 
52 #endif // NAZARA_DEFERREDPHONGLIGHTINGPASS_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 phong lighting in deferred rendering. ...
Definition: DeferredPhongLightingPass.hpp:21