|
Last change
on this file since 7782 was
7782,
checked in by amaechler, 20 years ago
|
|
branches/atmospheric_engine: simple cloud texture creation working
|
|
File size:
975 bytes
|
| Line | |
|---|
| 1 | /** |
|---|
| 2 | * @file cloud_effect.h |
|---|
| 3 | */ |
|---|
| 4 | |
|---|
| 5 | #ifndef _CLOUD_EFFECT |
|---|
| 6 | #define _CLOUD_EFFECT |
|---|
| 7 | |
|---|
| 8 | #include "vector.h" |
|---|
| 9 | #include "vector2D.h" |
|---|
| 10 | |
|---|
| 11 | #include "weather_effect.h" |
|---|
| 12 | |
|---|
| 13 | #include "sound_buffer.h" |
|---|
| 14 | #include "sound_source.h" |
|---|
| 15 | |
|---|
| 16 | class CloudEffect : public WeatherEffect |
|---|
| 17 | { |
|---|
| 18 | public: |
|---|
| 19 | CloudEffect(const TiXmlElement* root = NULL); |
|---|
| 20 | virtual ~CloudEffect(); |
|---|
| 21 | |
|---|
| 22 | virtual void loadParams(const TiXmlElement* root); |
|---|
| 23 | |
|---|
| 24 | virtual bool init(); |
|---|
| 25 | |
|---|
| 26 | virtual bool activate(); |
|---|
| 27 | virtual bool deactivate(); |
|---|
| 28 | |
|---|
| 29 | virtual void draw() const; |
|---|
| 30 | virtual void tick(float dt); |
|---|
| 31 | |
|---|
| 32 | private: |
|---|
| 33 | // Basic noise map 32x32 |
|---|
| 34 | float map32[32 * 32]; |
|---|
| 35 | |
|---|
| 36 | // The cloud map |
|---|
| 37 | float map256[256 * 256]; |
|---|
| 38 | |
|---|
| 39 | char texture[256][256][3]; //Temporary array to hold texture RGB values |
|---|
| 40 | |
|---|
| 41 | float noise(int x, int y, int random); |
|---|
| 42 | void setNoise(float *map); |
|---|
| 43 | float interpolate(float x, float y, float *map); |
|---|
| 44 | void overlapOctaves(float *map32, float *map256); |
|---|
| 45 | void expFilter(float *map); |
|---|
| 46 | GLuint texID[1]; |
|---|
| 47 | |
|---|
| 48 | }; |
|---|
| 49 | |
|---|
| 50 | #endif /* _CLOUD_EFFECT */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.