/* QGLView Copyright (C) 2012 Ivan Pelipenko peri4ko@gmail.com This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef RENDERER_DEFERRED_SHADING_H #define RENDERER_DEFERRED_SHADING_H #include "qglview.h" #include class RendererDeferredShading: public GLRendererBase { public: RendererDeferredShading(QGLView * view); virtual ~RendererDeferredShading(); virtual void renderScene(); protected: void init(int width, int height); void resize(int width, int height); void reloadShaders(); void setupShadersTextures(GLObjectBase & object, RenderingParameters & rp); void setupShadersLights(int lights_count) {cplc = lights_count;} void setupDSLights(int pass, const QMatrix4x4 & view_matrix); void setupAmbientLight(const QColor & a, bool first_pass); private: typedef QPair ShaderPair; int cplc, lights_per_pass; double exposure_; GLFramebuffer fbo_g, fbo_out, fbo_hsmall; QGLShaderProgram * shader_fxaa, * shader_ds_0, * shader_ds_1, * shader_hdr, * shader_small; QGLShaderProgram * shader_bloom_0, * shader_bloom_1, * shader_motion_blur, * shader_fbo_add; QGLShaderProgram * shader_shadow, * shader_ssr, * shader_ssr_blur, * shader_ssr_merge; QGLShaderProgram * shader_ssao_blur, * shader_ssao_merge, * shader_dof; GLuint tnoise; QVector shaders; QMatrix4x4 prev_view, prev_proj; QMatrix3x3 nm; QVector4D corner_dirs[4]; QVector hcontent; Light amb_light; QWidget * df; QLabel * label_exp, * label_exp_step; }; #endif // RENDERER_DEFERRED_SHADING_H