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

A drawable for drawing the cloud layer. More...

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

Classes

struct  CubeMapData
 

Public Types

enum  CubeMapUpdateState { CUBEMAP_CLEAN = 0, CUBEMAP_RENDER = 1, CUBEMAP_MIPMAP = 2 }
 

Public Member Functions

 DtCloudDrawable (DtSilverliningGroup *parent=0)
 CTOR. More...
 
 DtCloudDrawable (const DtCloudDrawable &copy, const osg::CopyOp &op)
 CopyCOTR. More...
 
virtual ~DtCloudDrawable ()
 DTOR. More...
 
virtual void releaseGLObjects (osg::State *state) const
 Meta Functions. More...
 
virtual void slot_channelDestroyed (DtChannelManager *channelManager, DtChannel *channel)
 connected to the signal_channelToBeDestroyed to cleanup the camera map More...
 
void setCrepuscularRays (bool enabled)
 Set whether crepuscular rays (sun rays) effects are on. More...
 
void updateCubeMaps (bool fullRegenerate)
 Request an updated cube map with the next draw. More...
 
unsigned int getCubeMap (const osg::ref_ptr< const osg::Camera > camera) const
 Returns the latest environmental cube map for a camera, or NULL. More...
 
unsigned int getPrimaryCubeMap () const
 Returns the latest environmental cube map for general use, or NULL. More...
 
virtual void drawImplementation (osg::RenderInfo &renderInfo) const
 Actually do the drawing. More...
 
void setGeocentricMode (bool mode)
 Indicate if we are in a geocentric terrain. More...
 
virtual void cleanupCloudLayer (SilverLining::Atmosphere *atm, unsigned int layerHandle)
 Used to cleanup any SilverLining::CloudLayer specific state that the drawable has. More...
 

Protected Types

typedef std::map
< osg::observer_ptr< const
osg::Camera >, CubeMapData * > 
MapCameraToCubeMapData
 
typedef std::map
< osg::observer_ptr< const
osg::Camera >, unsigned long
int
MapOsgCamerasToEnvMapCameraIDs
 

Protected Member Functions

void fadeCloudsWithAltitude (double altitudeMSL, SilverLining::CloudLayer *layer)
 
void updateCloudAltitudes (const osg::Vec3d &localPosition, SilverLining::Atmosphere *atm)
 
void updateShader (osg::Node *node, osg::State &state, SilverLining::Atmosphere *atm) const
 
void updateOpenGLState (osg::State &state, SilverLining::Atmosphere *atm, osg::Camera *cam) const
 
void setIsReflectionUniform (osg::State &state, SilverLining::Atmosphere *atm, bool isReflection) const
 
void connectSingals ()
 Connects all the signals, Non-virtural, called in the ctor. More...
 
void initUniforms ()
 setup uniforms More...
 
virtual void disconnectSignals ()
 Disconnects all the signals, called in the dtor. More...
 
virtual void slot_environmentChanged (const std::string &name)
 Slot when the environment is changed, for example, change from cloudy to snowy. More...
 
bool computeHeightAboveTerrain (const osg::Vec3d &localPosition, double &heightOfGround)
 
void updateCloudLayerAltitudes (SilverLining::Atmosphere *atm)
 
virtual void updateDepthTexture (osg::RenderInfo &renderInfo) const
 Copy the depth buffer from the currently bound frame buffer to a texture that the clouds can use for smoothing clouds near other objects. More...
 
virtual void unbindDepthTexture (osg::RenderInfo &renderInfo) const
 After the drawable is done with the depth texture we need to unbind it so SLI is fast. More...
 
virtual void updateSoftnessAndSmoothCloudsFromImGui () const
 
virtual CubeMapDatagetOrCreateCubeMapData (osg::Camera *camera, const osg::Vec3d &camPos) const
 
virtual void flushInvalidCamerasForCubeMap (void)
 
virtual void flushInvalidCamerasForEnvMap (void)
 
virtual unsigned long int getOrCreateCameraHandleForEnvMap (const osg::RenderInfo &renderInfo)
 

Protected Attributes

std::vector< unsigned intmyUserShaderVector
 
DtSilverliningGroupmyParent
 
DtDemyDe
 
bool myCrepuscularRays
 
bool myGeocentricFlag
 
osg::Vec3d myLastHOTUpdatePos
 
bool myForceHOTUpdate
 
double myHOT
 
bool mySkipUpdateAltitudes
 This flag is used to skip updating the altitude when an environmented changed, since the actual change for silver lining happen in next frame. More...
 
std::map
< SilverLining::CloudLayer
*, double
myOriginalAltitudesMap
 
MapCameraToCubeMapData myCubeMapDataMap
 
unsigned int myMutableLastFrameNum
 
unsigned int myMutablePrimaryCubeMap
 
osg::ref_ptr< osg::Uniform > myMutableSoftnessUniform
 mutable due to osg drawImplementation limitations. More...
 
