18#ifndef HEADER_SHADER_BASED_RENDERER_HPP
19#define HEADER_SHADER_BASED_RENDERER_HPP
23#include "graphics/abstract_renderer.hpp"
24#include "graphics/draw_calls.hpp"
25#include "graphics/lighting_passes.hpp"
26#include "graphics/shadow_matrices.hpp"
27#include "utils/cpp2011.hpp"
31class AbstractGeometryPasses;
58 std::unique_ptr<PostProcessing> m_post_processing;
60 void prepareForwardRenderer();
64 void computeMatrixesAndCameras(scene::ICameraSceneNode *
const camnode,
65 unsigned int width,
unsigned int height);
67 void resetShadowCamNodes(){m_shadow_matrices.resetShadowCamNodes();}
69 void renderSkybox(
const scene::ICameraSceneNode *camera)
const;
72 void prepareDrawCalls(scene::ICameraSceneNode *camnode);
74 void renderSSAO()
const;
76 void renderGlow()
const;
78 void renderScene(irr::scene::ICameraSceneNode *
const camnode,
79 float dt,
bool hasShadows,
bool forceRTT);
80 void renderSceneDeferred(irr::scene::ICameraSceneNode *
const camnode,
81 float dt,
bool hasShadows,
bool forceRTT);
84 void renderPostProcessing(
Camera *
const camera,
bool first_cam);
85 void preloadShaderFiles();
92 void onLoadWorld() OVERRIDE;
93 void onUnloadWorld() OVERRIDE;
95 void resetPostProcessing() OVERRIDE;
96 void giveBoost(
unsigned int cam_index) OVERRIDE;
98 void addSkyBox(
const std::vector<irr::video::IImage*> &texture,
99 const std::vector<irr::video::IImage*> &spherical_harmonics_textures);
100 void removeSkyBox() OVERRIDE;
102 GLuint getRenderTargetTexture(TypeRTT which)
const OVERRIDE;
103 GLuint getDepthStencilTexture()
const OVERRIDE;
105 void setAmbientLight(
const irr::video::SColorf &light,
106 bool force_SH_computation =
true) OVERRIDE;
108 void addSunLight(
const irr::core::vector3df &pos) OVERRIDE;
110 void render(
float dt,
bool is_loading=
false) OVERRIDE;
112 std::unique_ptr<RenderTarget>
createRenderTarget(
const irr::core::dimension2du &dimension,
113 const std::string &name) OVERRIDE;
116 irr::scene::ICameraSceneNode* camera,
119 void setRTT(
RTT* rtts);
121 RTT* getRTTs() {
return m_rtts; }
122 ShadowMatrices* getShadowMatrices() {
return &m_shadow_matrices; }
123 PostProcessing* getPostProcessing() {
return m_post_processing.get(); }
124 void dumpRTT() { m_dump_rtt =
true; }
125 void createPostProcessing() OVERRIDE;
Virtual base class for the renderer.
Definition: abstract_renderer.hpp:60
This is the base class for all cameras.
Definition: camera.hpp:49
Definition: draw_calls.hpp:42
Definition: render_target.hpp:81
Definition: lighting_passes.hpp:43
Handles post processing, eg motion blur.
Definition: post_processing.hpp:42
Definition: render_target.hpp:42
Definition: shader_based_renderer.hpp:49
void uploadLightingData() const
Upload lighting info to the dedicated uniform buffer.
Definition: shader_based_renderer.cpp:78
std::unique_ptr< RenderTarget > createRenderTarget(const irr::core::dimension2du &dimension, const std::string &name) OVERRIDE
Create a RenderTarget (for rendering to a texture)
Definition: shader_based_renderer.cpp:834
Definition: shadow_matrices.hpp:40
Definition: skybox.hpp:38
Definition: spherical_harmonics.hpp:41
Definition: spherical_harmonics.hpp:33