source: GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.h @ 2983

Revision 2983, 1.4 KB checked in by mattausch, 16 years ago (diff)
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
10namespace CHCDemoEngine{
11class Vector3;
12class SceneEntity;
13class RenderState;
14class Camera;
15}
16
17class SkyPreetham
18{
19public:
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, bool scaleToRange);
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,
34                                 CHCDemoEngine::Vector3 &ambient,
35                                                 CHCDemoEngine::Vector3 &diffuse,
36                                                 bool scaleToRange) const;
37
38
39protected:
40
41        void RenderSunDisk(const CHCDemoEngine::Vector3 &lightDir, CHCDemoEngine::Camera *camera);
42        void CreateSunQuad();
43
44
45        /// Members.
46/*      FEffect*                mEffect;
47
48        FEffect*                mSunEffect;
49        FTexture2D*             mSunTexture;
50        FVertexBuffer*  mSunQuad;
51*/
52        CHCDemoEngine::SceneEntity *mSkyDome;
53
54        float mTurbidity;
55};
56
57#endif //_SKYPREETHAM_H__
58
Note: See TracBrowser for help on using the repository browser.