VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOsgEffectTextureVisitor.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
15 #include <osgDB/Options>
16 
17 #include <osg/NodeVisitor>
18 #include <osg/ExtendedMaterial>
19 
20 #include <string>
21 
22 namespace makVrv
23 {
24  class DtOsgEffectTextureController;
25  class DtOsgFileCache;
26  class DtOsgShaderManager;
27  class DtEffectControllerContainer;
28 
35  class DT_DLL_VRVOSG DtOsgEffectTextureVisitor : public osg::NodeVisitor
36  {
37  public:
40 
42  DtOsgEffectTextureVisitor(DtDe& de, DtOsgFileCache&, const osgDB::Options* options);
43 
45  virtual void setDbOptions(const osgDB::Options* options);
46 
48  virtual ~DtOsgEffectTextureVisitor();
49 
52  virtual void reset();
53 
56  virtual unsigned numEffectTexturesInstalled() const;
57 
58  static const char* ignoreHint(void);
59 
60  public: // osg::NodeVisitor overrides
61 
62  void apply(osg::Node& node);
63  void apply(osg::Geode& geode);
64 
65  protected:
66 
68  void initialize();
69 
71  void apply(osg::StateSet* stateSet);
72 
74  virtual bool isEffectTexture(osg::Texture* tex, const std::string& texName) const;
75 
78  virtual bool effectTextureBelongsToBase(const std::string& baseTexName,
79  const std::string& effectTexName) const;
80 
81  //Install the effect texture, it will first trying to read the effect texture from the
82  //extended material, if it's not supported in extended material or failed to find it in extended material
83  //we try the postfix way.
84  virtual void installEffectTexture(osg::StateSet* stateSet, osg::Texture* baseTexture, int baseUnit,
85  osg::ExtendedMaterial* extendedMaterial);
86 
87  //Install the effect texture from the osg::ExtendedMaterial
88  virtual bool installExtendedEffectTexture(const DtOsgEffectTextureController* controller,
89  osg::StateSet* stateSet, osg::Texture* baseTexture, osg::Texture* effectTexture, int baseUnit, int effectUnit);
90 
91  virtual bool installExtendedEffectTexture(const DtOsgEffectTextureController* controller
92  , osg::StateSet* stateSet, osg::Texture* baseTexture, int baseUnit, osg::ExtendedMaterial* extendedMaterial);
93 
100  virtual bool installPostfixEffectTexturesFromTextureLayers(const DtOsgEffectTextureController* controller, osg::Texture* baseTex,
101  int baseTexUnit, osg::StateSet* stateSet);
102 
109  virtual bool installPostfixEffectTexturesFromFileSystem(const DtOsgEffectTextureController* controller, osg::Texture* baseTex,
110  int baseTexUnit, osg::StateSet* stateSet);
111 
115  virtual bool checkForGlassMaterial(osg::StateSet* stateSet);
116 
117  protected:
118  unsigned myCount;
119 
122 
124 
126 
127  static const char* theIgnoreHint;
128 
130  };
131 }
A thread safe cache containing a list of possible file names for effect textures, based on the curren...
Definition: DtPossibleFileNamesCache.h:27
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtPossibleFileNamesCache myPossibleFileNamesCache
Definition: DtOsgEffectTextureVisitor.h:123
DtOsgFileCache & myFileCache
Definition: DtOsgEffectTextureVisitor.h:121
DtDe & myDe
Definition: DtOsgEffectTextureVisitor.h:129
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive&#39;s for quicker load ti...
Definition: DtOsgFileCache.h:56
Contains the DtPossibleFileNamesCache class.
Base class for controllers that install and control effect textures.
Definition: DtOsgEffectTextureController.h:44
osg::ref_ptr< const osgDB::Options > myDbOptions
Definition: DtOsgEffectTextureVisitor.h:120
static const char * theIgnoreHint
Definition: DtOsgEffectTextureVisitor.h:127
unsigned myCount
Definition: DtOsgEffectTextureVisitor.h:118
Contains DLL export macros.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
Definition: DtEffectControllerContainer.h:22
Visitor that locates effect textures and installs them into the scene graph. Run this prior to runnin...
Definition: DtOsgEffectTextureVisitor.h:35
DtEffectControllerContainer & myEffectControllerContainer
Definition: DtOsgEffectTextureVisitor.h:125

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)