VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
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)
 CTOR.
virtual ~DtOsgLightingComponent ()
 DTOR.
void update (const VectorLights &lights, const osg::State &state)
 Update the lighting uniforms with new light data.
void setMaxLights (int maxNumLights)
 Sets the total maximum number of lights to activate (including dynamic lights).
const Vector2_uint32GetTileSize (void) const
const Vector2_uint32GetGridMaxDims (void) const
osg::Uniform * getEnableLightingUniform () const
 Gets the uniform that toggles lighting.
void setAmbientFactor (float ambientFactor)
 Sets the ambient factor uniform.
void setUseGlobalAmbient (bool useGlobalAmbient)
 Enables/Disables the usage of the material ambient and global ambient.
void setDiffuseFactor (float diffuseFactor)
 Sets the difuse factor uniform.
void setUseGlobalDiffuse (bool useGlobalDiffuse)
 Enables/Disables the usage of the material diffuse and global diffuse.
void setUseHDR (bool useHDR)
 Enables/Disables HDR Lighting.
void setDirty (bool isDirty)
 Sets dirty state for reinstallation.
void setEmissionFactor (float emissionFactor)
 Sets the emission factor uniform.
bool dirty () const
 Checks if component needs to be re-installed.
void releaseGLObjects (void)
virtual bool install (osg::StateSet *stateset)
 Install this component on a state set.
virtual bool uninstall (osg::StateSet *stateset)
 Uninstall this component from a state set.
- Public Member Functions inherited from makVrv::DtOsgStateComponent
 DtOsgStateComponent (const DtOsgStateComponentContext *context=0L)
 CTOR.
const DtOsgStateComponentContextgetContext () const
 Gets the context under which this component operates.

Static Public Member Functions

static int getTextureStartOffset (void)

Protected Member Functions

osg::Uniform * createUniform (const std::string &name, osg::Uniform::Type type, int count=1)
void PackLights (const VectorLights &lights, const osg::State &state)
void UpdateTextureLightDataGrid (void)
void UpdateTiledShadingData (const VectorLights &lights, const osg::State &state)
void UpdateTileLightIndexListTexture ()
void UpdateTileLightGridCountOffsetsTexture ()
- Protected Member Functions inherited from makVrv::DtOsgStateComponent
virtual ~DtOsgStateComponent ()
 DTOR.
std::string loadShaderSource (const std::string &strFileName) const
 Loads shader source code from a path.

Protected Attributes

osg::ref_ptr< osg::Uniform > myEnableLightingUniform
std::vector< osg::Uniform * > myUniforms
DtLightDatamyLightGrid
DtGLTextureBufferObjectmyLightTexture
osg::ref_ptr< osg::Uniform > myLightTextureUniform
DtTileSpaceLightGridmyTileSpaceLightGrid
DtGLTextureBufferObjectmyTileLightIndexListTexture
osg::ref_ptr< osg::Uniform > myTileLightIndexListTextureUniform
DtGLTextureBufferObjectmyTileLightGridCountOffsetsTexture
osg::ref_ptr< osg::Uniform > myTileLightGridCountOffsetsTextureUniform
DtGLTexturemyColorRampTexture
osg::ref_ptr< osg::Uniform > myColorRampTextureUniform
osg::ref_ptr
< TextureApplyAttribute
myTextureApplyAttribute
osg::ref_ptr
< TextureBufferObjectApplyAttribute
myTextureBufferObjectApplyAttribute
osg::ref_ptr< osg::Uniform > myProjectionMatrixUniform
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 > myDiffuseFactorUniform
bool myUseGlobalDiffuse
bool myUseHDR
bool myDirty
osg::ref_ptr< osg::Uniform > myEmissionFactorUniform
osg::ref_ptr< osg::Uniform > myTransmittanceFactorUniform
osg::ref_ptr< osg::Uniform > myModelTransmittanceUniform
VectorLights myViewSpaceLightsScratchPad
int32myTileLightGridCountOffsets
uint32 myTileLightGridCountOffsetsSize
bool myIsInstalled

