3 // Written by Harald JOHNSEN, started April 2005.
5 // Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include <simgear/compiler.h>
31 #include <simgear/scene/material/Effect.hxx>
32 #include <simgear/scene/material/EffectGeode.hxx>
43 SGNewCloud(const SGPath &texture_root, const SGPropertyNode *cld_def);
48 osg::ref_ptr<simgear::EffectGeode> genCloud ();
50 static float getDensity(void)
52 return sprite_density;
55 // Set the sprite density
56 static void setDensity(double d)
68 float min_sprite_width;
69 float max_sprite_width;
70 float min_sprite_height;
71 float max_sprite_height;
73 // Minimum and maximum bottom, middle, top, sunny, shade lighting
74 // factors. For individual clouds we choose a bottom/middle/top
75 // shade from between each min/max value
76 float min_bottom_lighting_factor;
77 float max_bottom_lighting_factor;
78 float min_middle_lighting_factor;
79 float max_middle_lighting_factor;
80 float min_top_lighting_factor;
81 float max_top_lighting_factor;
82 float min_shade_lighting_factor;
83 float max_shade_lighting_factor;
85 // The density of the cloud is the shading applied
86 // to cloud sprites on the opposite side of the cloud
87 // from the sun. For an invidual cloud instance a value
88 // between min_density and max_density is chosen.
92 // zscale indicates how sprites should be scaled vertically
93 // after billboarding.
95 bool height_map_texture;
101 osg::ref_ptr<simgear::Effect> effect;
102 static float sprite_density;
104 osg::Geometry* createOrthQuad(float w, float h, int varieties_x, int varieties_y);
110 #endif // _NEWCLOUD_HXX