BVB Source Codes

CRYENGINE Show SkyLightManager.h Source code

Return Download CRYENGINE: download SkyLightManager.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.  
  8.    -------------------------------------------------------------------------
  9.    History:
  10.    - 09:05:2005   14:32 : Created by Carsten Wenzel
  11.  
  12. *************************************************************************/
  13.  
  14. #ifndef _SKY_LIGHT_MANAGER_H_
  15. #define _SKY_LIGHT_MANAGER_H_
  16.  
  17. #pragma once
  18.  
  19. #include <memory>
  20. #include <vector>
  21.  
  22. class CSkyLightNishita;
  23. struct ITimer;
  24.  
  25. class CRY_ALIGN(128) CSkyLightManager: public Cry3DEngineBase
  26. {
  27. public:
  28.         struct CRY_ALIGN(16) SSkyDomeCondition
  29.         {
  30.                 SSkyDomeCondition()
  31.                         : m_sunIntensity(20.0f, 20.0f, 20.0f)
  32.                           , m_Km(0.001f)
  33.                           , m_Kr(0.00025f)
  34.                           , m_g(-0.99f)
  35.                           , m_rgbWaveLengths(650.0f, 570.0f, 475.0f)
  36.                           , m_sunDirection(0.0f, 0.707106f, 0.707106f)
  37.                 {
  38.                 }
  39.  
  40.                 Vec3 m_sunIntensity;
  41.                 float m_Km;
  42.                 float m_Kr;
  43.                 float m_g;
  44.                 Vec3 m_rgbWaveLengths;
  45.                 Vec3 m_sunDirection;
  46.         };
  47.  
  48. public:
  49.         CSkyLightManager();
  50.         ~CSkyLightManager();
  51.  
  52.         // sky dome condition
  53.         void SetSkyDomeCondition(const SSkyDomeCondition &skyDomeCondition);
  54.         void GetCurSkyDomeCondition(SSkyDomeCondition & skyCond) const;
  55.  
  56.         // controls updates
  57.         void FullUpdate();
  58.         void IncrementalUpdate(f32 updateRatioPerFrame, const SRenderingPassInfo &passInfo);
  59.         void SetQuality(int32 quality);
  60.  
  61.         // rendering params
  62.         const SSkyLightRenderParams* GetRenderParams() const;
  63.  
  64.         void GetMemoryUsage(ICrySizer * pSizer) const;
  65.  
  66.         void InitSkyDomeMesh();
  67.         void ReleaseSkyDomeMesh();
  68.  
  69.         void UpdateInternal(int32 newFrameID, int32 numUpdates, int callerIsFullUpdate = 0);
  70. private:
  71.         typedef std::vector<CryHalf4> SkyDomeTextureData;
  72.  
  73. private:
  74.         bool IsSkyDomeUpdateFinished() const;
  75.  
  76.         int GetFrontBuffer() const;
  77.         int GetBackBuffer() const;
  78.         void ToggleBuffer();
  79.         void UpdateRenderParams();
  80.         void PushUpdateParams();
  81.  
  82. private:
  83.         SSkyDomeCondition m_curSkyDomeCondition;      //current sky dome conditions
  84.         SSkyDomeCondition m_reqSkyDomeCondition[2];   //requested sky dome conditions, double buffered(engine writes async)
  85.         SSkyDomeCondition m_updatingSkyDomeCondition; //sky dome conditions the update is currently processed with
  86.         int m_updateRequested[2];                     //true if an update is requested, double buffered(engine writes async)
  87.         CSkyLightNishita* m_pSkyLightNishita;
  88.  
  89.         SkyDomeTextureData m_skyDomeTextureDataMie[2];
  90.         SkyDomeTextureData m_skyDomeTextureDataRayleigh[2];
  91.         int32 m_skyDomeTextureTimeStamp[2];
  92.  
  93.         bool m_bFlushFullUpdate;
  94.  
  95.         _smart_ptr<IRenderMesh> m_pSkyDomeMesh;
  96.  
  97.         int32 m_numSkyDomeColorsComputed;
  98.         int32 m_curBackBuffer;
  99.  
  100.         int32 m_lastFrameID;
  101.         int32 m_needRenderParamUpdate;
  102.  
  103.         Vec3 m_curSkyHemiColor[5];
  104.         Vec3 m_curHazeColor;
  105.         Vec3 m_curHazeColorMieNoPremul;
  106.         Vec3 m_curHazeColorRayleighNoPremul;
  107.  
  108.         Vec3 m_skyHemiColorAccum[5];
  109.         Vec3 m_hazeColorAccum;
  110.         Vec3 m_hazeColorMieNoPremulAccum;
  111.         Vec3 m_hazeColorRayleighNoPremulAccum;
  112.  
  113.         CRY_ALIGN(16) SSkyLightRenderParams m_renderParams;
  114. };
  115.  
  116. #endif // #ifndef _SKY_LIGHT_MANAGER_H_
  117.  
downloadSkyLightManager.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top