VR-Engage  2.2
Loading...
Searching...
No Matches
vreOsgHudEffectTextureController.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file vreOsgHudEffectTextureController.h
7//! \brief Defines the HUD-specific texture effect controller for VR-Engage
8//!
9//! This file contains the DtVreOsgHudEffectTextureController class which provides
10//! specialized texture effect control for Heads-Up Display (HUD) elements in the
11//! VR-Engage visualization system. It allows for applying shader-based effects
12//! specifically tailored for HUD rendering.
13
14#pragma once
15
17
18#include <vrvOsg/DtOsgEffectTextureController.h>
19#include <vrvOsg/DtOsgRenderer.h>
20#include <vrvOsg/DtEffectControllerCreatorTemplate.h>
21
22namespace makVre
23{
24//! \brief Controller for HUD-specific texture effects in OSG rendering
25//!
26//! DtVreOsgHudEffectTextureController manages texture effects specifically
27//! designed for Heads-Up Display (HUD) elements in the visualization system.
28//! Based on VR-Vantage's exampleEffectTexturePlugin, it provides specialized
29//! shader and texture management tailored for optimal HUD rendering, including
30//! features like transparency handling and overlay positioning.
31class PLAYERSTATION_DLL DtVreOsgHudEffectTextureController : public makVrv::DtOsgEffectTextureController
32{
33public:
34 //! \brief Constructor
35 //! \param de Reference to the display engine
36 //!
37 //! Creates a new HUD-specific effect texture controller for the specified
38 //! display engine. This controller is preconfigured with appropriate shaders
39 //! and parameters for HUD rendering.
41
42 //! \brief Virtual destructor
43 //!
44 //! Ensures proper cleanup of HUD effect texture controller resources.
46
47 //! \brief Installs the HUD effect shaders into a state set
48 //! \param baseUnit Base texture unit index
49 //! \param effectUnit Effect texture unit index
50 //! \param tex Pointer to the effect texture
51 //! \param stateSet State set to install the shaders into
52 //! \param baseTextureName Name of the base texture sampler
53 //! \return True if shaders were installed successfully, false otherwise
54 //!
55 //! Installs the HUD-specific effect shaders into the provided state set,
56 //! configuring the necessary uniforms and texture units for the effect.
57 //! This implementation includes special handling for HUD rendering, such as
58 //! proper transparency and overlay positioning.
59 virtual bool installShaders(int baseUnit, int effectUnit, const osg::Texture* tex, osg::StateSet* stateSet,
60 const std::string& baseTextureName) const override;
61
62 //! \brief Globally enables or disables HUD effects
63 //! \param enabled True to enable HUD effects, false to disable
64 //!
65 //! Static method that controls whether HUD effects are globally enabled
66 //! or disabled. This affects all instances of HUD effect controllers in
67 //! the application.
68 static void setEnabled(bool enabled);
69
70private:
71 //! \brief Shared uniform for enabling/disabling HUD effect textures
72 //!
73 //! Static uniform that controls whether HUD effect textures are enabled globally.
74 //! This allows for toggling all HUD effects with a single uniform value.
75 static osg::ref_ptr<osg::Uniform> effectEnabledUniform;
76};
77
78//! \brief Factory creator for HUD effect texture controllers
79//!
80//! DtVreOsgHudEffectTextureControllerCreator is a factory class that creates
81//! HUD-specific effect texture controller instances for registration with the
82//! DtEffectControllerFactory. This allows the HUD effect controllers to be
83//! created on demand using the factory pattern.
84class PLAYERSTATION_DLL DtVreOsgHudEffectTextureControllerCreator : public makVrv::DtEffectControllerCreator
85{
86public:
87 //! \brief Creates a new HUD effect texture controller
88 //! \param de Reference to the display engine
89 //! \return Pointer to a newly created HUD effect texture controller
90 //!
91 //! Factory method that creates a new HUD effect texture controller
92 //! instance for the specified display engine.
93 virtual DtVreOsgHudEffectTextureController* create(makVrv::DtDe& de) override;
94};
95} // namespace makVre
Factory creator for HUD-specific effect texture controllers.
Definition vreOsgEffectTextureController.h:142
virtual DtVreOsgHudEffectTextureController * create(makVrv::DtDe &de) override
Creates a new HUD effect texture controller.
Controller for HUD-specific texture effects in OSG rendering.
Definition vreOsgHudEffectTextureController.h:32
static osg::ref_ptr< osg::Uniform > effectEnabledUniform
Shared uniform for enabling/disabling HUD effect textures.
Definition vreOsgHudEffectTextureController.h:75
virtual ~DtVreOsgHudEffectTextureController() override
Virtual destructor.
virtual bool installShaders(int baseUnit, int effectUnit, const osg::Texture *tex, osg::StateSet *stateSet, const std::string &baseTextureName) const override
Installs the HUD effect shaders into a state set.
DtVreOsgHudEffectTextureController(makVrv::DtDe &de)
Constructor.
static void setEnabled(bool enabled)
Globally enables or disables HUD effects.
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.