VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
makVrv::DtOsgLightingComponent Class Reference

State component that injects lighting shaders and uniforms into a state set. More...

Inheritance diagram for makVrv::DtOsgLightingComponent:
Inheritance graph
[legend]

Public Member Functions

 DtOsgLightingComponent (int maxLights, DtDe &de)
 CTOR. More...
 
virtual ~DtOsgLightingComponent ()
 DTOR. More...
 
virtual void update (const VectorLights &lights, const osg::State &state)
 Update the lighting uniforms with new light data. More...
 
virtual void setMaxLights (int maxNumLights)
 Sets the total maximum number of lights to activate (including dynamic lights). More...
 
virtual const Vector2_uint32tileSize (void) const
 
virtual const Vector2_uint32gridMaxDims (void) const
 
virtual osg::Uniform * getEnableLightingUniform () const
 Gets the uniform that toggles lighting. More...
 
virtual void setAmbientFactor (float ambientFactor)
 Sets the ambient factor uniform. More...
 
virtual void setUseGlobalAmbient (bool useGlobalAmbient)
 Enables/Disables the usage of the material ambient and global ambient. More...
 
virtual void setDiffuseFactor (float diffuseFactor)
 Sets the difuse factor uniform. More...
 
virtual void setUseGlobalDiffuse (bool useGlobalDiffuse)
 Enables/Disables the usage of the material diffuse and global diffuse. More...
 
virtual void setUseHDR (bool useHDR)
 Enables/Disables HDR Lighting. More...
 
virtual void setDirty (bool isDirty)
 Sets dirty state for reinstallation. More...
 
virtual void setEmissionFactor (float emissionFactor)
 Sets the emission factor uniform. More...
 
virtual bool dirty () const
 Checks if component needs to be re-installed. More...
 
virtual void releaseGLObjects (void)
 
virtual bool install (osg::StateSet *stateset)
 Install this component on a state set. More...
 
virtual bool uninstall (osg::StateSet *stateset)
 Uninstall this component from a state set. More...
 
- Public Member Functions inherited from makVrv::DtOsgStateComponent
 DtOsgStateComponent (DtDe &de)
 CTOR. More...
 

Static Public Member Functions

static int textureStartOffset (void)
 

Protected Member Functions

virtual void setLightPointScale (double scale)
 
virtual void setDynamicLightScale (double scale)
 
virtual void setEmissiveTextureScale (double scale)
 
virtual void setSpecularScale (double scale)
 
virtual void setShininessScale (double scale)
 
virtual osg::ref_ptr
< osg::Uniform > 
createUniform (const std::string &name, osg::Uniform::Type type, int count=1)
 
virtual void packLights (const osg::Matrixd &normalMatrix, const VectorLights &lights, const osg::State &state)
 
virtual void updateTextureLightDataGrid (void)
 
virtual void updateTiledShadingData (const VectorLights &lights, const osg::State &state)
 
virtual void updateTileLightIndexList ()
 Updates the per-light-grid index lists. More...
 
virtual void updateTileLightGridCountOffsets ()
 Updates the offsets and counts into the index grid. More...
 
virtual int lightGridSize ()
 Returns the number of lights in the light grid. More...
 
virtual int maxUboSize ()
 Returns the maximum UBO size that we'll use for a light UBO. More...
 
- Protected Member Functions inherited from makVrv::DtOsgStateComponent
virtual ~DtOsgStateComponent ()
 DTOR. More...
 
std::string loadShaderSource (const std::string &strFileName) const
 Loads shader source code from a path. More...
 

Protected Attributes

osg::ref_ptr< osg::Uniform > myEnableLightingUniform
 
osg::ref_ptr< osg::Uniform > myLightingOffClampUniform
 
std::vector< osg::ref_ptr
< osg::Uniform > > 
myUniforms
 
DtLightDatamyLightGrid
 
boost::array< DtGlBuffer
*, DtBindingManager::theLightBlockCount
myLightUBO
 
DtTileSpaceLightGridmyTileSpaceLightGrid
 
