Commits

Frederic De Groef committed 0f85968

overloads all loaded scene materials to add the geom buffer pass

Comments (0)

Files changed (1)

ogre-ssao/SSAOMaterialSetter.cpp

 {
     //entity->setMaterialName("SSAO/DiffuseLight_GBuffer");
 
-    //Ogre::MaterialPtr currentMaterial = entity->
+    int n = entity->getNumSubEntities();
+    for(int i=0 ; i<n ; i++)
+    {
+        Ogre::SubEntity *subEntity = entity->getSubEntity(i);
+        Ogre::MaterialPtr material = subEntity->getMaterial();
+
+        Ogre::Technique *geomTechnique = material->createTechnique();
+        geomTechnique->setSchemeName("geom");
+        geomTechnique->setName("geom");
+
+        Ogre::Pass *geomBufferPass = geomTechnique->createPass();
+        geomBufferPass->setVertexProgram("gbuffer_vs");
+        geomBufferPass->setFragmentProgram("gbuffer_ps");
+
+    }
 }