VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtOsgEffectTextureController.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvOsg/vrvOsg.h>
12 #include <osg/Referenced>
13 #include <osgDB/Options>
14 #include <string>
15 #include <vector>
16 
17 namespace osg
18 {
19  class StateSet;
20  class Texture;
21 }
22 namespace osgEarth
23 {
24  class VirtualProgram;
25 }
26 
27 namespace makVrv
28 {
31  class DT_DLL_VRVOSG DtOsgEffectTextureController : public osg::Referenced
32  {
33  public:
36 
37  public: // Implementation methods
38 
40  virtual std::string getEffectTypeCode() const =0;
41 
43  virtual osg::Texture* installEffectTexture(osg::Texture* baseTexture, int texUnit, osg::StateSet* stateSet, const osgDB::Options* dbOptions);
44 
46  virtual bool generateShaders(int baseUnit, int effectUnit, osg::Texture* tex, osg::StateSet* stateSet) { return true; }
47 
48  public: // Utility methods
49 
51  virtual bool isEffectTexture(osg::Texture* tex) const;
52 
55  virtual bool effectTextureInstalled(osg::Texture* baseTexture, osg::StateSet* stateSet) const; protected:
56 
57  // find the file path for a texture.
58  std::string getTextureFilePath(osg::Texture* texture) const;
59 
60  // find the extended name for a texture file.
61  std::string getExtendedFileName(const std::string& baseFileName) const;
62 
63  // Given the file name of a base texture, populate the output
64  // vector with possible file names for corresponding effect textures.
65  void getPossibleEffectTextureFileNames(const std::string& baseFileName, std::vector<std::string>& output) const;
66 
67  protected:
68 
69  std::string myVertSource;
70  std::string myFragSource;
72 
75 
76  // applies default shader LOD ranges, if applicable
77  void applyDefaultShaderLODRanges(osgEarth::VirtualProgram* vp, const std::string& function) const;
78 
80  std::string myShaderFolderPath;
81  };
82 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)