DtGlBuffermyTileLightGridCountOffsetsSSBO
 Holds tile grid space offset and count pairs into the light data. More...
 
DtGlBuffermyTileLightIndexListSSBO
 Holds a set of indexes, one per light tile. More...
 
DtGlSimpleTexturemyColorRampTexture
 
osg::ref_ptr< osg::Uniform > myColorRampTextureUniform
 
osg::ref_ptr
< TextureApplyAttribute
myTextureApplyAttribute
 
osg::ref_ptr
< DtUniformBufferObjectApplyAttribute
myUniformBufferObjectApplyAttribute
 
osg::ref_ptr
< DtShaderStorageBufferApplyAttribute
myShaderStorageBufferApplyAttribute
 
osg::ref_ptr< osg::Uniform > myViewportSizeUniform
 
osg::ref_ptr< osg::Uniform > myLightGridTileDimUniform
 
osg::ref_ptr< osg::Uniform > myLightGridMaxDimUniform
 
osg::ref_ptr< osg::Uniform > myAmbientFactorUniform
 
bool myUseGlobalAmbient
 
osg::ref_ptr< osg::Uniform > myUseGlobalAmbientUniform
 
osg::ref_ptr< osg::Uniform > myDiffuseFactorUniform
 
bool myUseGlobalDiffuse
 
osg::ref_ptr< osg::Uniform > myUseGlobalDiffuseUniform
 
bool myUseHDR
 
bool myDirty
 
osg::ref_ptr< osg::Uniform > myEmissionFactorUniform
 
osg::ref_ptr< osg::Uniform > myTransmittanceFactorUniform
 
osg::ref_ptr< osg::Uniform > myModelTransmittanceUniform
 
osg::ref_ptr< osg::Uniform > myLightPointScaleUniform
 
osg::ref_ptr< osg::Uniform > myDynamicLightScaleUniform
 
osg::ref_ptr< osg::Uniform > myEmissiveTextureScaleUniform
 
osg::ref_ptr< osg::Uniform > mySpecularScaleUniform
 
osg::ref_ptr< osg::Uniform > myShininessScaleUniform
 
osg::ref_ptr< osg::Uniform > myUpVectorUniform
 
osg::ref_ptr< osg::Uniform > myBDRFLutUniform
 
osg::ref_ptr< osg::Texture2D > myBDRFLutTexture
 
osg::ref_ptr< osg::Image > myBDRFLutImage
 
osg::ref_ptr< osg::Uniform > myModelTypeDefaultUniform
 
VectorLights myViewSpaceLightsScratchPad
 
int32myTileLightGridCountOffsets
 
uint32 myTileLightGridCountOffsetsSize
 
bool myIsInstalled
 
DtSignalConnectionManager myConnections
 
GLint myMaxUboSizeInBytes
 
int myLightGridSize
 
const DtBindingManagermyBindingManager
 
- Protected Attributes inherited from makVrv::DtOsgStateComponent
DtDemyDe
 
DtOsgShaderFilesCachemyShaderFilesCache
 

Static Protected Attributes

static bool bColorRampTextureWasTried
 

Private Member Functions

 DtOsgLightingComponent ()
 private default constructor. not allowed. More...
 
 DtOsgLightingComponent (const DtOsgLightingComponent &)
 prevent copy-construction More...
 
DtOsgLightingComponentoperator= (const DtOsgLightingComponent &)
 prevent assignment More...
 

Detailed Description

State component that injects lighting shaders and uniforms into a state set.

Constructor & Destructor Documentation

makVrv::DtOsgLightingComponent::DtOsgLightingComponent ( int  maxLights,
DtDe de 
)

CTOR.

virtual makVrv::DtOsgLightingComponent::~DtOsgLightingComponent ( )
virtual

DTOR.

makVrv::DtOsgLightingComponent::DtOsgLightingComponent ( )
private

private default constructor. not allowed.

makVrv::DtOsgLightingComponent::DtOsgLightingComponent ( const DtOsgLightingComponent )
private

