// Random vegetation properties
wood_coverage = props->getDoubleValue("wood-coverage", 0.0);
+ tree_effect = props->getStringValue("tree-effect", "Effects/tree");
tree_height = props->getDoubleValue("tree-height-m", 0.0);
tree_width = props->getDoubleValue("tree-width-m", 0.0);
tree_range = props->getDoubleValue("tree-range-m", 0.0);
* @return the texture to use for trees.
*/
inline std::string get_tree_texture () const { return tree_texture; }
+
+
+ /**
+ * Get the effect file name to use for trees
+ *
+ * @return the effect to use for this set of trees.
+ */
+ inline std::string get_tree_effect () const { return tree_effect; }
/**
* Get the cosine of the maximum tree density slope angle. We
// Tree texture, typically a strip of applicable tree textures
std::string tree_texture;
+
+ // Tree effect to be used for a particular material
+ std::string tree_effect;
// Object mask, a simple RGB texture used as a mask when placing
// random vegetation, objects and buildings
BOOST_FOREACH(bin, randomForest)
{
if ((bin->texture == mat->get_tree_texture() ) &&
+ (bin->teffect == mat->get_tree_effect() ) &&
(bin->texture_varieties == mat->get_tree_varieties()) &&
(bin->range == mat->get_tree_range() ) &&
(bin->width == mat->get_tree_width() ) &&
bin = new TreeBin();
bin->texture = mat->get_tree_texture();
SG_LOG(SG_INPUT, SG_DEBUG, "Tree texture " << bin->texture);
+ bin->teffect = mat->get_tree_effect();
+ SG_LOG(SG_INPUT, SG_DEBUG, "Tree effect " << bin->teffect);
bin->range = mat->get_tree_range();
bin->width = mat->get_tree_width();
bin->height = mat->get_tree_height();
(!iter->second.lock(effect)))
{
SGPropertyNode_ptr effectProp = new SGPropertyNode;
- makeChild(effectProp, "inherits-from")->setStringValue("Effects/tree");
+ makeChild(effectProp, "inherits-from")->setStringValue(forest->teffect);
SGPropertyNode* params = makeChild(effectProp, "parameters");
// emphasize n = 0
params->getChild("texture", 0, true)->getChild("image", 0, true)
float height;
float width;
std::string texture;
+ std::string teffect;
void insert(const Tree& t)
{ _trees.push_back(t); }