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

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

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

Public Member Functions

 DtCloudDrawable (const DtCloudDrawable &copy, const osg::CopyOp &op)
 CopyCOTR. More...
 
virtual ~DtCloudDrawable ()
 DTOR. More...
 
virtual osg::Object * cloneType () const
 required functions for derriving from osg::Drawable More...
 
virtual osg::Object * clone (const osg::CopyOp &copyop) const
 
virtual void releaseGLObjects (osg::State *state) const
 release gl objects More...
 
virtual void slot_channelDestroyed (DtChannelManager *channelManager, DtChannel *channel)
 connected to the signal_channelToBeDestroyed to cleanup the camera map More...
 
virtual void updateCubeMaps (bool fullRegenerate)
 Request an updated cube map with the next draw. More...
 
virtual unsigned int findCubeMap (const osg::ref_ptr< const osg::Camera > osgCamera) const
 Returns the latest environmental cube map for a camera, or NULL. More...
 
virtual void drawImplementation (osg::RenderInfo &renderInfo) const
 Actually do the drawing. More...
 
virtual void setGeocentricMode (bool mode)
 Indicate if we are in a geocentric terrain. More...
 
virtual void cleanupCloudLayer (SilverLining::Atmosphere *atmosphere, unsigned int layerHandle)
 Used to cleanup any SilverLining::CloudLayer specific state that the drawable has. More...
 

Public Attributes

friend DtCloudDrawableCreator
 

Protected Member Functions

 DtCloudDrawable (DtDe &de, DtSilverliningGroup *parent)
 CTOR. More...
 
virtual void fadeCloudsWithAltitude (const osg::Vec3d &osgCameraPosition, SilverLining::CloudLayer *layer, SilverLining::ThreadCameraStreamData *tcsData)
 fade clouds depending on the altitude, for a given layer More...
 
virtual void fadeCloudsWithAltitude (const osg::Vec3d &osgCameraPosition, SilverLining::Atmosphere *atmosphere, SilverLining::ThreadCameraStreamData *tcsData)
 fade clouds depending on the altitude for all layers; calls the method above for each layer More...
 
virtual void updateCloudAltitudes (const osg::Vec3d &osgCameraPosition, SilverLining::Atmosphere *atmosphere, SilverLining::ThreadCameraStreamData *tcsData)
 update cloud altitudes More...
 
virtual void updateShader (osg::Node *node, osg::State &state, SilverLining::Atmosphere *atmosphere, SilverLining::ThreadCameraStreamData *tcsData) const
 
virtual void updateOpenGLState (osg::State &state, SilverLining::Atmosphere *atmosphere, osg::Camera *osgCamera, SilverLining::ThreadCameraStreamData *tcsData) const
 
virtual void setIsReflectionUniform (osg::State &state, SilverLining::Atmosphere *atm, bool isReflection, SilverLining::ThreadCameraStreamData *tcsData) const
 
virtual void connectSingals ()
 Connects all the signals, Non-virtual, called in the ctor. More...
 
virtual 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...
 
virtual bool computeHeightAboveTerrain (const osg::Vec3d &localPosition, double &heightOfGround) const
 
virtual void updateCloudLayerAltitudes (SilverLining::Atmosphere *atmosphere, SilverLining::ThreadCameraStreamData *tcsData)
 
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
 

Protected Attributes

std::vector< unsigned intmyUserShaderVector
 
DtSilverliningGroupmyParent
 
DtDemyDe
 
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
 
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 myShadingRateIsSupported
 
bool myEnableSmoothClouds
 mutable due to osg drawImplementation limitations. Used for imgui settings for cloud smoothing. More...
 
float mySmoothCloudsDist
 
double myLastImGuiSimTime
 
DtSilverLiningCubeMapManagermyCubeMapManager
 
DtSignalConnectionManager myConnections
 

Private Member Functions

DtCloudDrawableoperator= (const DtCloudDrawable &rhs)=delete
 not allowed More...
 

Detailed Description

A drawable for drawing the cloud layer.

Constructor & Destructor Documentation

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

CopyCOTR.

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

