13 #include <osg/Texture2D>
15 class diguyOsgTextureAttribute;
46 virtual void build()
override;
49 virtual void unbuild()
override;
50 virtual void show()
override;
51 virtual void hide()
override;
59 static void set_use_pixel_lods(
bool use_pixel_lods) {s_use_pixel_lods = use_pixel_lods;}
65 virtual void update()
override;
77 std::vector<osg::Geode*> m_geodes;
79 osg::StateSet* get_state_set() {
return m_state_set.get(); }
80 friend class diguyNameTextureDrawCallback;
84 void create_shared_variation_texture();
85 void create_variation_texture(
unsigned char * variation_texture_data);
86 void create_name_texture();
91 osg::ref_ptr<osg::Switch> m_switch_node;
97 osg::ref_ptr<osg::LOD> m_lod_node;
99 static bool s_use_pixel_lods;
102 osg::ref_ptr<osg::StateSet> m_state_set;
103 osg::ref_ptr<osg::Uniform> m_ufrm_link_matrix;
104 osg::ref_ptr<osg::Uniform> m_ufrm_link_matrices;
105 osg::ref_ptr<osg::Uniform> m_ufrm_link_colors;
106 osg::ref_ptr<osg::Uniform> m_ufrm_component_map_row;
107 osg::ref_ptr<osg::Uniform> m_ufrm_decal_index;
108 osg::ref_ptr<osg::Uniform> m_ufrm_lod_fade;
109 osg::ref_ptr<osg::Uniform> m_ufrm_blend_weights;
110 osg::ref_ptr<osg::Uniform> m_ufrm_blend_indices;
111 std::vector< diguyOsgMeshOffsets> m_offset_array;
112 unsigned int m_name_texture_object;
113 bool m_needs_texture_update;
114 diguyOsgTextureAttribute * m_name_attribute;
118 static osg::ref_ptr<osg::Texture2D> sm_variation_texture;
osg::Matrixf m_offset
Definition: diguyOsgGraphicsShape.h:24
diguyOsgGraphicsShape(void *internal_data)
virtual void set_graphics_lod(int lod) override
This function will be called by DI-Guy when the LOD of this link is "manually" set by a diguyCharacte...
virtual void set_graphics_lod_ranges(float *lod_ranges) override
This function will be called by DI-Guy when the LOD ranges of this shape need to be updated after the...
diguyGraphicsShape * diguyOsgGraphicsShape_create_func(void *internal_data)
Create function declaration.
virtual void update() override
This function will be called by DI-Guy when it is time for renderer-specific shape objects created du...
virtual void update_name_texture() override
creates a decal texture with a name (accessed by get_decal_text()) see sample implementation for a re...
virtual void unbuild() override
This function will be called by DI-Guy when it is time for the renderer-specific shape objects create...
virtual void instancing_state_changed(int val) override
static const char * s_ufrm_link_colors_string
Definition: diguyOsgGraphicsShape.h:72
virtual ~diguyOsgGraphicsShape()
static void set_use_pixel_lods(bool use_pixel_lods)
Definition: diguyOsgGraphicsShape.h:57
Shapes are the high-level containers of visible geometry.
Definition: diguyOsgGraphicsShape.h:38
virtual void build() override
This function will be called by DI-Guy when it is time for renderer-specific shape objects to be crea...
virtual void show() override
This function will be called by DI-Guy when the shape should be shown, typically due to a change in t...
static const char * s_ufrm_link_matrices_string
Definition: diguyOsgGraphicsShape.h:71
Helper struct for storing offsets for more complex meshes.
Definition: diguyOsgGraphicsShape.h:21
A class that represents the unique per-character non-shared mesh object. DI-Guy encapsulates its text...
Definition: diguyGraphicsShape.h:49
virtual void hide() override
This function will be called by DI-Guy when the shape should be hidden, typically due to a change in ...
virtual void update_variation_texture(int num_pixels, unsigned char *pixel_data) override
Pushes a char * pixel buffer of length num_pixels that represents the unique per shape texture...
osg::ref_ptr< osg::Uniform > m_ufrm_link_matrix
Definition: diguyOsgGraphicsShape.h:23
This class implements shader lod system for use with DI-Guy character graphics.
Definition: diguyGraphicsShaderTechnique.h:153