OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MultipassTechnique.h
Go to the documentation of this file.
1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
2  *
3  * This library is open source and may be redistributed and/or modified under
4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5  * (at your option) any later version. The full license is in LICENSE file
6  * included with this distribution, and on the openscenegraph.org website.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * OpenSceneGraph Public License for more details.
12 */
13 
14 #ifndef OSGVOLUME_MULTIPASSTECHNIQUE
15 #define OSGVOLUME_MULTIPASSTECHNIQUE 1
16 
17 #include <osgVolume/VolumeTechnique>
18 #include <osg/MatrixTransform>
19 
20 namespace osgVolume {
21 
22 
23 
25 {
26  public:
27 
29 
31 
33 
34  virtual void init();
35 
36  virtual void update(osgUtil::UpdateVisitor* nv);
37 
38  virtual void backfaceSubgraphCullTraversal(osgUtil::CullVisitor* cv);
39 
40  virtual void cull(osgUtil::CullVisitor* cv);
41 
43  virtual void cleanSceneGraph();
44 
46  virtual void traverse(osg::NodeVisitor& nv);
47 
49  {
52  CUBE_AND_HULL
53  };
54 
55  RenderingMode computeRenderingMode();
56 
59  {
61 
62  virtual void update(osgUtil::CullVisitor* cv);
63 
64  void setUp(osg::ref_ptr<osg::Camera>& camera, osg::ref_ptr<osg::Texture2D>& texture2D, int width, int height);
65 
66 
69 
72 
75 
78  };
79 
82  virtual TileData* createTileData(osgUtil::CullVisitor* cv) { return new MultipassTileData(cv, this); }
83 
84  protected:
85 
86  virtual ~MultipassTechnique();
87 
89 
90  typedef std::map<osgUtil::CullVisitor::Identifier*, osg::Matrix> ModelViewMatrixMap;
91 
93  ModelViewMatrixMap _modelViewMatrixMap;
94 
97 
98  osg::StateSet* createStateSet(osg::StateSet* statesetPrototype, osg::Program* programPrototype, osg::Shader* shaderToAdd1=0, osg::Shader* shaderToAdd2=0);
99 
101  {
102  CUBE_SHADERS = 1,
103  HULL_SHADERS = 2,
104  CUBE_AND_HULL_SHADERS = 4,
105  STANDARD_SHADERS = 8,
106  LIT_SHADERS = 16,
107  ISO_SHADERS = 32,
108  MIP_SHADERS = 64,
109  TF_SHADERS = 128
110  };
111 
112  typedef std::map<int, osg::ref_ptr<osg::StateSet> > StateSetMap;
113  StateSetMap _stateSetMap;
114 
116 };
117 
118 }
119 
120 #endif
osg::ref_ptr< osg::MatrixTransform > _transform
std::map< int, osg::ref_ptr< osg::StateSet > > StateSetMap
This class provides an object-oriented thread mutex interface.
Definition: Mutex.h:31
ModelViewMatrixMap _modelViewMatrixMap
osg::ref_ptr< osg::StateSet > _whenMovingStateSet
osg::observer_ptr< MultipassTechnique > multipassTechnique
#define OSGVOLUME_EXPORT
Definition: Export.h:39
osg::ref_ptr< osg::StateSet > _volumeRenderStateSet
std::map< osgUtil::CullVisitor::Identifier *, osg::Matrix > ModelViewMatrixMap
osg::ref_ptr< osg::StateSet > _frontFaceStateSet
osg::ref_ptr< osg::Texture2D > frontFaceDepthTexture
#define META_Object(library, name)
Definition: Object.h:42
GLint GLenum GLsizei width
Definition: GLU.h:71
virtual TileData * createTileData(osgUtil::CullVisitor *cv)
GLint GLenum GLsizei GLsizei height
Definition: GLU.h:71
osg::ref_ptr< osg::Texture2D > backFaceDepthTexture