osg::ref_ptr< osg::Uniform > myMutableInvPersMatrixUniform
 
osg::ref_ptr< osg::Uniform > myMutablePersMatrixUniform
 
osg::ref_ptr< osg::Uniform > myMutableViewportUniform
 
osg::ref_ptr< osg::Uniform > myMutableIsReflectionUniform
 
osg::ref_ptr< osg::Uniform > myMutableViewMatrixInverseUniform
 
osg::ref_ptr< osg::Uniform > myMutableIsSunMoonDiskUniform
 
osg::ref_ptr< osg::Uniform > myMutableIsStarUniform
 
osg::ref_ptr< osg::StateSet > myStateSet
 
bool myEnableSmoothClouds
 mutable due to osg drawImplementation limitations. Used for imgui settings for cloud smoothing. More...
 
float mySmoothCloudsDist
 
double myLastImGuiSimTime
 
unsigned long int myNextCameraID
 
MapOsgCamerasToEnvMapCameraIDs myMapOsgCamerasToEnvMapCameraIDs
 
DtSignalConnectionManager myConnections
 

Detailed Description

A drawable for drawing the cloud layer.

Member Typedef Documentation

typedef std::map<osg::observer_ptr<const osg::Camera>, CubeMapData *> makVrv::DtCloudDrawable::MapCameraToCubeMapData
protected
typedef std::map< osg::observer_ptr<const osg::Camera>, unsigned long int > makVrv::DtCloudDrawable::MapOsgCamerasToEnvMapCameraIDs
protected

Member Enumeration Documentation

Enumerator
CUBEMAP_CLEAN 
CUBEMAP_RENDER 
CUBEMAP_MIPMAP 

Constructor & Destructor Documentation

makVrv::DtCloudDrawable::DtCloudDrawable ( DtSilverliningGroup parent = 0)

CTOR.

makVrv::DtCloudDrawable::DtCloudDrawable ( const DtCloudDrawable copy,
const osg::CopyOp &  op 
)

CopyCOTR.

virtual makVrv::DtCloudDrawable::~DtCloudDrawable ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtCloudDrawable::releaseGLObjects ( osg::State *  state) const
virtual

Meta Functions.

virtual void makVrv::DtCloudDrawable::slot_channelDestroyed ( DtChannelManager channelManager,
DtChannel channel 
)
virtual

connected to the signal_channelToBeDestroyed to cleanup the camera map

void makVrv::DtCloudDrawable::setCrepuscularRays ( bool  enabled)

Set whether crepuscular rays (sun rays) effects are on.

void makVrv::DtCloudDrawable::updateCubeMaps ( bool  fullRegenerate)

Request an updated cube map with the next draw.

unsigned int makVrv::DtCloudDrawable::getCubeMap ( const osg::ref_ptr< const osg::Camera >  camera) const

Returns the latest environmental cube map for a camera, or NULL.

unsigned int makVrv::DtCloudDrawable::getPrimaryCubeMap ( ) const

Returns the latest environmental cube map for general use, or NULL.

virtual void makVrv::DtCloudDrawable::drawImplementation ( osg::RenderInfo &  renderInfo) const
virtual

Actually do the drawing.

void makVrv::DtCloudDrawable::setGeocentricMode ( bool  mode)

Indicate if we are in a geocentric terrain.

virtual void makVrv::DtCloudDrawable::cleanupCloudLayer ( SilverLining::Atmosphere *  atm,
unsigned int  layerHandle 
)
virtual

Used to cleanup any SilverLining::CloudLayer specific state that the drawable has.

currently only removes the entry in the default altitude map.

void makVrv::DtCloudDrawable::fadeCloudsWithAltitude ( double  altitudeMSL,
SilverLining::CloudLayer *  layer 
)
protected
void makVrv::DtCloudDrawable::updateCloudAltitudes ( const osg::Vec3d &  localPosition,
SilverLining::Atmosphere *  atm 
)
protected
void makVrv::DtCloudDrawable::updateShader ( osg::Node *  node,
osg::State &  state,
SilverLining::Atmosphere *  atm 
) const
protected
void makVrv::DtCloudDrawable::updateOpenGLState ( osg::State &  state,
SilverLining::Atmosphere *  atm,
osg::Camera *  cam 
) const
protected
void makVrv::DtCloudDrawable::setIsReflectionUniform ( osg::State &  state,
SilverLining::Atmosphere *  atm,
bool  isReflection 
) const
protected
void makVrv::DtCloudDrawable::connectSingals ( )
protected

Connects all the signals, Non-virtural, called in the ctor.

void makVrv::DtCloudDrawable::initUniforms ( )
protected

setup uniforms

virtual void makVrv::DtCloudDrawable::disconnectSignals ( )
protectedvirtual

Disconnects all the signals, called in the dtor.

virtual void makVrv::DtCloudDrawable::slot_environmentChanged ( const std::string &  name)
protectedvirtual

