OpenMW
components/terrain/material.hpp
Go to the documentation of this file.
00001 #ifndef COMPONENTS_TERRAIN_MATERIAL_H
00002 #define COMPONENTS_TERRAIN_MATERIAL_H
00003 
00004 #include <OgreMaterial.h>
00005 
00006 #include "storage.hpp"
00007 
00008 namespace Terrain
00009 {
00010 
00011     class MaterialGenerator
00012     {
00013     public:
00018         MaterialGenerator (bool shaders);
00019 
00020         void setLayerList (const std::vector<LayerInfo>& layerList) { mLayerList = layerList; }
00021         bool hasLayers() { return mLayerList.size(); }
00022         void setBlendmapList (const std::vector<Ogre::TexturePtr>& blendmapList) { mBlendmapList = blendmapList; }
00023         const std::vector<Ogre::TexturePtr>& getBlendmapList() { return mBlendmapList; }
00024         void setCompositeMap (const std::string& name) { mCompositeMap = name; }
00025 
00026         void enableShadows(bool shadows) { mShadows = shadows; }
00027         void enableNormalMapping(bool normalMapping) { mNormalMapping = normalMapping; }
00028         void enableParallaxMapping(bool parallaxMapping) { mParallaxMapping = parallaxMapping; }
00029         void enableSplitShadows(bool splitShadows) { mSplitShadows = splitShadows; }
00030 
00034         Ogre::MaterialPtr generate (Ogre::MaterialPtr mat);
00035 
00039         Ogre::MaterialPtr generateForCompositeMap (Ogre::MaterialPtr mat);
00040 
00045         Ogre::MaterialPtr generateForCompositeMapRTT (Ogre::MaterialPtr mat);
00046 
00047     private:
00048         Ogre::MaterialPtr create (Ogre::MaterialPtr mat, bool renderCompositeMap, bool displayCompositeMap);
00049 
00050         std::vector<LayerInfo> mLayerList;
00051         std::vector<Ogre::TexturePtr> mBlendmapList;
00052         std::string mCompositeMap;
00053         bool mShaders;
00054         bool mShadows;
00055         bool mSplitShadows;
00056         bool mNormalMapping;
00057         bool mParallaxMapping;
00058     };
00059 
00060 }
00061 
00062 #endif