VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EffectMapTerrainEffect.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright(c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #ifndef OSGEARTH_EFFECTMAP_TERRAIN_EFFECT_H
10 #define OSGEARTH_EFFECTMAP_TERRAIN_EFFECT_H
11 
12 #include <osgEarth/TerrainEffect>
13 #include <osgEarth/ImageLayer>
14 #include <osg/Image>
15 #include <osg/Uniform>
16 #include <osg/Texture2D>
17 
19 
20 using namespace osgEarth;
21 
22 
23 namespace osgEarth
24 {
25  namespace EffectMap
26  {
31  {
32  public:
34  EffectMapTerrainEffect(const osgDB::Options* dbOptions, int effectMapId, const EffectMapOptions& effectMapOptions);
35 
36  protected:
39 
40  public: // TerrainEffect interface
42  void onInstall(TerrainEngineNode* engine);
43 
45  void onUninstall(TerrainEngineNode* engine);
46 
47  protected:
49  virtual std::string generateShareTexUniformNameShaderString();
50 
52  virtual std::string generateShareTexMatUniformNameShaderString();
53 
55  virtual std::string generateEffectMapFragShaderString();
56 
57  protected:
58  std::string myFragmentName;
59  unsigned int myEffectMapId;
64  };
65 
66  } // namespace osgEarth:EffectMap
67 }
68 
69 #endif // OSGEARTH_EFFECTMAP_TERRAIN_EFFECT_H
virtual std::string generateShareTexUniformNameShaderString()
create a texture uniform name based on the effectMapId
std::string myFragmentName
Definition: EffectMapTerrainEffect.h:58
virtual std::string generateEffectMapFragShaderString()
create a texture read command based on the effectMapId
float myFadeMaxRange
Definition: EffectMapTerrainEffect.h:61
void onUninstall(TerrainEngineNode *engine)
remove the virtual program for this effect map from the engine
EffectMapOptions::EffectType myEffectType
Definition: EffectMapTerrainEffect.h:60
unsigned int myEffectMapId
Definition: EffectMapTerrainEffect.h:59
void onInstall(TerrainEngineNode *engine)
setup the virtual program package and uniforms to load based on the effect type
float myFadeAttenuationDistance
Definition: EffectMapTerrainEffect.h:62
Effect that applies effect mapping to the terrain.
Definition: EffectMapTerrainEffect.h:30
effect map earth file options
EffectType
Definition: EffectMapOptions.h:30
Options governing effect mapping of the terrain.
Definition: EffectMapOptions.h:27
EffectMapTerrainEffect(const osgDB::Options *dbOptions, int effectMapId, const EffectMapOptions &effectMapOptions)
construct a new terrain effect.
float mySpecMapShininess
Definition: EffectMapTerrainEffect.h:63
virtual std::string generateShareTexMatUniformNameShaderString()
create a texture matrix uniform name based on the effectMapId
virtual ~EffectMapTerrainEffect()
Destructor.
Definition: EffectMapTerrainEffect.h:38

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)