|
|
@ -40,6 +40,7 @@ namespace Shader
|
|
|
|
, mAutoUseNormalMaps(false)
|
|
|
|
, mAutoUseNormalMaps(false)
|
|
|
|
, mAutoUseSpecularMaps(false)
|
|
|
|
, mAutoUseSpecularMaps(false)
|
|
|
|
, mApplyLightingToEnvMaps(false)
|
|
|
|
, mApplyLightingToEnvMaps(false)
|
|
|
|
|
|
|
|
, mTranslucentFramebuffer(false)
|
|
|
|
, mShaderManager(shaderManager)
|
|
|
|
, mShaderManager(shaderManager)
|
|
|
|
, mImageManager(imageManager)
|
|
|
|
, mImageManager(imageManager)
|
|
|
|
, mDefaultVsTemplate(defaultVsTemplate)
|
|
|
|
, mDefaultVsTemplate(defaultVsTemplate)
|
|
|
@ -146,7 +147,7 @@ namespace Shader
|
|
|
|
mRequirements.back().mShaderRequired = true;
|
|
|
|
mRequirements.back().mShaderRequired = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (!mTranslucentFramebuffer)
|
|
|
|
Log(Debug::Error) << "ShaderVisitor encountered unknown texture " << texture;
|
|
|
|
Log(Debug::Error) << "ShaderVisitor encountered unknown texture " << texture;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -322,6 +323,8 @@ namespace Shader
|
|
|
|
|
|
|
|
|
|
|
|
writableStateSet->addUniform(new osg::Uniform("colorMode", reqs.mColorMode));
|
|
|
|
writableStateSet->addUniform(new osg::Uniform("colorMode", reqs.mColorMode));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defineMap["translucentFramebuffer"] = mTranslucentFramebuffer ? "1" : "0";
|
|
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Shader> vertexShader (mShaderManager.getShader(mDefaultVsTemplate, defineMap, osg::Shader::VERTEX));
|
|
|
|
osg::ref_ptr<osg::Shader> vertexShader (mShaderManager.getShader(mDefaultVsTemplate, defineMap, osg::Shader::VERTEX));
|
|
|
|
osg::ref_ptr<osg::Shader> fragmentShader (mShaderManager.getShader(mDefaultFsTemplate, defineMap, osg::Shader::FRAGMENT));
|
|
|
|
osg::ref_ptr<osg::Shader> fragmentShader (mShaderManager.getShader(mDefaultFsTemplate, defineMap, osg::Shader::FRAGMENT));
|
|
|
|
|
|
|
|
|
|
|
@ -474,4 +477,9 @@ namespace Shader
|
|
|
|
mApplyLightingToEnvMaps = apply;
|
|
|
|
mApplyLightingToEnvMaps = apply;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ShaderVisitor::setTranslucentFramebuffer(bool translucent)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mTranslucentFramebuffer = translucent;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|