WS30: Add waterline-start and waterline-end params

Used for coastline mixing.
This commit is contained in:
Stuart Buchanan
2022-04-09 16:24:51 +01:00
parent 363906828f
commit fa2b5911b7
2 changed files with 3 additions and 3 deletions

View File

@@ -401,9 +401,9 @@ public:
(0 < tex_height) ? 1000.0f/tex_height : 1.0f);
}
float get_parameter(const std::string& param) const
float get_parameter(const std::string& param, float defaultValue = (0.0F)) const
{
return parameters->getFloatValue(param);
return parameters->getFloatValue(param, defaultValue);
}
protected:

View File

@@ -430,7 +430,7 @@ SGMaterialCache::Atlas SGMaterialLib::getMaterialTextureAtlas(SGVec2f center, co
water = 1.0;
}
atlas.materialParams3->setElement(materialLookupIndex, osg::Vec4f(water, 0.0, 0.0, 0.0));
atlas.materialParams3->setElement(materialLookupIndex, osg::Vec4f(water, mat->get_parameter("waterline-start"), mat->get_parameter("waterline-end"), 0.0));
// Similarly, there are specifically 7 textures that are defined in the materials that need to be passed into
// the shader as an array based on the material lookup.