SuperTuxKart
post_processing.hpp
1 // SuperTuxKart - a fun racing game with go-kart
2 // Copyright (C) 2011-2015 the 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_POST_PROCESSING_HPP
19 #define HEADER_POST_PROCESSING_HPP
20 
21 #include "graphics/gl_headers.hpp"
22 
23 #include <S3DVertex.h>
24 #include <matrix4.h>
25 #include <vector>
26 
27 class FrameBuffer;
28 class RTT;
29 class STKTexture;
30 
31 namespace irr
32 {
33  namespace video { class IVideoDriver; }
34  namespace scene { class ICameraSceneNode; }
35 }
36 
37 using namespace irr;
38 
43 {
44 private:
48  std::vector<float> m_boost_time;
49 
50  STKTexture* m_areamap;
51 
52 public:
54 
55  void reset();
56  void update(float dt);
57 
58  void renderBloom(GLuint in);
59  void renderSSAO(const FrameBuffer& linear_depth_framebuffer,
60  const FrameBuffer& ssao_framebuffer,
61  GLuint depth_stencil_texture);
63  void renderGaussian3Blur(const FrameBuffer &in_fbo, const FrameBuffer &auxiliary) const;
64 
65  void renderGaussian6Blur(const FrameBuffer &in_fbo, const FrameBuffer &auxiliary,
66  float sigmaV, float sigmaH) const;
67  void renderHorizontalBlur(const FrameBuffer &in_fbo, const FrameBuffer &auxiliary) const;
68 
69  void renderGaussian17TapBlur(const FrameBuffer &in_fbo,
70  const FrameBuffer &auxiliary,
71  const FrameBuffer &linear_depth) const;
72 
74  void renderPassThrough(unsigned tex, unsigned width, unsigned height) const;
75  void renderTextureLayer(unsigned tex, unsigned layer) const;
76 
77  void renderDoF(const FrameBuffer &framebuffer, GLuint color_texture, GLuint depth_stencil_texture);
78  void renderGodRays(scene::ICameraSceneNode * const camnode,
79  const FrameBuffer &in_fbo,
80  const FrameBuffer &tmp_fbo,
81  const FrameBuffer &quarter1_fbo,
82  const FrameBuffer &quarter2_fbo);
83 
84  void applyMLAA(const FrameBuffer& mlaa_tmp_framebuffer,
85  const FrameBuffer& mlaa_blend_framebuffer,
86  const FrameBuffer& mlaa_colors_framebuffer);
87 
88  void renderMotionBlur(const FrameBuffer &in_fbo,
89  FrameBuffer &out_fbo,
90  GLuint depth_stencil_texture);
91  void renderGlow(const FrameBuffer& quarter_framebuffer) const;
92  void renderLightning(core::vector3df intensity);
93 
95  void giveBoost(unsigned int cam_index);
96 
98  FrameBuffer *render(scene::ICameraSceneNode * const camnode, bool isRace,
99  RTT *rtts);
100 }; // class PostProcessing
101 
102 #endif // HEADER_POST_PROCESSING_HPP
Definition: frame_buffer.hpp:32
Definition: rtts.hpp:100
Handles post processing, eg motion blur.
Definition: post_processing.hpp:42
Definition: stk_texture.hpp:31
std::vector< float > m_boost_time
Boost time, how long the boost should be displayed.
Definition: post_processing.hpp:48