Merge /u/fgarlin/simgear/ branch next into next

https://sourceforge.net/p/flightgear/simgear/merge-requests/64/
This commit is contained in:
James Turner
2019-10-29 08:40:00 +00:00
3 changed files with 20 additions and 11 deletions

View File

@@ -918,8 +918,13 @@ void ShaderProgramBuilder::buildAttribute(Effect* effect, Pass* pass,
resolvedKey.attributes = prgKey.attributes;
BOOST_FOREACH(const ShaderKey& shaderKey, prgKey.shaders)
{
const string& shaderName = shaderKey.first;
// FIXME orig: const string& shaderName = shaderKey.first;
string shaderName = shaderKey.first;
Shader::Type stype = (Shader::Type)shaderKey.second;
if (getPropertyRoot()->getBoolValue("/sim/version/compositor-support", false) &&
shaderName.substr(0, shaderName.find("/")) == "Shaders") {
shaderName = "Compositor/" + shaderName;
}
string fileName = SGModelLib::findDataFile(shaderName, options);
if (fileName.empty())
{

View File

@@ -130,8 +130,12 @@ Effect* makeEffect(const string& name,
string effectFileName;
// Use getPropertyRoot() because the SGReaderWriterOptions might not have a
// valid property tree
if (getPropertyRoot()->getBoolValue("/sim/version/compositor-support", false))
if (getPropertyRoot()->getBoolValue("/sim/version/compositor-support", false) &&
name.substr(0, name.find("/")) == "Effects") {
// Temporarily append the Compositor/ directory to every effect that should
// be inside Effects/.
effectFileName += "Compositor/";
}
effectFileName += name;
effectFileName += ".eff";
string absFileName

View File

@@ -112,15 +112,15 @@ PassBuilder::build(Compositor *compositor, const SGPropertyNode *root,
camera->setClearStencil(root->getIntValue("clear-stencil", 0));
GLbitfield clear_mask = 0;
if (root->getBoolValue("clear-color-bit", true))
clear_mask |= GL_COLOR_BUFFER_BIT;
if (root->getBoolValue("clear-accum-bit", false))
clear_mask |= GL_ACCUM_BUFFER_BIT;
if (root->getBoolValue("clear-depth-bit", true))
clear_mask |= GL_DEPTH_BUFFER_BIT;
if (root->getBoolValue("clear-stencil-bit", false))
clear_mask |= GL_STENCIL_BUFFER_BIT;
// Default clear mask is GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, as in OSG
std::stringstream ss;
std::string bit;
// Default clear mask as in OSG
ss << root->getStringValue("clear-mask", "color depth");
while (ss >> bit) {
if (bit == "color") clear_mask |= GL_COLOR_BUFFER_BIT;
else if (bit == "depth") clear_mask |= GL_DEPTH_BUFFER_BIT;
else if (bit == "stencil") clear_mask |= GL_STENCIL_BUFFER_BIT;
}
camera->setClearMask(clear_mask);
PropertyList p_bindings = root->getChildren("binding");