17 #ifndef _GAZEBO_RENDERING_HEIGHTMAPPRIVATE_HH_ 18 #define _GAZEBO_RENDERING_HEIGHTMAPPRIVATE_HH_ 22 #include <boost/filesystem.hpp> 24 #include <ignition/math/Vector3.hh> 32 class TerrainGlobalOptions;
56 public Ogre::TerrainMaterialGeneratorA::SM2Profile
59 public:
SM2Profile(Ogre::TerrainMaterialGenerator *_parent,
60 const Ogre::String &_name,
const Ogre::String &_desc);
65 public: Ogre::MaterialPtr generate(
const Ogre::Terrain *_terrain);
67 public: Ogre::MaterialPtr generateForCompositeMap(
68 const Ogre::Terrain *_terrain);
70 public:
void UpdateParams(
const Ogre::MaterialPtr &_mat,
71 const Ogre::Terrain *_terrain);
73 public:
void UpdateParamsForCompositeMap(
const Ogre::MaterialPtr &_mat,
74 const Ogre::Terrain *_terrain);
76 protected:
virtual void addTechnique(
const Ogre::MaterialPtr &_mat,
77 const Ogre::Terrain *_terrain, TechniqueType _tt);
80 #pragma clang diagnostic push 81 #pragma clang diagnostic ignored "-Woverloaded-virtual" 82 #endif // ifdef __clang__ 88 public Ogre::TerrainMaterialGeneratorA::SM2Profile::ShaderHelperGLSL
90 public:
virtual Ogre::HighLevelGpuProgramPtr generateVertexProgram(
91 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
94 public:
virtual Ogre::HighLevelGpuProgramPtr generateFragmentProgram(
95 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
98 public:
virtual void updateParams(
const SM2Profile *_prof,
99 const Ogre::MaterialPtr &_mat,
100 const Ogre::Terrain *_terrain,
bool _compositeMap);
102 protected:
virtual void generateVpHeader(
const SM2Profile *_prof,
103 const Ogre::Terrain *_terrain, TechniqueType _tt,
104 Ogre::StringStream &_outStream);
106 protected:
virtual void generateVpFooter(
const SM2Profile *_prof,
107 const Ogre::Terrain *_terrain, TechniqueType _tt,
108 Ogre::StringStream &_outStream);
110 protected:
virtual void generateVertexProgramSource(
111 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
113 Ogre::StringStream &_outStream);
115 protected:
virtual void defaultVpParams(
const SM2Profile *_prof,
116 const Ogre::Terrain *_terrain, TechniqueType _tt,
117 const Ogre::HighLevelGpuProgramPtr &_prog);
119 protected:
virtual unsigned int generateVpDynamicShadowsParams(
120 unsigned int _texCoordStart,
const SM2Profile *_prof,
121 const Ogre::Terrain *_terrain, TechniqueType _tt,
122 Ogre::StringStream &_outStream);
124 protected:
virtual void generateVpDynamicShadows(
125 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
127 Ogre::StringStream &_outStream);
129 protected:
virtual void generateFpHeader(
const SM2Profile *_prof,
130 const Ogre::Terrain *_terrain,
132 Ogre::StringStream &_outStream);
134 protected:
virtual void generateFpLayer(
const SM2Profile *_prof,
135 const Ogre::Terrain *_terrain, TechniqueType tt,
137 Ogre::StringStream &_outStream);
139 protected:
virtual void generateFpFooter(
const SM2Profile *_prof,
140 const Ogre::Terrain *_terrain,
142 Ogre::StringStream &_outStream);
144 protected:
virtual void generateFpDynamicShadowsParams(
145 Ogre::uint *_texCoord, Ogre::uint *_sampler,
146 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
148 Ogre::StringStream &_outStream);
150 protected:
virtual void generateFpDynamicShadowsHelpers(
152 const Ogre::Terrain *_terrain,
154 Ogre::StringStream &_outStream);
156 protected:
void generateFpDynamicShadows(
const SM2Profile *_prof,
157 const Ogre::Terrain *_terrain, TechniqueType _tt,
158 Ogre::StringStream &_outStream);
160 protected:
virtual void generateFragmentProgramSource(
162 const Ogre::Terrain *_terrain,
164 Ogre::StringStream &_outStream);
166 protected:
virtual void updateVpParams(
const SM2Profile *_prof,
167 const Ogre::Terrain *_terrain, TechniqueType _tt,
168 const Ogre::GpuProgramParametersSharedPtr &_params);
170 private: Ogre::String GetChannel(Ogre::uint _idx);
181 public Ogre::TerrainMaterialGeneratorA::SM2Profile::ShaderHelperCg
183 public:
virtual Ogre::HighLevelGpuProgramPtr generateFragmentProgram(
184 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
187 public:
virtual Ogre::HighLevelGpuProgramPtr generateVertexProgram(
188 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
191 protected:
virtual void generateVpHeader(
const SM2Profile *_prof,
192 const Ogre::Terrain *_terrain, TechniqueType _tt,
193 Ogre::StringStream &_outStream);
195 protected:
virtual void generateVpFooter(
const SM2Profile *_prof,
196 const Ogre::Terrain *_terrain, TechniqueType _tt,
197 Ogre::StringStream &_outStream);
199 protected:
virtual void generateVertexProgramSource(
200 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
202 Ogre::StringStream &_outStream);
204 protected:
virtual void defaultVpParams(
const SM2Profile *_prof,
205 const Ogre::Terrain *_terrain, TechniqueType _tt,
206 const Ogre::HighLevelGpuProgramPtr &_prog);
208 protected:
virtual unsigned int generateVpDynamicShadowsParams(
209 unsigned int _texCoordStart,
const SM2Profile *_prof,
210 const Ogre::Terrain *_terrain, TechniqueType _tt,
211 Ogre::StringStream &_outStream);
213 protected:
virtual void generateVpDynamicShadows(
214 const SM2Profile *_prof,
const Ogre::Terrain *_terrain,
216 Ogre::StringStream &_outStream);
224 #pragma clang diagnostic pop bool terrainsImported
True if the terrain was imported.
Definition: HeightmapPrivate.hh:317
bool useTerrainPaging
Flag that enables/disables the terrain paging.
Definition: HeightmapPrivate.hh:360
int terrainIdx
Used to iterate over all the terrains.
Definition: HeightmapPrivate.hh:357
Definition: HeightmapPrivate.hh:267
Forward declarations for the common classes.
Definition: Animation.hh:33
bool unloadProceduralPage(Ogre::Page *, Ogre::PagedWorldSection *)
Give a provider the opportunity to unload page content procedurally.
Definition: HeightmapPrivate.hh:251
std::vector< std::string > diffuseTextures
The diffuse textures.
Definition: HeightmapPrivate.hh:320
Ogre::TerrainPaging * terrainPaging
Type of paging applied.
Definition: HeightmapPrivate.hh:348
static const double loadRadiusFactor
The terrain pages are loaded if the distance from the camera is within the loadRadius.
Definition: HeightmapPrivate.hh:276
static const boost::filesystem::path hashFilename
Hash file name that should be present for every terrain file loaded using paging. ...
Definition: HeightmapPrivate.hh:287
std::vector< std::string > normalTextures
The normal textures.
Definition: HeightmapPrivate.hh:323
std::vector< double > blendHeight
The material blending heights.
Definition: HeightmapPrivate.hh:329
std::vector< double > worldSizes
The size of the world sections.
Definition: HeightmapPrivate.hh:326
static const unsigned int numTerrainSubdivisions
Number of pieces in which a terrain is subdivided for paging.
Definition: HeightmapPrivate.hh:270
unsigned int dataSize
Size of the heightmap data.
Definition: HeightmapPrivate.hh:305
ScenePtr scene
The scene.
Definition: HeightmapPrivate.hh:299
std::vector< std::vector< float > > subTerrains
Collection of terrains. Every terrain might be paged.
Definition: HeightmapPrivate.hh:354
Shader model 2 profile target.
Definition: HeightmapPrivate.hh:55
std::vector< float > heights
The raw height values received from physics.
Definition: HeightmapPrivate.hh:335
Ogre::TerrainGroup * terrainGroup
Group of terrains.
Definition: HeightmapPrivate.hh:314
Ogre::TerrainGlobalOptions * terrainGlobals
Global options.
Definition: HeightmapPrivate.hh:311
DummyPageProvider dummyPageProvider
A page provider is needed to use the paging system.
Definition: HeightmapPrivate.hh:341
friend ShaderHelperGLSL
Definition: HeightmapPrivate.hh:175
bool terrainHashChanged
True if the terrain's hash does not match the image's hash.
Definition: HeightmapPrivate.hh:363
bool loadProceduralPage(Ogre::Page *, Ogre::PagedWorldSection *)
Give a provider the opportunity to load page content procedurally.
Definition: HeightmapPrivate.hh:244
static const double holdRadiusFactor
The terrain pages are held in memory but not loaded if they are not ready when the camera is within h...
Definition: HeightmapPrivate.hh:283
GzTerrainMatGen * gzMatGen
Pointer to the terrain material generator.
Definition: HeightmapPrivate.hh:338
bool prepareProceduralPage(Ogre::Page *, Ogre::PagedWorldSection *)
Give a provider the opportunity to prepare page content procedurally.
Definition: HeightmapPrivate.hh:237
ignition::math::Vector3d terrainSize
Size of the terrain.
Definition: HeightmapPrivate.hh:302
static const boost::filesystem::path pagingDirname
Name of the top level directory where all the paging info is stored.
Definition: HeightmapPrivate.hh:291
Ogre::PageManager * pageManager
Central registration point for extension classes, such as the PageStrategy, PageContentFactory.
Definition: HeightmapPrivate.hh:345
Definition: JointMaker.hh:41
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:80
std::vector< double > blendFade
Material blend fade distances.
Definition: HeightmapPrivate.hh:332
friend ShaderHelperCg
Definition: HeightmapPrivate.hh:221
ignition::math::Vector3d terrainOrigin
Origin of the terrain.
Definition: HeightmapPrivate.hh:308
Utility class to help with generating shaders for GLSL.
Definition: HeightmapPrivate.hh:87
Definition: HeightmapPrivate.hh:46
Keeping the CG shader for reference.
Definition: HeightmapPrivate.hh:180
boost::filesystem::path gzPagingDir
When the terrain paging is enabled, the terrain information for every piece of terrain is stored in d...
Definition: HeightmapPrivate.hh:296
Definition: HeightmapPrivate.hh:233
Ogre::PagedWorld * world
Collection of world content.
Definition: HeightmapPrivate.hh:351
bool unprepareProceduralPage(Ogre::Page *, Ogre::PagedWorldSection *)
Give a provider the opportunity to unprepare page content procedurally.
Definition: HeightmapPrivate.hh:259