// // Handle rendering of sky // // Copyright (C) J. Belson 2001.12.08 // // $Author: jon $ : $Date: 2003/10/11 18:11:00 $ // #ifndef _SCENE_SKY_H_ #define _SCENE_SKY_H_ #include "fcolour.h" #include "handler_base.h" #include "hf.h" #include "perlin.h" #include "perlin2.h" #include "point3d.h" #include "texture.h" #define USE_OLD_PERLIN /** * Handle rendering of skydome */ class handler_sky : public handler_base { private: hf* skydome; texture* tex; texture* sky; texture* cloud; fcolour horizon_colour; fcolour zenith_colour; bool realistic_sky; point3d sun_pos; fcolour cloud_colour; float persistence; float presence; float cloud_cover; float scale; int seed; bool first; // Calculate height for specified point virtual float get_height(float x, float y); virtual void process_patch(const point3d& p1, const point3d& p2, const point3d& p3, const point3d& p4); // Calculate colour for point on skydome fcolour get_colour(const point3d& p); // Check if triangle is sea bool check_sea_level(triangle3d& t, const point3d* pnt3d); // Calcualate sun position from light vector point3d calc_sun_pos(void); enum { SKYDOME_OFFSET = 40, SKYDOME_SCALE = 70 }; public: handler_sky(int w, int h, const render_info& info); ~handler_sky(); virtual void render(void); // Don't need this for skydome since it's not a fractal virtual void set_heightfield(hfield*) {} friend class handler_land; }; #endif // _SCENE_SKY_H_