22 #ifndef _HEIGHTMAP_HH_
23 #define _HEIGHTMAP_HH_
37 class TerrainGlobalOptions;
72 public:
double GetHeight(
double _x,
double _y,
double _z = 1000);
80 private:
bool InitBlendMaps(Ogre::Terrain *_terrain);
83 private:
void ConfigureTerrainDefaults();
88 private:
void DefineTerrain(
int _x,
int _y);
92 private:
void SetupShadows(
bool _enabled);
104 private:
unsigned int imageSize;
107 private:
double maxPixel;
113 private: Ogre::TerrainGlobalOptions *terrainGlobals;
116 private: Ogre::TerrainGroup *terrainGroup;
119 private:
bool terrainsImported;
122 private: std::vector<std::string> diffuseTextures;
125 private: std::vector<std::string> normalTextures;
128 private: std::vector<double> worldSizes;
131 private: std::vector<double> blendHeight;
134 private: std::vector<double> blendFade;
150 public Ogre::TerrainMaterialGeneratorA::SM2Profile
153 public:
SM2Profile(Ogre::TerrainMaterialGenerator *_parent,
154 const Ogre::String &_name,
const Ogre::String &_desc);
159 public: Ogre::MaterialPtr
generate(
const Ogre::Terrain *_terrain);
162 const Ogre::Terrain *_terrain);
164 public:
void UpdateParams(
const Ogre::MaterialPtr &_mat,
165 const Ogre::Terrain *_terrain);
168 const Ogre::Terrain *_terrain);
170 protected:
virtual void addTechnique(
const Ogre::MaterialPtr &_mat,
171 const Ogre::Terrain *_terrain, TechniqueType _tt);
175 public Ogre::TerrainMaterialGeneratorA::SM2Profile::ShaderHelperGLSL
178 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
182 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
186 const Ogre::MaterialPtr &_mat,
187 const Ogre::Terrain *_terrain,
bool _compositeMap);
190 const Ogre::Terrain *_terrain, TechniqueType _tt,
191 Ogre::StringUtil::StrStreamType &_outStream);
194 const Ogre::Terrain *_terrain, TechniqueType _tt,
195 Ogre::StringUtil::StrStreamType &_outStream);
198 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
200 Ogre::StringUtil::StrStreamType &_outStream);
203 const Ogre::Terrain *_terrain, TechniqueType _tt,
204 const Ogre::HighLevelGpuProgramPtr &_prog);
207 unsigned int _texCoordStart,
const SM2Profile *_prof,
208 const Ogre::Terrain *_terrain, TechniqueType _tt,
209 Ogre::StringUtil::StrStreamType &_outStream);
212 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
214 Ogre::StringUtil::StrStreamType &_outStream);
217 const Ogre::Terrain *_terrain,
219 Ogre::StringUtil::StrStreamType &_outStream);
222 const Ogre::Terrain *_terrain, TechniqueType tt,
224 Ogre::StringUtil::StrStreamType &_outStream);
227 const Ogre::Terrain *_terrain,
229 Ogre::StringUtil::StrStreamType &_outStream);
232 Ogre::uint *_texCoord, Ogre::uint *_sampler,
233 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
235 Ogre::StringUtil::StrStreamType &_outStream);
239 const Ogre::Terrain *_terrain,
241 Ogre::StringUtil::StrStreamType &_outStream);
244 const Ogre::Terrain *_terrain, TechniqueType _tt,
245 Ogre::StringUtil::StrStreamType &_outStream);
249 const Ogre::Terrain *_terrain,
251 Ogre::StringUtil::StrStreamType &_outStream);
254 const Ogre::Terrain *_terrain, TechniqueType _tt,
255 const Ogre::GpuProgramParametersSharedPtr &_params);
257 private: Ogre::String GetChannel(Ogre::uint _idx);
263 public Ogre::TerrainMaterialGeneratorA::SM2Profile::ShaderHelperCg
266 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
270 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
274 const Ogre::Terrain *_terrain, TechniqueType _tt,
275 Ogre::StringUtil::StrStreamType &_outStream);
278 const Ogre::Terrain *_terrain, TechniqueType _tt,
279 Ogre::StringUtil::StrStreamType &_outStream);
282 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
284 Ogre::StringUtil::StrStreamType &_outStream);
287 const Ogre::Terrain *_terrain, TechniqueType _tt,
288 const Ogre::HighLevelGpuProgramPtr &_prog);
291 unsigned int _texCoordStart,
const SM2Profile *_prof,
292 const Ogre::Terrain *_terrain, TechniqueType _tt,
293 Ogre::StringUtil::StrStreamType &_outStream);
296 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
298 Ogre::StringUtil::StrStreamType &_outStream);