DI-Guy C++ SDK Reference  13.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
diguyOsgGraphicsInstanceGroup.h
Go to the documentation of this file.
1 
2 /*********************************************************************
3  ** Copyright (c) 1992-2014 VT MAK
4  ** All rights reserved.
5  *********************************************************************/
6 
7 #ifndef __diguyOsgGraphicsInstanceGroup_H
8 #define __diguyOsgGraphicsInstanceGroup_H
9 
10 #include <osg/Version>
11 
12 /*
13  * Note: Requires OSG 3.2 or greater for texture buffer object support.
14  */
15 #if OSG_MIN_VERSION_REQUIRED(3,2,0)
16 
18 #include <osg/Geode>
19 #include <osg/TextureBuffer>
20 
21 /*********************************************************************/
30 class diguyOsgGraphicsInstanceGroup : public diguyGraphicsInstanceGroup
31 {
32 public:
33  diguyOsgGraphicsInstanceGroup(void* internal_data);
34 
35  virtual void build();
36  virtual void unbuild();
37  virtual void update();
38 
39 private:
40  void build_tbo_per_group();
41  void build_shared_tbo();
42 
43  void update_tbo_per_group();
44  void update_shared_tbo();
45 
46  // Shared tbo
47  static osg::ref_ptr<osg::Image> s_image;
48  static osg::ref_ptr<osg::Group> s_instancing_node;
49 
50  // tbo per group
51  osg::ref_ptr<osg::Image> m_image;
52 
53  osg::ref_ptr<osg::Geode> m_geode;
54  osg::ref_ptr<osg::Geometry> m_geometry;
55  osg::ref_ptr<osg::PrimitiveSet> m_primitiveSet;
56 
57  osg::ref_ptr<osg::TextureBuffer> m_texture_buffer;
58 
59  osg::ref_ptr<osg::Uniform> ufrm_link_matrices_start;
60  osg::ref_ptr<osg::Uniform> ufrm_link_matrices_count;
61 };
62 
63 diguyGraphicsInstanceGroup* diguyOsgGraphicsInstanceGroup_create_func(void* internal_data);
64 #endif // OSG_MIN_VERSION_REQUIRED(3,2,0)
65 
66 #endif __diguyOsgGraphicsInstanceGroup_H