I have integrated Ogre 1.7RC1 + RT Shadery System (which is awesome!) into my own project. I am using the RTSS/PerPixel_SinglePass material, and it works great with Stencil SHADOWTYPE_STENCIL_MODULATIVE, but it renders material completely black with SHADOWTYPE_STENCIL_ADDITIVE.
The code I use to init the system:
Code: Select all
if (Ogre::RTShader::ShaderGenerator::initialize())
{
// Grab the shader generator pointer.
mShaderGenerator = Ogre::RTShader::ShaderGenerator::getSingletonPtr();
// Set the scene manager.
mShaderGenerator->addSceneManager(ogreSceneManager);
// Add the shader libs resource location.
Ogre::ResourceGroupManager& rgm = Ogre::ResourceGroupManager::getSingleton();
String shaderLibPath = cingDataFolder + "RTShaderLib";
rgm.createResourceGroup("RTShaderSystem", false);
rgm.addResourceLocation(shaderLibPath + "/materials", "FileSystem", "RTShaderSystem");
rgm.initialiseResourceGroup("RTShaderSystem");
rgm.loadResourceGroup( "RTShaderSystem", true );
// Set shader cache path.
mShaderGenerator->setShaderCachePath(shaderCachePath);
// Make this viewport work with shader generator scheme.
Window& window = GraphicsManager::getSingleton().getMainWindow();
window.getViewport(0)->setMaterialScheme(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME);
}
Code: Select all
cube.init( "Prefab_Sphere" );
cube.setMaterial( "RTSS/PerPixel_SinglePass" );
cube.getEntity()->setCastShadows(true);
Thanks!


