VR-Forces 5.0.3 Developer's Guide
 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.

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

Public Member Functions

 DtCloudDrawable (const DtCloudDrawable &copy, const osg::CopyOp &op)
 
virtual ~DtCloudDrawable ()
 
virtual osg::Object * cloneType () const
 
virtual osg::Object * clone (const osg::CopyOp &copyop) const
 
virtual void slot_channelDestroyed (DtChannelManager *channelManager, DtChannel *channel)
 
virtual unsigned int findCubeMap (const osg::ref_ptr< const osg::Camera > osgCamera) const
 
virtual void drawImplementation (osg::RenderInfo &renderInfo) const
 
virtual void setGeocentricMode (bool mode)
 
virtual void cleanupCloudLayer (SilverLining::Atmosphere *atmosphere, unsigned int layerHandle)
 
virtual
DtSilverLiningCubeMapManager
cubeMapManager ()
 

Public Attributes

friend DtCloudDrawableCreator
 

Protected Member Functions

 DtCloudDrawable (DtDe &de, DtSilverliningGroup *parent)
 
virtual void fadeCloudsWithAltitude (const osg::Vec3d &osgCameraPosition, SilverLining::CloudLayer *layer, SilverLining::ThreadCameraStreamData *tcsData)
 
virtual void fadeCloudsWithAltitude (const osg::Vec3d &osgCameraPosition, SilverLining::Atmosphere *atmosphere, SilverLining::ThreadCameraStreamData *tcsData)
 
virtual void updateCloudAltitudes (const osg::Vec3d &osgCameraPosition, SilverLining::Atmosphere *atmosphere, SilverLining::ThreadCameraStreamData *tcsData)
 
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 (const osg::State &state, SilverLining::Atmosphere *atm, bool isReflection, SilverLining::ThreadCameraStreamData *tcsData) const
 
virtual void connectSingals ()
 
virtual void initUniforms ()
 
virtual void disconnectSignals ()
 
virtual void slot_environmentChanged (const std::string &name)
 
virtual bool computeHeightAboveTerrain (const osg::Vec3d &localPosition, double &heightOfGround) const
 
virtual void updateCloudLayerAltitudes (SilverLining::Atmosphere *atmosphere, SilverLining::ThreadCameraStreamData *tcsData)
 
virtual void updateCubeMap (SilverLining::Atmosphere *atmosphere, SilverLining::ThreadCameraStreamData *tcsData, const osg::Camera *osgCamera, const osg::Vec3d &osgCameraPosition, osg::State &state)
 
virtual bool updateDepthTextureIfNecessary (osg::RenderInfo &renderInfo, SilverLining::Atmosphere *atmosphere) const
 
virtual bool anyLayerNeedsDepthTexture (void) const
 
virtual void unbindDepthTexture (osg::RenderInfo &renderInfo) const
 
virtual void updateSoftnessAndSmoothCloudsFromImGui () const
 
virtual void slot_coordinateSystemChanged ()
 

Protected Attributes

std::vector< unsigned intmyUserShaderVector
 
DtSilverliningGroupmyParent
 
DtDemyDe
 
bool myGeocentricFlag
 
osg::Vec3d myLastHOTUpdatePos
 
bool myForceHOTUpdate
 
double myHOT
 
bool mySkipUpdateAltitudes
 
std::map
< SilverLining::CloudLayer
*, double
myOriginalAltitudesMap
 
osg::ref_ptr< osg::Uniform > myMutableSoftnessUniform
 
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
 
float mySmoothCloudsDist
 
double myLastImGuiSimTime
 
DtSilverLiningCubeMapManagermyCubeMapManager
 
DtSignalConnectionManager myConnections
 
DtIntersectormyIntersector = nullptr
 
DtCoordinateSystemmyCoordinateSystem = nullptr
 
DtOsgFrameTextureBlitterManagermyFrameTextureBlitterManager
 

Private Member Functions

DtCloudDrawableoperator= (const DtCloudDrawable &rhs)=delete
 

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::slot_channelDestroyed ( DtChannelManager channelManager,
DtChannel channel 
)
virtual

connected to the signal_channelToBeDestroyed to cleanup the camera map

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 DtSilverLiningCubeMapManager* makVrv::DtCloudDrawable::cubeMapManager ( )
virtual

get the cube map manager

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 ( const 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

compute height above terrain

virtual void makVrv::DtCloudDrawable::updateCloudLayerAltitudes ( SilverLining::Atmosphere *  atmosphere,
SilverLining::ThreadCameraStreamData *  tcsData 
)
protectedvirtual

update cloud layer altitude

virtual void makVrv::DtCloudDrawable::updateCubeMap ( SilverLining::Atmosphere *  atmosphere,
SilverLining::ThreadCameraStreamData *  tcsData,
const osg::Camera *  osgCamera,
const osg::Vec3d &  osgCameraPosition,
osg::State &  state 
)
protectedvirtual

update cube map

virtual bool makVrv::DtCloudDrawable::updateDepthTextureIfNecessary ( osg::RenderInfo &  renderInfo,
SilverLining::Atmosphere *  atmosphere 
) 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. Returns true if the depth texture was actually updated and bound.

virtual bool makVrv::DtCloudDrawable::anyLayerNeedsDepthTexture ( void  ) const
protectedvirtual

Whether any cloud layer needs the depth texture (e.g. stratocumulus always needs it)

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 void makVrv::DtCloudDrawable::slot_coordinateSystemChanged ( )
protectedvirtual

slot for when the coordinate system changes

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 environment 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
DtIntersector* makVrv::DtCloudDrawable::myIntersector = nullptr
protected
DtCoordinateSystem* makVrv::DtCloudDrawable::myCoordinateSystem = nullptr
protected

local clone of the system wide coordinate system. for thread safety.

DtOsgFrameTextureBlitterManager& makVrv::DtCloudDrawable::myFrameTextureBlitterManager
protected

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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)