All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
GlobalFogging.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "VectorMath.h"
7 
8 namespace Eegeo
9 {
10  namespace Lighting
11  {
13  {
14  Eegeo::v4 FogColour;
15  Eegeo::v3 WorldUp;
16  float FogDensityGlobal;
17  float HeightFogIntensity;
18  float DistanceFogIntensity;
19  float CameraAltitude;
20  float HeightFogMinAltitude;
21  float HeightFogMaxAltitude;
22  float DistanceFogNear;
23  float DistanceFogFar;
24  float DistanceFogLow;
25  float DistanceFogHigh;
26 
27  };
28 
30  {
31  public:
32  GlobalFogging();
33 
34  void SetDefault();
35 
36  void SetFogColour(const Eegeo::v4& fogColour) { m_fogColour = fogColour; }
37  void SetHeightFogAltitudes(float minAltitude, float maxAltitude) { m_heightFogMinAltitude = minAltitude; m_heightFogMaxAltitude = maxAltitude; }
38  void SetDistanceFogDistances(float nearFog, float farFog) { m_distanceFogNear = nearFog; m_distanceFogFar = farFog; }
39  void SetDistanceFogAltitudes(float low, float high) { m_distanceFogLow = low; m_distanceFogHigh = high; }
40  void SetCameraPositionEcef(const Eegeo::dv3& cameraPositionEcef) { m_cameraPositionEcef = cameraPositionEcef; }
41  void SetFogDensity(float fogDensity) { m_fogDensity = fogDensity; }
42  void SetHeightFogIntensity(float heightFogIntensity) { m_heightFogIntensity = heightFogIntensity; }
43  void SetDistanceFogIntensity(float distanceFogIntensity) { m_distanceFogInstensity = distanceFogIntensity; }
44  void SetBaseAltitude(float baseAltitude) { m_baseAltitude = baseAltitude; }
45 
46  void GetUniformValues(GlobalFoggingUniformValues& values) const;
47 
48  bool IsEnabled() const { return m_fogDensity > 0.f;}
49  private:
50 
51  Eegeo::v4 m_fogColour;
52  Eegeo::dv3 m_cameraPositionEcef;
53  float m_heightFogMinAltitude;
54  float m_heightFogMaxAltitude;
55  float m_distanceFogNear;
56  float m_distanceFogFar;
57  float m_distanceFogLow;
58  float m_distanceFogHigh;
59  float m_fogDensity;
60  float m_heightFogIntensity;
61  float m_distanceFogInstensity;
62  float m_baseAltitude;
63 
64  };
65  }
66 }