prevent copy-construction

Member Function Documentation

DtOsgLightingComponent& makVrv::DtOsgLightingComponent::operator= ( const DtOsgLightingComponent )
private

prevent assignment

virtual void makVrv::DtOsgLightingComponent::update ( const VectorLights &  lights,
const osg::State &  state 
)
virtual

Update the lighting uniforms with new light data.

virtual void makVrv::DtOsgLightingComponent::setMaxLights ( int  maxNumLights)
virtual

Sets the total maximum number of lights to activate (including dynamic lights).

virtual const Vector2_uint32& makVrv::DtOsgLightingComponent::tileSize ( void  ) const
virtual
virtual const Vector2_uint32& makVrv::DtOsgLightingComponent::gridMaxDims ( void  ) const
virtual
virtual osg::Uniform* makVrv::DtOsgLightingComponent::getEnableLightingUniform ( ) const
virtual

Gets the uniform that toggles lighting.

virtual void makVrv::DtOsgLightingComponent::setAmbientFactor ( float  ambientFactor)
virtual

Sets the ambient factor uniform.

virtual void makVrv::DtOsgLightingComponent::setUseGlobalAmbient ( bool  useGlobalAmbient)
virtual

Enables/Disables the usage of the material ambient and global ambient.

virtual void makVrv::DtOsgLightingComponent::setDiffuseFactor ( float  diffuseFactor)
virtual

Sets the difuse factor uniform.

virtual void makVrv::DtOsgLightingComponent::setUseGlobalDiffuse ( bool  useGlobalDiffuse)
virtual

Enables/Disables the usage of the material diffuse and global diffuse.

virtual void makVrv::DtOsgLightingComponent::setUseHDR ( bool  useHDR)
virtual

Enables/Disables HDR Lighting.

virtual void makVrv::DtOsgLightingComponent::setDirty ( bool  isDirty)
inlinevirtual

Sets dirty state for reinstallation.

virtual void makVrv::DtOsgLightingComponent::setEmissionFactor ( float  emissionFactor)
virtual

Sets the emission factor uniform.

virtual bool makVrv::DtOsgLightingComponent::dirty ( ) const
inlinevirtual

Checks if component needs to be re-installed.

virtual void makVrv::DtOsgLightingComponent::releaseGLObjects ( void  )
virtual
virtual bool makVrv::DtOsgLightingComponent::install ( osg::StateSet *  stateset)
virtual

Install this component on a state set.

Implements makVrv::DtOsgStateComponent.

virtual bool makVrv::DtOsgLightingComponent::uninstall ( osg::StateSet *  stateset)
virtual

Uninstall this component from a state set.

Implements makVrv::DtOsgStateComponent.

static int makVrv::DtOsgLightingComponent::textureStartOffset ( void  )
static
virtual void makVrv::DtOsgLightingComponent::setLightPointScale ( double  scale)
protectedvirtual
virtual void makVrv::DtOsgLightingComponent::setDynamicLightScale ( double  scale)
protectedvirtual
virtual void makVrv::DtOsgLightingComponent::setEmissiveTextureScale ( double  scale)
protectedvirtual
virtual void makVrv::DtOsgLightingComponent::setSpecularScale ( double  scale)
protectedvirtual
virtual void makVrv::DtOsgLightingComponent::setShininessScale ( double  scale)
protectedvirtual
virtual osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::createUniform ( const std::string &  name,
osg::Uniform::Type  type,
int  count = 1 
)
protectedvirtual
virtual void makVrv::DtOsgLightingComponent::packLights ( const osg::Matrixd &  normalMatrix,
const VectorLights &  lights,
const osg::State &  state 
)
protectedvirtual
virtual void makVrv::DtOsgLightingComponent::updateTextureLightDataGrid ( void  )
protectedvirtual
virtual void makVrv::DtOsgLightingComponent::updateTiledShadingData ( const VectorLights &  lights,
const osg::State &  state 
)
protectedvirtual
virtual void makVrv::DtOsgLightingComponent::updateTileLightIndexList ( )
protectedvirtual