DTOR.

makVrv::DtCloudDrawable::DtCloudDrawable ( DtDe de,
DtSilverliningGroup parent 
)
protected

CTOR.

Member Function Documentation

DtCloudDrawable& makVrv::DtCloudDrawable::operator= ( const DtCloudDrawable rhs)
privatedelete

not allowed

virtual osg::Object* makVrv::DtCloudDrawable::cloneType ( ) const
inlinevirtual

required functions for derriving from osg::Drawable

virtual osg::Object* makVrv::DtCloudDrawable::clone ( const osg::CopyOp &  copyop) const
inlinevirtual
virtual void makVrv::DtCloudDrawable::releaseGLObjects ( osg::State *  state) const
virtual

release gl objects

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

connected to the signal_channelToBeDestroyed to cleanup the camera map

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

Request an updated cube map with the next draw.

virtual unsigned int makVrv::DtCloudDrawable::findCubeMap ( const osg::ref_ptr< const osg::Camera >  osgCamera) const
virtual

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

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

Actually do the drawing.

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

Indicate if we are in a geocentric terrain.

virtual void makVrv::DtCloudDrawable::cleanupCloudLayer ( SilverLining::Atmosphere *  atmosphere,
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.

virtual void makVrv::DtCloudDrawable::fadeCloudsWithAltitude ( const osg::Vec3d &  osgCameraPosition,
SilverLining::CloudLayer *  layer,
SilverLining::ThreadCameraStreamData *  tcsData 
)
protectedvirtual

fade clouds depending on the altitude, for a given layer

virtual void makVrv::DtCloudDrawable::fadeCloudsWithAltitude ( const osg::Vec3d &  osgCameraPosition,
SilverLining::Atmosphere *  atmosphere,
SilverLining::ThreadCameraStreamData *  tcsData 
)
protectedvirtual

fade clouds depending on the altitude for all layers; calls the method above for each layer

virtual void makVrv::DtCloudDrawable::updateCloudAltitudes ( const osg::Vec3d &  osgCameraPosition,
SilverLining::Atmosphere *  atmosphere,
SilverLining::ThreadCameraStreamData *  tcsData 
)
protectedvirtual

update cloud altitudes

virtual void makVrv::DtCloudDrawable::updateShader ( osg::Node *  node,
osg::State &  state,
SilverLining::Atmosphere *  atmosphere,
SilverLining::ThreadCameraStreamData *  tcsData 
) const
protectedvirtual
virtual void makVrv::DtCloudDrawable::updateOpenGLState ( osg::State &  state,
SilverLining::Atmosphere *  atmosphere,
osg::Camera *  osgCamera,
SilverLining::ThreadCameraStreamData *  tcsData 
) const
protectedvirtual
virtual void makVrv::DtCloudDrawable::setIsReflectionUniform ( osg::State &  state,
SilverLining::Atmosphere *  atm,
bool  isReflection,
SilverLining::ThreadCameraStreamData *  tcsData 
) const
protectedvirtual
virtual void makVrv::DtCloudDrawable::connectSingals ( )
protectedvirtual

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

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

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
virtual bool makVrv::DtCloudDrawable::computeHeightAboveTerrain ( const osg::Vec3d &  localPosition,
double heightOfGround 
) const
protectedvirtual
virtual void makVrv::DtCloudDrawable::updateCloudLayerAltitudes ( SilverLining::Atmosphere *  atmosphere,
SilverLining::ThreadCameraStreamData *  tcsData 
)
protectedvirtual
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

Member Data Documentation

friend makVrv::DtCloudDrawable::DtCloudDrawableCreator
std::vector<unsigned int> makVrv::DtCloudDrawable::myUserShaderVector
mutableprotected
DtSilverliningGroup* makVrv::DtCloudDrawable::myParent
protected
DtDe& makVrv::DtCloudDrawable::myDe
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
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::myShadingRateIsSupported
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
DtSilverLiningCubeMapManager* makVrv::DtCloudDrawable::myCubeMapManager
protected
DtSignalConnectionManager makVrv::DtCloudDrawable::myConnections
protected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)