17 #include <osg/Uniform>
18 #include <osg/Texture2D>
21 #include <boost/array.hpp>
34 class DtTileSpaceLightGrid;
35 class DtGlSimpleTexture;
37 class DtGlTextureBufferObject;
40 class TextureApplyAttribute;
41 class TextureBufferObjectApplyAttribute;
42 class DtUniformBufferObjectApplyAttribute;
43 class DtShaderStorageBufferApplyAttribute;
68 virtual void update(
const VectorLights& lights,
const osg::State& state);
71 virtual void setMaxLights(
int maxNumLights);
77 virtual osg::Uniform* getEnableLightingUniform()
const;
80 virtual void setAmbientFactor(
float ambientFactor);
83 virtual void setUseGlobalAmbient(
bool useGlobalAmbient);
86 virtual void setDiffuseFactor(
float diffuseFactor);
89 virtual void setUseGlobalDiffuse(
bool useGlobalDiffuse);
92 virtual void setUseHDR(
bool useHDR);
95 virtual void setDirty(
bool isDirty) { myDirty = isDirty; }
98 virtual void setEmissionFactor(
float emissionFactor);
101 virtual bool dirty()
const {
return myDirty; }
103 virtual void releaseGLObjects(
void);
107 virtual bool install(osg::StateSet* stateset);
110 virtual bool uninstall(osg::StateSet* stateset);
113 static int textureStartOffset(
void);
116 virtual void setLightPointScale(
double scale);
117 virtual void setDynamicLightScale(
double scale);
118 virtual void setEmissiveTextureScale(
double scale);
119 virtual void setSpecularScale(
double scale);
120 virtual void setShininessScale(
double scale);
124 virtual void packLights(
const osg::Matrixd& normalMatrix,
const VectorLights& lights,
const osg::State& state);
125 virtual void updateTextureLightDataGrid(
void);
126 virtual void updateTiledShadingData(
const VectorLights& lights,
const osg::State& state);
129 virtual void updateTileLightIndexList();
131 virtual void updateTileLightGridCountOffsets();
134 virtual int lightGridSize();
136 virtual int maxUboSize();
149 boost::array<DtGlBuffer*, DtBindingManager::theLightBlockCount>
myLightUBO;
Contains the DtOsgTextureBufferObjectApplyAttribute class.
osg::ref_ptr< osg::Uniform > myLightPointScaleUniform
Definition: DtOsgLightingComponent.h:184
std::vector< osg::ref_ptr< osg::Uniform > > myUniforms
Definition: DtOsgLightingComponent.h:143
Helper class to pack lights into a buffer/texture.
Definition: DtLightData.h:44
virtual void setDirty(bool isDirty)
Sets dirty state for reinstallation.
Definition: DtOsgLightingComponent.h:95
bool myUseGlobalAmbient
Definition: DtOsgLightingComponent.h:172
DtGlBuffer * myTileLightGridCountOffsetsSSBO
Holds tile grid space offset and count pairs into the light data.
Definition: DtOsgLightingComponent.h:154
osg::ref_ptr< osg::Uniform > myDynamicLightScaleUniform
Definition: DtOsgLightingComponent.h:185
DtGlSimpleTexture * myColorRampTexture
Definition: DtOsgLightingComponent.h:159
osg::ref_ptr< osg::Uniform > myEnableLightingUniform
Definition: DtOsgLightingComponent.h:140
DtLightData * myLightGrid
Definition: DtOsgLightingComponent.h:146
osg::ref_ptr< osg::Uniform > myBDRFLutUniform
Definition: DtOsgLightingComponent.h:191
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
bool myUseHDR
Definition: DtOsgLightingComponent.h:177
osg::ref_ptr< osg::Uniform > mySpecularScaleUniform
Definition: DtOsgLightingComponent.h:187
osg::ref_ptr< osg::Uniform > myLightGridTileDimUniform
Definition: DtOsgLightingComponent.h:168
Wrapper for OpenGL Texture.
Definition: DtGlSimpleTexture.h:35
osg::ref_ptr< osg::Uniform > myEmissionFactorUniform
Definition: DtOsgLightingComponent.h:179
const DtBindingManager & myBindingManager
Definition: DtOsgLightingComponent.h:211
Contains the vrvOsg::DtBindingManager class.
Contains the DtOsgTextureApplyAttribute class.
osg::ref_ptr< osg::Uniform > myAmbientFactorUniform
Definition: DtOsgLightingComponent.h:171
osg::ref_ptr< osg::Uniform > myDiffuseFactorUniform
Definition: DtOsgLightingComponent.h:174
uint32 myTileLightGridCountOffsetsSize
Definition: DtOsgLightingComponent.h:200
bool myDirty
Definition: DtOsgLightingComponent.h:178
osg::ref_ptr< osg::Uniform > myUseGlobalDiffuseUniform
Definition: DtOsgLightingComponent.h:176
osg::ref_ptr< osg::Uniform > myModelTransmittanceUniform
Definition: DtOsgLightingComponent.h:182
osg::ref_ptr< osg::Uniform > myLightingOffClampUniform
Definition: DtOsgLightingComponent.h:141
DtSignalConnectionManager myConnections
Definition: DtOsgLightingComponent.h:204
Manage interface block bindings.
Definition: DtBindingManager.h:43
osg::ref_ptr< osg::Uniform > myViewportSizeUniform
Definition: DtOsgLightingComponent.h:166
osg::ref_ptr< osg::Uniform > myEmissiveTextureScaleUniform
Definition: DtOsgLightingComponent.h:186
DtGlBuffer * myTileLightIndexListSSBO
Holds a set of indexes, one per light tile.
Definition: DtOsgLightingComponent.h:157
osg::ref_ptr< DtUniformBufferObjectApplyAttribute > myUniformBufferObjectApplyAttribute
Definition: DtOsgLightingComponent.h:163
osg::ref_ptr< osg::Uniform > myModelTypeDefaultUniform
Definition: DtOsgLightingComponent.h:195
osg::ref_ptr< osg::Texture2D > myBDRFLutTexture
Definition: DtOsgLightingComponent.h:192
osg::ref_ptr< osg::Uniform > myUseGlobalAmbientUniform
Definition: DtOsgLightingComponent.h:173
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:24
osg::ref_ptr< osg::Uniform > myTransmittanceFactorUniform
Definition: DtOsgLightingComponent.h:181
bool myIsInstalled
Definition: DtOsgLightingComponent.h:202
osg::ref_ptr< osg::Uniform > myUpVectorUniform
Definition: DtOsgLightingComponent.h:190
osg::ref_ptr< osg::Uniform > myColorRampTextureUniform
Definition: DtOsgLightingComponent.h:160
Class doing all the heavy lifting in regards of forward+ lighting.
Definition: DtTileSpaceLightGrid.h:40
boost::array< DtGlBuffer *, DtBindingManager::theLightBlockCount > myLightUBO
Definition: DtOsgLightingComponent.h:149
bool myUseGlobalDiffuse
Definition: DtOsgLightingComponent.h:175
int myLightGridSize
Definition: DtOsgLightingComponent.h:209
A generic OpenGL buffer.
Definition: DtGlBuffer.h:25
osg::ref_ptr< DtShaderStorageBufferApplyAttribute > myShaderStorageBufferApplyAttribute
Definition: DtOsgLightingComponent.h:164
osg::ref_ptr< osg::Uniform > myShininessScaleUniform
Definition: DtOsgLightingComponent.h:188
VectorLights myViewSpaceLightsScratchPad
Definition: DtOsgLightingComponent.h:197
Base class to provide boost signal/slot management.
osg::ref_ptr< TextureApplyAttribute > myTextureApplyAttribute
Definition: DtOsgLightingComponent.h:162
Base class for components that affect the state on a subset of the scene graph, injecting state...
Definition: DtOsgStateComponent.h:34
osg::ref_ptr< osg::Image > myBDRFLutImage
Definition: DtOsgLightingComponent.h:193
unsigned int uint32
Definition: DtCommonTypes.h:28
DtTileSpaceLightGrid * myTileSpaceLightGrid
Definition: DtOsgLightingComponent.h:151
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Contains the DtOsgStateComponent class.
virtual bool dirty() const
Checks if component needs to be re-installed.
Definition: DtOsgLightingComponent.h:101
int32 * myTileLightGridCountOffsets
Definition: DtOsgLightingComponent.h:199
osg::ref_ptr< osg::Uniform > myLightGridMaxDimUniform
Definition: DtOsgLightingComponent.h:169
static bool bColorRampTextureWasTried
Definition: DtOsgLightingComponent.h:206
State component that injects lighting shaders and uniforms into a state set.
Definition: DtOsgLightingComponent.h:49
GLint myMaxUboSizeInBytes
Definition: DtOsgLightingComponent.h:208