16 #include <boost/unordered_map.hpp>
18 #include <osg/observer_ptr>
22 #include <matrix/vlVector.h>
39 class DtOsgLightsObserver;
72 virtual void initialize();
76 virtual void attachToStateSet(osg::StateSet* stateSet);
79 virtual void setPerPixelLightingEnabled(
bool enabled);
82 virtual bool perPixelLightingEnabled()
const;
88 virtual void setReservedID(
int id);
91 virtual int reservedID()
const;
95 virtual void cullReset();
98 virtual bool registerLight(
const osg::LightSource* light,
const osg::NodePath& nodePath,
const osg::Matrixd& modelingMatrix,
bool globalLights);
102 virtual DtLight* createDtLight(
const osg::Light* osgLight);
105 virtual void convertOsgLightToDtLight(
const osg::LightSource& lightSource,
DtLight* pDtLight,
const osg::Matrixd& modelingMatrix);
108 virtual void deregisterLight(
const osg::LightSource* light);
111 virtual void getWorldPositionAndDirection(
const osg::LightSource& lightSource,
const osg::Matrixd& modelingMatrix, osg::Vec3d& vWorldPos, osg::Vec3d& vWorldDir)
const;
114 virtual void update(osg::State& state,
DtDe& de,
const osg::Camera* camera);
117 virtual int getTextureStartOffset(
void)
const;
126 virtual void releaseGLObjects(
void);
129 virtual unsigned int getOrCreateLightSourceTypeId(
DtLight* pDtLight);
132 virtual unsigned int getOrCreateLightSourceTypeId(
const osg::LightSource& lightSource);
136 virtual unsigned int getOrCreateDynamicLightSourceTypeId(
const DtLight* pDtLight);
139 virtual void deleteDynamicLightSourceTypeId(
const DtLight* pDtLight);
146 virtual void updateLightSourceType(
unsigned int id,
const DtLight* light);
159 static const std::string& theClassName();
162 static LightType lightType(
const osg::Light* light);
166 virtual void updateLightOnOffStatus(
const VectorLights& lights);
171 virtual void updateFixedFunctionLights(
const osg::State& state);
177 virtual void updateShaderBasedLights(
const osg::State& state,
const VectorLights& lights,
const osg::Camera* camera);
179 virtual const VectorLights& computeFrustumLights(
const osg::State &state,
const osg::Camera* camera);
181 virtual void proccessLightPath(
DtLight* inLight,
const osg::NodePath& nodePath);
183 virtual void configurePerPixelLighting(osg::StateSet*);
185 virtual void slot_reloadShader();
187 virtual bool existsInLightManager(
const DtLight* light)
const;
DtLightManager * myLightManager
Definition: DtOsgLightManager.h:204
LightManager class which allows creation/deletion of lights.
Definition: DtLightManager.h:30
Virtual base class.
Definition: DtVirtualBaseClass.h:19
DtDe & myDe
Definition: DtOsgLightManager.h:191
MapLightSourceHashToLights myMapLightSourceHashToLights
Definition: DtOsgLightManager.h:209
DtOsgLightsObserver * myOsgLightsObserver
Definition: DtOsgLightManager.h:211
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Definition: featureContext.h:37
bool myPerPixelLightingEnabled
Definition: DtOsgLightManager.h:196
An OSG implementation of the sky.
Definition: DtOsgSkyObject.h:28
boost::unordered_map< size_t, LightSourceAndLight > MapLightSourceHashToLights
Definition: DtOsgLightManager.h:208
bool myInitialized
Definition: DtOsgLightManager.h:192
osg::observer_ptr< osg::StateSet > myStateSet
Definition: DtOsgLightManager.h:201
MapLightSourceTypeToLightID myLightSourceTypeMap
Definition: DtOsgLightManager.h:214
LightType
Definition: DtLight.h:34
VectorLights myActiveLights
Definition: DtOsgLightManager.h:202
DtOsgLightManager receives LightSource nodes from the DtOsgCullVisitor, and collects them all here wh...
Definition: DtOsgLightManager.h:49
int myReservedID
Definition: DtOsgLightManager.h:194
bool myDebugCallbackInitialized
Definition: DtOsgLightManager.h:193
boost::mutex myMutableLightSourceTypeMutex
Definition: DtOsgLightManager.h:218
LightReusableVector myLightSourceTypeLightVector
Definition: DtOsgLightManager.h:215
Contains the DtOsgLightingComponent class.
Contains makVrv::DtReusableMemoryVector class.
Class for generic lights This holds per-light data such as range, attenuation factors, colors, etc.
Definition: DtLight.h:52
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
std::map< size_t, unsigned int > MapLightSourceTypeToLightID
Definition: DtOsgLightManager.h:213
Contains makVrv::DtOsgShaderManager class.
osg::ref_ptr< DtOsgLightingComponent > myLightingComponent
Definition: DtOsgLightManager.h:198
std::pair< const osg::LightSource *, const makVrv::DtLight * > LightSourceAndLight
Definition: DtOsgLightManager.h:206
State component that injects lighting shaders and uniforms into a state set.
Definition: DtOsgLightingComponent.h:62