SuperTuxKart
Loading...
Searching...
No Matches
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
27class FrameBuffer;
28class RTT;
29
30namespace irr
31{
32 namespace video { class IVideoDriver; class ITexture; }
33 namespace scene { class ICameraSceneNode; }
34}
35
36using namespace irr;
37
42{
43private:
47 std::vector<float> m_boost_time;
48
49 video::ITexture* m_areamap;
50
51public:
53
54 void reset();
55 void update(float dt);
56
57 void renderBloom(GLuint in);
58 void renderSSAO(const FrameBuffer& linear_depth_framebuffer,
59 const FrameBuffer& ssao_framebuffer,
60 GLuint depth_stencil_texture);
62 void renderGaussian3Blur(const FrameBuffer &in_fbo, const FrameBuffer &auxiliary) const;
63
64 void renderGaussian6Blur(const FrameBuffer &in_fbo, const FrameBuffer &auxiliary,
65 float sigmaV, float sigmaH) const;
66 void renderHorizontalBlur(const FrameBuffer &in_fbo, const FrameBuffer &auxiliary) const;
67
68 void renderGaussian17TapBlur(const FrameBuffer &in_fbo,
69 const FrameBuffer &auxiliary,
70 const FrameBuffer &linear_depth) const;
71
73 void renderPassThrough(unsigned tex, unsigned width, unsigned height) const;
74 void renderTextureLayer(unsigned tex, unsigned layer) const;
75
76 void renderDoF(const FrameBuffer &framebuffer, GLuint color_texture, GLuint depth_stencil_texture);
77 void renderGodRays(scene::ICameraSceneNode * const camnode,
78 const FrameBuffer &in_fbo,
79 const FrameBuffer &tmp_fbo,
80 const FrameBuffer &quarter1_fbo,
81 const FrameBuffer &quarter2_fbo);
82
83 void applyMLAA(const FrameBuffer& mlaa_tmp_framebuffer,
84 const FrameBuffer& mlaa_blend_framebuffer,
85 const FrameBuffer& mlaa_colors_framebuffer);
86
87 void renderMotionBlur(const FrameBuffer &in_fbo,
88 FrameBuffer &out_fbo,
89 GLuint depth_stencil_texture);
90 void renderGlow(const FrameBuffer& quarter_framebuffer) const;
91 void renderLightning(core::vector3df intensity);
92
94 void giveBoost(unsigned int cam_index);
95
97 FrameBuffer *render(scene::ICameraSceneNode * const camnode, bool isRace,
98 RTT *rtts);
99}; // class PostProcessing
100
101#endif // HEADER_POST_PROCESSING_HPP
Definition: frame_buffer.hpp:33
Handles post processing, eg motion blur.
Definition: post_processing.hpp:42
void update(float dt)
Updates the boost times for all cameras, called once per frame.
Definition: post_processing.cpp:796
void reset()
Initialises post processing at the (re-)start of a race.
Definition: post_processing.cpp:773
void giveBoost(unsigned int cam_index)
Use motion blur for a short time.
Definition: post_processing.cpp:784
void renderGaussian3Blur(const FrameBuffer &in_fbo, const FrameBuffer &auxiliary) const
Blur the in texture.
Definition: post_processing.cpp:839
void renderPassThrough(unsigned tex, unsigned width, unsigned height) const
Render tex.
Definition: post_processing.cpp:998
FrameBuffer * render(scene::ICameraSceneNode *const camnode, bool isRace, RTT *rtts)
Render the post-processed scene.
Definition: post_processing.cpp:1185
std::vector< float > m_boost_time
Boost time, how long the boost should be displayed.
Definition: post_processing.hpp:47
Definition: rtts.hpp:101