Commits

philiplb committed adc3f28

Volume Rendering: added support for material definition in volume terrain config file

Comments (0)

Files changed (3)

Components/Volume/src/OgreVolumeChunk.cpp

         parameters.skirtFactor = StringConverter::parseReal(config.getSetting("skirtFactor"));
     
         load(parent, from, to, level, &parameters);
+
+        String material = config.getSetting("material");
+        setMaterial(material);
     }
     
     //-----------------------------------------------------------------------

Samples/Media/volumeTerrain/volumeTerrain.cfg

 # Whether or not to create the visualization of the dual grids
 createDualGridVisualization = false
 # The factor defining the length of the skirts. Less means more triangles and less loading time, but if too small, cracks can occure.
-skirtFactor = 0.7
+skirtFactor = 0.7
+
+# The material of the chunks
+material = triplanarReference

Samples/VolumeTerrain/src/VolumeTerrain.cpp

     mVolumeRoot = OGRE_NEW Chunk();
     SceneNode *volumeRootNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("VolumeParent");
     mVolumeRoot->load(volumeRootNode, mSceneMgr, "volumeTerrain.cfg");
-    mVolumeRoot->setMaterial("triplanarReference");
 
     // Camera
     mCamera->setPosition(to * mVolumeRoot->getScale());