GlobeEngine
GlobeComposition.h
Go to the documentation of this file.
1 
8 #ifndef GlobeEngine_GlobeComposition_h
9 #define GlobeEngine_GlobeComposition_h
10 
11 #include "Composition.h"
12 #include "SpotLight.h"
13 #include "StyleCollection.h"
14 
15 namespace geGIS {
16 
17  struct SSAOParameter {
18  double strength;
19  double totalStrength;
20  double offset;
21  double falloff;
22  double radius;
23 
25  this->strength = 0.07;
26  this->totalStrength = 1.38;
27  this->offset = 18.0;
28  this->falloff = 0.000002;
29  this->radius = 0.006;
30  }
31 
32  SSAOParameter(double _strength, double _totalStrengh,
33  double _offset, double _falloff, double _radius) :
34  strength(_strength), totalStrength(_totalStrengh),
35  offset(_offset), falloff(_falloff),
36  radius(_radius){}
37 
38  SSAOParameter(const std::shared_ptr<SSAOParameter> copy) {
39  strength = copy->strength;
40  totalStrength = copy->totalStrength;
41  offset = copy->offset;
42  falloff = copy->falloff;
43  radius = copy->radius;
44  }
45  };
46 
47 
49  {
51  bool heatmap;
52  bool clustering;
56  int mouseLens;
59 
61  this->gpufeatures = false;
62  this->clustering = false;
63  this->heatmap = false;
64  this->clusterview = false;
65  this->mortonorder = false;
66  this->lineAdjustment= false;
67  this->mouseLens = 0;
68  this->mouseLensRadius = 0.01;
69  this->mouseLensCategory = 4;
70  }
71 
72  GPUFeatureFlags(bool _gpuFeaturesEnabled, bool _heatmapEnabled,
73  bool _clusteringEnabled, bool _mortonorderEnabled, bool _clusterviewEnabled, bool _lineAdjustmentEnabled) :
74  gpufeatures(_gpuFeaturesEnabled), heatmap(_heatmapEnabled),
75  clustering(_clusteringEnabled), lineAdjustment(_lineAdjustmentEnabled), mortonorder(_mortonorderEnabled),
76  clusterview(_clusterviewEnabled){}
77 
78  // copy constructor
79  GPUFeatureFlags(const std::shared_ptr<GPUFeatureFlags> copy){
80  gpufeatures = copy->gpufeatures;
81  clustering = copy->clustering;
82  heatmap = copy->heatmap;
83  clusterview = copy->clusterview;
84  lineAdjustment = copy->lineAdjustment;
85  mortonorder = copy->mortonorder;
86  mouseLens = copy->mouseLens;
87  mouseLensRadius = copy->mouseLensRadius;
88  mouseLensCategory = copy->mouseLensCategory;
89  }
90  };
91 
93  {
94  public:
97 
98  void enableEdgeHightlights(bool _in);
99  void setColorForEdgeHightlights(vmml::Vector4f _in);
100  void setLaplaceFilterThreshold(float _in);
101 
102 
104  return &this->directionalLight;
105  };
106 
109 
110  void setGPUFeatureBufferHandle(GLuint _handle);
111  void setGPUFeatureBufferAndBoundsHandle(GLuint _handle, GLuint _boundhandle);
112  void setGPUFeatureAttributeBufferHandle(GLuint _handle);
114  void enableDecals(bool _in);
115  bool isDecalpassEnabled();
116 
117  void setGPUFeatureHierachyMaxDepth(int _input);
118  void setGPUFeatureLineRadius(double _rad, double _maxRad);
119  void setGPUMouseLensRadius(float _in);
120  void setGPUMouseLensCategory(int _in);
121  void setGPUClusteredSize(vmml::Vector2d _size);
122  void setGPUClusteredObjectBounds(vmml::Vector4d _bound);
124  void enablePerspectiveLineAdjustment(bool _in);
125 
126  void setMouseCoord(vmml::Vector2f _mouseCoord);
127 
128  protected:
129  void drawFrame(std::shared_ptr<ge::Camera> _cam);
130 
132 
135  vmml::Vector4f edgeHighlightColor;
136 
137  // Licht
141 
142  // GPU feature buffer handle
148  vmml::Vector2d clusterSize;
149  vmml::Vector4d objectBounds;
150 
151  vmml::Vector2f mouseCoord;
152 
153  double lineRadius;
155 
156  int maxDepth;
157  // perspective line adjustment on = 1.0, otherwise 0.0;
158  float plaOnOff;
159  };
160 
162  {
163  public:
165  ssaoActive = false;
166  fboUIActive = false;
167  };
169 
170  void setSSAOEnabled(bool _in) {
171  ssaoActive = _in;
172  }
173 
174  bool isSSAOactive() {
175  return ssaoActive;
176  }
177 
178  void enableUIFbo() {
179  fboUIActive = true;
180  }
181 
182  void disableUIFbo() {
183  fboUIActive = false;
184  }
185 
186  bool isUIFboactive() {
187  return fboUIActive;
188  }
189 
190  protected:
191  void drawFrame(std::shared_ptr<ge::Camera> _cam);
192 
193  private:
194  bool ssaoActive;
195  bool fboUIActive;
196  };
197 
198  /*
199  * composition for screen space ambient occlusion
200  */
202  {
203  public:
204  SSAOComposition();
206 
207  void generateRandomTexture();
208  void setSSAOParamter(SSAOParameter _in);
210 
211  private:
212  void drawFrame(std::shared_ptr<ge::Camera> _cam);
213 
214  std::shared_ptr<ge::Texture2Drgba> randomTex;
215  SSAOParameter ssaoparameter;
216 
217  };
218 }
219 #endif
void setGPUFeatureHierachyMaxDepth(int _input)
Definition: GlobeComposition.cpp:200
bool clustering
Definition: GlobeComposition.h:52
void drawFrame(std::shared_ptr< ge::Camera > _cam)
Definition: GlobeComposition.cpp:252
bool lineAdjustment
Definition: GlobeComposition.h:55
bool isSSAOactive()
Definition: GlobeComposition.h:174
void setGPUMouseLensCategory(int _in)
Definition: GlobeComposition.cpp:209
geGIS::StyleCollectionUniformHandles styleBufferHandles
Definition: GlobeComposition.h:147
void setSSAOParamter(SSAOParameter _in)
Definition: GlobeComposition.cpp:330
void setColorForEdgeHightlights(vmml::Vector4f _in)
Definition: GlobeComposition.cpp:237
int mouseLens
Definition: GlobeComposition.h:56
GPUFeatureFlags(const std::shared_ptr< GPUFeatureFlags > copy)
Definition: GlobeComposition.h:79
const SSAOParameter * getSSAOParamter()
Definition: GlobeComposition.cpp:338
void setSSAOEnabled(bool _in)
Definition: GlobeComposition.h:170
double falloff
Definition: GlobeComposition.h:21
bool mortonorder
Definition: GlobeComposition.h:53
Definition: ClusterGrid.h:17
double offset
Definition: GlobeComposition.h:20
Definition: StyleCollection.h:45
bool decalsEnabled
Definition: GlobeComposition.h:131
bool isPerspectiveLineAdjustmentEnabled()
Definition: GlobeComposition.cpp:225
Definition: DirectionalLight.h:17
bool gpufeatures
Definition: GlobeComposition.h:50
vmml::Vector2d clusterSize
Definition: GlobeComposition.h:148
vmml::Vector4f edgeHighlightColor
Definition: GlobeComposition.h:135
void enableDecals(bool _in)
Definition: GlobeComposition.cpp:217
SSAOComposition()
Definition: GlobeComposition.cpp:266
ResampleComposition()
Definition: GlobeComposition.h:164
Definition: GlobeComposition.h:161
Definition: SpotLight.h:18
void setGPUMouseLensRadius(float _in)
Definition: GlobeComposition.cpp:213
bool edgesHighlighted
Definition: GlobeComposition.h:133
Definition: GlobeComposition.h:201
SSAOParameter(double _strength, double _totalStrengh, double _offset, double _falloff, double _radius)
Definition: GlobeComposition.h:32
void setGPUFeatureStyleBufferHandles(geGIS::StyleCollectionUniformHandles _handles)
Definition: GlobeComposition.cpp:175
const GPUFeatureFlags * getGPUFeatureFlags()
Definition: GlobeComposition.cpp:171
void setGPUFeatureLineRadius(double _rad, double _maxRad)
Definition: GlobeComposition.cpp:204
bool isUIFboactive()
Definition: GlobeComposition.h:186
double lineRadius
Definition: GlobeComposition.h:153
void setGPUFeatureFlags(GPUFeatureFlags _in)
Definition: GlobeComposition.cpp:154
const ge::DirectionalLight * getSunlight()
Definition: GlobeComposition.h:103
ge::DirectionalLight directionalLight
Definition: GlobeComposition.h:140
void setGPUFeatureBufferAndBoundsHandle(GLuint _handle, GLuint _boundhandle)
Definition: GlobeComposition.cpp:191
void setGPUClusteredSize(vmml::Vector2d _size)
Definition: GlobeComposition.cpp:179
float laplacefilterThreshold
Definition: GlobeComposition.h:134
GPUFeatureFlags(bool _gpuFeaturesEnabled, bool _heatmapEnabled, bool _clusteringEnabled, bool _mortonorderEnabled, bool _clusterviewEnabled, bool _lineAdjustmentEnabled)
Definition: GlobeComposition.h:72
Definition: GlobeComposition.h:48
void disableUIFbo()
Definition: GlobeComposition.h:182
ge::SpotLight spotLight
Definition: GlobeComposition.h:139
void drawFrame(std::shared_ptr< ge::Camera > _cam)
Definition: GlobeComposition.cpp:42
ge::Light light
Definition: GlobeComposition.h:138
SSAOParameter()
Definition: GlobeComposition.h:24
GlobeComposition()
Definition: GlobeComposition.cpp:12
int maxDepth
Definition: GlobeComposition.h:156
void setGPUFeatureBufferHandle(GLuint _handle)
Definition: GlobeComposition.cpp:187
~ResampleComposition()
Definition: GlobeComposition.h:168
void generateRandomTexture()
Definition: GlobeComposition.cpp:290
GPUFeatureFlags()
Definition: GlobeComposition.h:60
GLuint gpuBoundBufferHandle
Definition: GlobeComposition.h:145
Definition: Light.h:26
double maxlineRadius
Definition: GlobeComposition.h:154
void enablePerspectiveLineAdjustment(bool _in)
Definition: GlobeComposition.cpp:229
void setMouseCoord(vmml::Vector2f _mouseCoord)
Definition: GlobeComposition.cpp:245
GLuint gpuBufferHandle
Definition: GlobeComposition.h:144
float plaOnOff
Definition: GlobeComposition.h:158
bool isDecalpassEnabled()
Definition: GlobeComposition.cpp:221
float mouseLensRadius
Definition: GlobeComposition.h:58
Definition: Composition.h:23
~SSAOComposition()
Definition: GlobeComposition.cpp:270
SSAOParameter(const std::shared_ptr< SSAOParameter > copy)
Definition: GlobeComposition.h:38
~GlobeComposition()
Definition: GlobeComposition.h:96
bool heatmap
Definition: GlobeComposition.h:51
double strength
Definition: GlobeComposition.h:18
bool clusterview
Definition: GlobeComposition.h:54
double radius
Definition: GlobeComposition.h:22
double totalStrength
Definition: GlobeComposition.h:19
void enableUIFbo()
Definition: GlobeComposition.h:178
void setGPUClusteredObjectBounds(vmml::Vector4d _bound)
Definition: GlobeComposition.cpp:183
vmml::Vector2f mouseCoord
Definition: GlobeComposition.h:151
void setGPUFeatureAttributeBufferHandle(GLuint _handle)
Definition: GlobeComposition.cpp:196
Definition: GlobeComposition.h:92
int mouseLensCategory
Definition: GlobeComposition.h:57
void setLaplaceFilterThreshold(float _in)
Definition: GlobeComposition.cpp:241
vmml::Vector4d objectBounds
Definition: GlobeComposition.h:149
GLuint gpuCategoryBufferHandle
Definition: GlobeComposition.h:146
GPUFeatureFlags featureflags
Definition: GlobeComposition.h:143
Definition: GlobeComposition.h:17
void enableEdgeHightlights(bool _in)
Definition: GlobeComposition.cpp:233