|
|
|
@ -242,9 +242,9 @@ namespace Resource
|
|
|
|
|
return mForceShaders;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SceneManager::recreateShaders(osg::ref_ptr<osg::Node> node)
|
|
|
|
|
void SceneManager::recreateShaders(osg::ref_ptr<osg::Node> node, const std::string& shaderPrefix)
|
|
|
|
|
{
|
|
|
|
|
osg::ref_ptr<Shader::ShaderVisitor> shaderVisitor(createShaderVisitor());
|
|
|
|
|
osg::ref_ptr<Shader::ShaderVisitor> shaderVisitor(createShaderVisitor(shaderPrefix));
|
|
|
|
|
shaderVisitor->setAllowedToModifyStateSets(false);
|
|
|
|
|
node->accept(*shaderVisitor);
|
|
|
|
|
}
|
|
|
|
@ -761,9 +761,9 @@ namespace Resource
|
|
|
|
|
stats->setAttribute(frameNumber, "Node Instance", mInstanceCache->getCacheSize());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Shader::ShaderVisitor *SceneManager::createShaderVisitor()
|
|
|
|
|
Shader::ShaderVisitor *SceneManager::createShaderVisitor(const std::string& shaderPrefix)
|
|
|
|
|
{
|
|
|
|
|
Shader::ShaderVisitor* shaderVisitor = new Shader::ShaderVisitor(*mShaderManager.get(), *mImageManager, "objects_vertex.glsl", "objects_fragment.glsl");
|
|
|
|
|
Shader::ShaderVisitor* shaderVisitor = new Shader::ShaderVisitor(*mShaderManager.get(), *mImageManager, shaderPrefix+"_vertex.glsl", shaderPrefix+"_fragment.glsl");
|
|
|
|
|
shaderVisitor->setForceShaders(mForceShaders);
|
|
|
|
|
shaderVisitor->setAutoUseNormalMaps(mAutoUseNormalMaps);
|
|
|
|
|
shaderVisitor->setNormalMapPattern(mNormalMapPattern);
|
|
|
|
|