(GLfloat) t.cloud_height };
extensions->glVertexAttrib3fv(USR_ATTR_1, ua1 );
extensions->glVertexAttrib3fv(USR_ATTR_2, ua2 );
- glColor4f(t.position.x(), t.position.y(), t.position.z(), 1.0);
+ glColor4f(t.position.x(), t.position.y(), t.position.z(), zscale);
_geometry->draw(renderInfo);
}
}
setUseDisplayList(false);
}
- CloudShaderGeometry(int vx, int vy, float width, float height) :
- varieties_x(vx), varieties_y(vy)
+ CloudShaderGeometry(int vx, int vy, float width, float height, float zsc) :
+ varieties_x(vx), varieties_y(vy), zscale(zsc)
{
setUseDisplayList(false);
float x = width/2.0f;
_geometry = geometry;
}
- void addSprite(const SGVec3f& p, int tx, int ty, float w, float h,
- float s, float cull, float cloud_height);
+ void addSprite(const SGVec3f& p, int tx, int ty, float w, float h,
+ float s, float cull, float cloud_height);
osg::ref_ptr<osg::Drawable> _geometry;
int varieties_x;
int varieties_y;
+ float zscale;
// Bounding box extents.
osg::BoundingBox _bbox;
num_textures_x = cld_def->getIntValue("num-textures-x", 4);
num_textures_y = cld_def->getIntValue("num-textures-y", 4);
bottom_shade = cld_def->getDoubleValue("bottom-shade", 1.0);
+ zscale = cld_def->getDoubleValue("z-scale", 1.0);
texture = cld_def->getStringValue("texture", "cl_cumulus.png");
// Create a new Effect for the texture, if required.
osg::ref_ptr<EffectGeode> geode = new EffectGeode;
- CloudShaderGeometry* sg = new CloudShaderGeometry(num_textures_x, num_textures_y, max_width, max_height);
+ CloudShaderGeometry* sg = new CloudShaderGeometry(num_textures_x, num_textures_y, max_width, max_height, zscale);
// Determine how big this specific cloud instance is. Note that we subtract
// the sprite size because the width/height is used to define the limits of
double min_sprite_height;
double max_sprite_height;
double bottom_shade;
+ double zscale;
int num_sprites;
int num_textures_x;
int num_textures_y;