Updates the per-light-grid index lists.

virtual void makVrv::DtOsgLightingComponent::updateTileLightGridCountOffsets ( )
protectedvirtual

Updates the offsets and counts into the index grid.

virtual int makVrv::DtOsgLightingComponent::lightGridSize ( )
protectedvirtual

Returns the number of lights in the light grid.

virtual int makVrv::DtOsgLightingComponent::maxUboSize ( )
protectedvirtual

Returns the maximum UBO size that we'll use for a light UBO.

Member Data Documentation

osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myEnableLightingUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myLightingOffClampUniform
protected
std::vector< osg::ref_ptr<osg::Uniform> > makVrv::DtOsgLightingComponent::myUniforms
protected
DtLightData* makVrv::DtOsgLightingComponent::myLightGrid
protected
boost::array<DtGlBuffer*, DtBindingManager::theLightBlockCount> makVrv::DtOsgLightingComponent::myLightUBO
protected
DtTileSpaceLightGrid* makVrv::DtOsgLightingComponent::myTileSpaceLightGrid
protected
DtGlBuffer* makVrv::DtOsgLightingComponent::myTileLightGridCountOffsetsSSBO
protected

Holds tile grid space offset and count pairs into the light data.

DtGlBuffer* makVrv::DtOsgLightingComponent::myTileLightIndexListSSBO
protected

Holds a set of indexes, one per light tile.

This can get big, so cannot fit in a UBO.

DtGlSimpleTexture* makVrv::DtOsgLightingComponent::myColorRampTexture
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myColorRampTextureUniform
protected
osg::ref_ptr<TextureApplyAttribute> makVrv::DtOsgLightingComponent::myTextureApplyAttribute
protected
osg::ref_ptr<DtUniformBufferObjectApplyAttribute> makVrv::DtOsgLightingComponent::myUniformBufferObjectApplyAttribute
protected
osg::ref_ptr<DtShaderStorageBufferApplyAttribute> makVrv::DtOsgLightingComponent::myShaderStorageBufferApplyAttribute
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myViewportSizeUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myLightGridTileDimUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myLightGridMaxDimUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myAmbientFactorUniform
protected
bool makVrv::DtOsgLightingComponent::myUseGlobalAmbient
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myUseGlobalAmbientUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myDiffuseFactorUniform
protected
bool makVrv::DtOsgLightingComponent::myUseGlobalDiffuse
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myUseGlobalDiffuseUniform
protected
bool makVrv::DtOsgLightingComponent::myUseHDR
protected
bool makVrv::DtOsgLightingComponent::myDirty
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myEmissionFactorUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myTransmittanceFactorUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myModelTransmittanceUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myLightPointScaleUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myDynamicLightScaleUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myEmissiveTextureScaleUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::mySpecularScaleUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myShininessScaleUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myUpVectorUniform
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myBDRFLutUniform
protected
osg::ref_ptr<osg::Texture2D> makVrv::DtOsgLightingComponent::myBDRFLutTexture
protected
osg::ref_ptr<osg::Image> makVrv::DtOsgLightingComponent::myBDRFLutImage
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myModelTypeDefaultUniform
protected
VectorLights makVrv::DtOsgLightingComponent::myViewSpaceLightsScratchPad
protected
int32* makVrv::DtOsgLightingComponent::myTileLightGridCountOffsets
protected
uint32 makVrv::DtOsgLightingComponent::myTileLightGridCountOffsetsSize
protected
bool makVrv::DtOsgLightingComponent::myIsInstalled
protected
DtSignalConnectionManager makVrv::DtOsgLightingComponent::myConnections
protected
bool makVrv::DtOsgLightingComponent::bColorRampTextureWasTried
staticprotected
GLint makVrv::DtOsgLightingComponent::myMaxUboSizeInBytes
protected
int makVrv::DtOsgLightingComponent::myLightGridSize
protected
const DtBindingManager& makVrv::DtOsgLightingComponent::myBindingManager
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)