|
|
|
@ -10,9 +10,6 @@
|
|
|
|
|
#include <gmock/gmock.h>
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
|
|
#include <boost/algorithm/string.hpp>
|
|
|
|
|
#include <boost/format.hpp>
|
|
|
|
|
|
|
|
|
|
#include <osgDB/Registry>
|
|
|
|
|
|
|
|
|
|
#include <array>
|
|
|
|
@ -55,7 +52,7 @@ namespace
|
|
|
|
|
{
|
|
|
|
|
if (line.starts_with('#'))
|
|
|
|
|
continue;
|
|
|
|
|
boost::trim_right(line);
|
|
|
|
|
line.erase(line.find_last_not_of(" \t\n\r\f\v") + 1);
|
|
|
|
|
result += line;
|
|
|
|
|
result += '\n';
|
|
|
|
|
}
|
|
|
|
@ -113,7 +110,8 @@ osg::Group {
|
|
|
|
|
|
|
|
|
|
std::string formatOsgNodeForShaderProperty(std::string_view shaderPrefix)
|
|
|
|
|
{
|
|
|
|
|
static constexpr const char format[] = R"(
|
|
|
|
|
std::ostringstream oss;
|
|
|
|
|
oss << R"(
|
|
|
|
|
osg::Group {
|
|
|
|
|
UniqueID 1
|
|
|
|
|
DataVariance STATIC
|
|
|
|
@ -144,7 +142,8 @@ osg::Group {
|
|
|
|
|
osg::StringValueObject {
|
|
|
|
|
UniqueID 7
|
|
|
|
|
Name "shaderPrefix"
|
|
|
|
|
Value "%s"
|
|
|
|
|
Value ")"
|
|
|
|
|
<< shaderPrefix << R"("
|
|
|
|
|
}
|
|
|
|
|
osg::BoolValueObject {
|
|
|
|
|
UniqueID 8
|
|
|
|
@ -163,7 +162,7 @@ osg::Group {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
)";
|
|
|
|
|
return (boost::format(format) % shaderPrefix).str();
|
|
|
|
|
return oss.str();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct ShaderPrefixParams
|
|
|
|
|