|
发表于 2019-12-24 16:38:37
|
显示全部楼层
修改osg着色器 在State::convertVertexShaderSourceToOsgBuiltIns中
if ( declPos != std::string::npos )
{
declPos = source.find(" ", declPos); // move to the first space after "#version"
declPos = source.find_first_not_of(std::string(" "), declPos); // skip all the spaces until you reach the version number
std::string versionNumber(source, declPos, 3);
int glslVersion = atoi(versionNumber.c_str());
OSG_INFO<<"shader version found: "<< glslVersion <<std::endl;
if (glslVersion >= 130) attributeQualifier = "in ";
// found the string, now find the next linefeed and set the insertion point after it.
declPos = source.find( '\n', declPos );
#if defined(OSG_GLES3_AVAILABLE)
declPos = source.find("precision", declPos);
declPos = source.find( '\n', declPos );
declPos = source.find("precision", declPos);
declPos = source.find( '\n', declPos );
#endif
declPos = declPos != std::string::npos ? declPos+1 : source.length();
} |
|