Image Component Library (ICL)
ShaderUtil.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLGeom/src/ICLGeom/ShaderUtil.h **
10 ** Module : ICLGeom **
11 ** Authors: Matthias Esau **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 #include <ICLUtils/CompatMacros.h>
33 #include <ICLGeom/Primitive.h>
34 #include <ICLGeom/GeomDefs.h>
35 #include <ICLGeom/SceneLight.h>
36 
37 #include <ICLUtils/Uncopyable.h>
38 
39 namespace icl{
41  namespace qt {class GLFragmentShader;}
43  namespace geom{
44 
48  const Camera *m_camera;
51  const std::vector<Mat> *project2shadow;
52  float m_shadowBias;
54  public:
56  enum ShaderType{SHADOW, SHADOW_TEXTURE, NO_SHADOW, NO_SHADOW_TEXTURE, COUNT};
57  ShaderUtil(const Camera *camera, icl::qt::GLFragmentShader** shaders, const std::vector<Mat> *project2shadow, float shadowBias);
61  ShaderUtil();
62 
63  void activateShader(Primitive::Type type, bool withShadow);
64  void deactivateShaders();
65  const Camera &getCurrentCamera() const ;
66  static void recompilePerPixelShader(icl::qt::GLFragmentShader** shaders, const icl::utils::SmartPtr<SceneLight>* lights, int numShadowLights);
67  };
68  }
69 }
Simple wrapper class for OpenGL 2.0 Fragment Shader Programs.
Definition: GLFragmentShader.h:45
undocument this line if you encounter any issues!
Definition: Any.h:37
Class interface for un-copyable classes.
Definition: Uncopyable.h:64
float m_shadowBias
Definition: ShaderUtil.h:52
const Camera * m_camera
Definition: ShaderUtil.h:48
#define ICLGeom_API
Definition: CompatMacros.h:179
bool renderingShadow
Definition: ShaderUtil.h:53
ShaderType
Enum representing the different shader types.
Definition: ShaderUtil.h:56
Camera class.
Definition: Camera.h:132
const std::vector< Mat > * project2shadow
Definition: ShaderUtil.h:51
Definition: ShaderUtil.h:56
Definition: ShaderUtil.h:47
Type
primitive type for dynamic handling of different primitives
Definition: Primitive.h:62
icl::qt::GLFragmentShader * activeShader
Definition: ShaderUtil.h:50
icl::qt::GLFragmentShader ** m_shaders
Definition: ShaderUtil.h:49
Specialization of the SmartPtrBase class for Pointers.
Definition: SmartPtr.h:75