Static Protected Attributes

static bool bColorRampTextureWasTried

Detailed Description

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

Constructor & Destructor Documentation

makVrv::DtOsgLightingComponent::DtOsgLightingComponent ( int  maxLights)

CTOR.

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

DTOR.

Member Function Documentation

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

Update the lighting uniforms with new light data.

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

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

static int makVrv::DtOsgLightingComponent::getTextureStartOffset ( void  )
static
const Vector2_uint32& makVrv::DtOsgLightingComponent::GetTileSize ( void  ) const
const Vector2_uint32& makVrv::DtOsgLightingComponent::GetGridMaxDims ( void  ) const
osg::Uniform* makVrv::DtOsgLightingComponent::getEnableLightingUniform ( ) const

Gets the uniform that toggles lighting.

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

Sets the ambient factor uniform.

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

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

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

Sets the difuse factor uniform.

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

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

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

Enables/Disables HDR Lighting.

void makVrv::DtOsgLightingComponent::setDirty ( bool  isDirty)
inline

Sets dirty state for reinstallation.

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

Sets the emission factor uniform.

bool makVrv::DtOsgLightingComponent::dirty ( ) const
inline

Checks if component needs to be re-installed.

void makVrv::DtOsgLightingComponent::releaseGLObjects ( void  )
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.

osg::Uniform* makVrv::DtOsgLightingComponent::createUniform ( const std::string &  name,
osg::Uniform::Type  type,
int  count = 1 
)
protected
void makVrv::DtOsgLightingComponent::PackLights ( const VectorLights &  lights,
const osg::State &  state 
)
protected
void makVrv::DtOsgLightingComponent::UpdateTextureLightDataGrid ( void  )
protected
void makVrv::DtOsgLightingComponent::UpdateTiledShadingData ( const VectorLights &  lights,
const osg::State &  state 
)
protected
void makVrv::DtOsgLightingComponent::UpdateTileLightIndexListTexture ( )
protected
void makVrv::DtOsgLightingComponent::UpdateTileLightGridCountOffsetsTexture ( )
protected

Member Data Documentation

osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myEnableLightingUniform
protected
std::vector<osg::Uniform*> makVrv::DtOsgLightingComponent::myUniforms
protected
DtLightData* makVrv::DtOsgLightingComponent::myLightGrid
protected
DtGLTextureBufferObject* makVrv::DtOsgLightingComponent::myLightTexture
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myLightTextureUniform
protected
DtTileSpaceLightGrid* makVrv::DtOsgLightingComponent::myTileSpaceLightGrid
protected
DtGLTextureBufferObject* makVrv::DtOsgLightingComponent::myTileLightIndexListTexture
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myTileLightIndexListTextureUniform
protected
DtGLTextureBufferObject* makVrv::DtOsgLightingComponent::myTileLightGridCountOffsetsTexture
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myTileLightGridCountOffsetsTextureUniform
protected
DtGLTexture* makVrv::DtOsgLightingComponent::myColorRampTexture
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myColorRampTextureUniform
protected
osg::ref_ptr<TextureApplyAttribute> makVrv::DtOsgLightingComponent::myTextureApplyAttribute
protected
osg::ref_ptr<TextureBufferObjectApplyAttribute> makVrv::DtOsgLightingComponent::myTextureBufferObjectApplyAttribute
protected
osg::ref_ptr<osg::Uniform> makVrv::DtOsgLightingComponent::myProjectionMatrixUniform
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::myDiffuseFactorUniform
protected
bool makVrv::DtOsgLightingComponent::myUseGlobalDiffuse
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
VectorLights makVrv::DtOsgLightingComponent::myViewSpaceLightsScratchPad
protected
int32* makVrv::DtOsgLightingComponent::myTileLightGridCountOffsets
protected
uint32 makVrv::DtOsgLightingComponent::myTileLightGridCountOffsetsSize
protected
bool makVrv::DtOsgLightingComponent::myIsInstalled
protected
bool makVrv::DtOsgLightingComponent::bColorRampTextureWasTried
staticprotected

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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)