KiCad PCB EDA Suite
cpostshader_ssao.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2015-2016 Mario Luzeiro <mrluzeiro@ua.pt>
5  * Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
30 #ifndef CPOSTSHADER_SSAO_H
31 #define CPOSTSHADER_SSAO_H
32 
33 
34 #include "cpostshader.h"
35 
36 
38 {
39 public:
40  explicit CPOSTSHADER_SSAO( const CCAMERA &aCamera );
41  //~CPOSTSHADER_SSAO();
42 
43  // Imported from CPOSTSHADER
44  SFVEC3F Shade(const SFVEC2I &aShaderPos ) const override;
45  SFVEC3F ApplyShadeColor( const SFVEC2I &aShaderPos, const SFVEC3F &aInputColor, const SFVEC3F &aShadeColor ) const override;
46 
47 private:
48  SFVEC3F posFromDepth( const SFVEC2F &coord ) const;
49 
50  float ec_depth( const SFVEC2F &tc ) const;
51 
52  float aoFF( const SFVEC2I &aShaderPos,
53  const SFVEC3F &ddiff,
54  const SFVEC3F &cnorm,
55  int c1,
56  int c2 ) const;
57 
58  float giFF( const SFVEC2I &aShaderPos,
59  const SFVEC3F &ddiff,
60  const SFVEC3F &cnorm,
61  int c1,
62  int c2 ) const;
63 
71  SFVEC3F giColorCurve( const SFVEC3F &aColor ) const;
72 };
73 
74 
75 #endif // CPOSTSHADER_SSAO_H
SFVEC3F ApplyShadeColor(const SFVEC2I &aShaderPos, const SFVEC3F &aInputColor, const SFVEC3F &aShadeColor) const override
ApplyShadeColor - apply the final color process using a previous stage color.
SFVEC3F Shade(const SFVEC2I &aShaderPos) const override
Class CCAMERA is a virtual class used to derive CCAMERA objects from.
Definition: ccamera.h:80
float ec_depth(const SFVEC2F &tc) const
glm::ivec2 SFVEC2I
Definition: xv3d_types.h:42
a base class to create post shaders
glm::vec2 SFVEC2F
Definition: xv3d_types.h:45
float aoFF(const SFVEC2I &aShaderPos, const SFVEC3F &ddiff, const SFVEC3F &cnorm, int c1, int c2) const
CPOSTSHADER_SSAO(const CCAMERA &aCamera)
glm::vec3 SFVEC3F
Definition: xv3d_types.h:47
float giFF(const SFVEC2I &aShaderPos, const SFVEC3F &ddiff, const SFVEC3F &cnorm, int c1, int c2) const
SFVEC3F posFromDepth(const SFVEC2F &coord) const
SFVEC3F giColorCurve(const SFVEC3F &aColor) const
giColorCurve - Apply a curve transformation to the original color it will atenuate the bright colors ...