Line | |
---|
1 | #ifndef _SKYPREETHAM_H__
|
---|
2 | #define _SKYPREETHAM_H__
|
---|
3 |
|
---|
4 | #include "glInterface.h"
|
---|
5 | #include "common.h"
|
---|
6 | #include <Cg/cg.h>
|
---|
7 | #include <Cg/cgGL.h>
|
---|
8 |
|
---|
9 |
|
---|
10 | namespace CHCDemoEngine{
|
---|
11 | class Vector3;
|
---|
12 | class SceneEntity;
|
---|
13 | class RenderState;
|
---|
14 | class Camera;
|
---|
15 | }
|
---|
16 |
|
---|
17 | class SkyPreetham
|
---|
18 | {
|
---|
19 | public:
|
---|
20 | /// Constructor taking sky turbitity as parameter and the sky dome geometry
|
---|
21 | SkyPreetham(float turbitity, CHCDemoEngine::SceneEntity *skyDome);
|
---|
22 | virtual ~SkyPreetham();
|
---|
23 |
|
---|
24 | void RenderSkyDome(const CHCDemoEngine::Vector3 &sunDir, CHCDemoEngine::Camera *camera, CHCDemoEngine::RenderState *state);
|
---|
25 |
|
---|
26 | static void Init(CGcontext context);
|
---|
27 |
|
---|
28 | void ComputeFactors(const CHCDemoEngine::Vector3 &sunDir,
|
---|
29 | CHCDemoEngine::Vector3 &zenithColor,
|
---|
30 | std::vector<CHCDemoEngine::Vector3> &ABCDE,
|
---|
31 | std::pair<float, float> &sunThetha) const;
|
---|
32 |
|
---|
33 | void ComputeSunColor(const CHCDemoEngine::Vector3 &sunDir, CHCDemoEngine::Vector3 &ambient, CHCDemoEngine::Vector3 &diffuse) const;
|
---|
34 |
|
---|
35 |
|
---|
36 | protected:
|
---|
37 |
|
---|
38 | void RenderSunDisk(const CHCDemoEngine::Vector3 &lightDir, CHCDemoEngine::Camera *camera);
|
---|
39 | void CreateSunQuad();
|
---|
40 |
|
---|
41 |
|
---|
42 | /// Members.
|
---|
43 | /* FEffect* mEffect;
|
---|
44 |
|
---|
45 | FEffect* mSunEffect;
|
---|
46 | FTexture2D* mSunTexture;
|
---|
47 | FVertexBuffer* mSunQuad;
|
---|
48 | */
|
---|
49 | CHCDemoEngine::SceneEntity *mSkyDome;
|
---|
50 |
|
---|
51 | float mTurbidity;
|
---|
52 | };
|
---|
53 |
|
---|
54 | #endif //_SKYPREETHAM_H__
|
---|
55 |
|
---|
Note: See
TracBrowser
for help on using the repository browser.