SuperTuxKart
lighting_passes.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2015 SuperTuxKart-Team
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 3
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 
18 #ifndef HEADER_LIGHTING_PASSES_HPP
19 #define HEADER_LIGHTING_PASSES_HPP
20 
21 #include "graphics/gl_headers.hpp"
22 #include <vector3d.h>
23 
24 namespace irr
25 {
26  namespace scene
27  {
28  class ICameraSceneNode;
29  }
30  namespace video
31  {
32  class SColorf;
33  }
34 }
35 
36 class FrameBuffer;
37 class PostProcessing;
38 class ShadowMatrices;
39 
40 using namespace irr;
41 
43 {
44 private:
45  unsigned m_point_light_count;
46 
47  void renderEnvMap(GLuint normal_depth_texture,
48  GLuint depth_stencil_texture,
49  GLuint specular_probe,
50  GLuint albedo_buffer,
51  GLuint ssao_buffer,
52  GLuint diffuse_color_texture);
53 
55  void renderSunlight(const core::vector3df &direction,
56  const video::SColorf &col,
57  GLuint normal_depth_texture,
58  GLuint depth_stencil_texture);
59 
60 public:
61  LightingPasses(): m_point_light_count(0){}
62 
63  void updateLightsInfo(irr::scene::ICameraSceneNode * const camnode,
64  float dt);
65  void renderLights( bool has_shadow,
66  GLuint normal_depth_texture,
67  GLuint depth_stencil_texture,
68  GLuint albedo_texture,
69  const FrameBuffer* shadow_framebuffer,
70  GLuint ssao_texture,
71  GLuint diffuse_color_texture,
72  GLuint specular_probe,
73  const core::vector3df* shadow_box_extents);
74  void renderLightsScatter(GLuint depth_stencil_texture,
75  const FrameBuffer& half1_framebuffer,
76  const FrameBuffer& half2_framebuffer,
77  const PostProcessing* post_processing);
78 };
79 
80 #endif //HEADER_LIGHTING_PASSES_HPP
Definition: frame_buffer.hpp:33
Definition: lighting_passes.hpp:43
Handles post processing, eg motion blur.
Definition: post_processing.hpp:42
Definition: shadow_matrices.hpp:40