Slot when the environment is changed, for example, change from cloudy to snowy.

Parameters
nameThe new name of the environment
bool makVrv::DtCloudDrawable::computeHeightAboveTerrain ( const osg::Vec3d &  localPosition,
double heightOfGround 
)
protected
void makVrv::DtCloudDrawable::updateCloudLayerAltitudes ( SilverLining::Atmosphere *  atm)
protected
virtual void makVrv::DtCloudDrawable::updateDepthTexture ( osg::RenderInfo &  renderInfo) const
protectedvirtual

Copy the depth buffer from the currently bound frame buffer to a texture that the clouds can use for smoothing clouds near other objects.

virtual void makVrv::DtCloudDrawable::unbindDepthTexture ( osg::RenderInfo &  renderInfo) const
protectedvirtual

After the drawable is done with the depth texture we need to unbind it so SLI is fast.

virtual void makVrv::DtCloudDrawable::updateSoftnessAndSmoothCloudsFromImGui ( ) const
protectedvirtual
virtual CubeMapData* makVrv::DtCloudDrawable::getOrCreateCubeMapData ( osg::Camera *  camera,
const osg::Vec3d &  camPos 
) const
protectedvirtual
virtual void makVrv::DtCloudDrawable::flushInvalidCamerasForCubeMap ( void  )
protectedvirtual
virtual void makVrv::DtCloudDrawable::flushInvalidCamerasForEnvMap ( void  )
protectedvirtual
virtual unsigned long int makVrv::DtCloudDrawable::getOrCreateCameraHandleForEnvMap ( const osg::RenderInfo &  renderInfo)
protectedvirtual

Member Data Documentation

std::vector<unsigned int> makVrv::DtCloudDrawable::myUserShaderVector
mutableprotected
DtSilverliningGroup* makVrv::DtCloudDrawable::myParent
protected
DtDe& makVrv::DtCloudDrawable::myDe
protected
bool makVrv::DtCloudDrawable::myCrepuscularRays
protected
bool makVrv::DtCloudDrawable::myGeocentricFlag
protected
osg::Vec3d makVrv::DtCloudDrawable::myLastHOTUpdatePos
protected
bool makVrv::DtCloudDrawable::myForceHOTUpdate
protected
double makVrv::DtCloudDrawable::myHOT
protected
bool makVrv::DtCloudDrawable::mySkipUpdateAltitudes
protected

This flag is used to skip updating the altitude when an environmented changed, since the actual change for silver lining happen in next frame.

std::map<SilverLining::CloudLayer *, double> makVrv::DtCloudDrawable::myOriginalAltitudesMap
protected
MapCameraToCubeMapData makVrv::DtCloudDrawable::myCubeMapDataMap
mutableprotected
unsigned int makVrv::DtCloudDrawable::myMutableLastFrameNum
mutableprotected
unsigned int makVrv::DtCloudDrawable::myMutablePrimaryCubeMap
mutableprotected
osg::ref_ptr<osg::Uniform> makVrv::DtCloudDrawable::myMutableSoftnessUniform
mutableprotected

mutable due to osg drawImplementation limitations.

Used to setup uniforms so they the opengl calls are not called directly in this class.

osg::ref_ptr<osg::Uniform> makVrv::DtCloudDrawable::myMutableInvPersMatrixUniform
mutableprotected
osg::ref_ptr<osg::Uniform> makVrv::DtCloudDrawable::myMutablePersMatrixUniform
mutableprotected
osg::ref_ptr<osg::Uniform> makVrv::DtCloudDrawable::myMutableViewportUniform
mutableprotected
osg::ref_ptr<osg::Uniform> makVrv::DtCloudDrawable::myMutableIsReflectionUniform
mutableprotected
osg::ref_ptr<osg::Uniform> makVrv::DtCloudDrawable::myMutableViewMatrixInverseUniform
mutableprotected
osg::ref_ptr<osg::Uniform> makVrv::DtCloudDrawable::myMutableIsSunMoonDiskUniform
mutableprotected
osg::ref_ptr<osg::Uniform> makVrv::DtCloudDrawable::myMutableIsStarUniform
mutableprotected
osg::ref_ptr<osg::StateSet> makVrv::DtCloudDrawable::myStateSet
protected
bool makVrv::DtCloudDrawable::myEnableSmoothClouds
mutableprotected

mutable due to osg drawImplementation limitations. Used for imgui settings for cloud smoothing.

float makVrv::DtCloudDrawable::mySmoothCloudsDist
mutableprotected
double makVrv::DtCloudDrawable::myLastImGuiSimTime
mutableprotected
unsigned long int makVrv::DtCloudDrawable::myNextCameraID
protected
MapOsgCamerasToEnvMapCameraIDs makVrv::DtCloudDrawable::myMapOsgCamerasToEnvMapCameraIDs
protected
DtSignalConnectionManager makVrv::DtCloudDrawable::myConnections
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)