VR-Forces 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 Types | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
makVrv::DtTritonDrawable Class Reference

An OSG Drawable representing Triton's infinite ocean. /ingroup vrvTriton.

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

Public Member Functions

 DtTritonDrawable (makVrv::DtDe &de, DtTritonManager &tritonManager)
 
virtual void setUpEnvironment ()
 
virtual void setUpOceanMask ()
 
virtual Triton::Oceanocean ()
 
virtual Triton::Environment * environment ()
 
virtual void drawImplementation (osg::RenderInfo &renderInfo) const
 
virtual bool isInitialized () const
 
virtual void setAllowUnderwaterEffects (bool allow)
 
virtual bool allowUnderwaterEffects () const
 
virtual void releaseGLObjects (osg::State *state=0) const
 
virtual void planarReflectionCameras (std::vector< osg::ref_ptr< const DtPlanarReflectionCamera >> &planarReflectionCameras) const
 
virtual osg::ref_ptr
< DtPlanarReflectionCamera
planarReflectionCamera (osg::Camera *osgCamera) const
 
virtual const
DtTritonRenderingParameters
renderingParameters (void) const
 
virtual
DtTritonRenderingParameters
renderingParameters (void)
 
virtual void setUnderwaterFogColor (const Vector4_32 &color)
 
virtual const Vector4_32underwaterFogColor () const
 
virtual void setUnderwaterVisibility (double visibility)
 
virtual double underwaterVisibility () const
 
virtual osg::Group * getTritonGeode ()
 
virtual const osg::Group * getTritonGeode () const
 

Public Attributes

boost::signalslib::signal< void()> signal_postInitialize
 
boost::signalslib::signal< void()> signal_environmentToBeDestroyed
 

Protected Types

typedef std::map
< osg::GraphicsContext *, void * > 
ContextToHandleMap
 

Protected Member Functions

virtual ~DtTritonDrawable ()
 
virtual void shaderUpdateLightUniforms (osg::RenderInfo &info, const osg::Camera *osgCamera, DtTritonGroupTcsUserData *userData, double windSpeed) const
 
virtual void slot_preObserverUpdate ()
 
virtual bool setUpOcean ()
 
virtual void cleanup (void)
 
virtual void slot_reloadShader ()
 
virtual void applyLighting (osg::RenderInfo &info, const osg::Camera *osgCamera, DtTritonGroupTcsUserData *userData, double windSpeed) const
 
virtual bool applyQuality () const
 
virtual void applySpectralModel (void) const
 
virtual void updateShader (osg::Node *node, osg::State &state) const
 
virtual void onPostTick (void)
 
virtual void prepEnvironmentMap (const DtOsgSkyObject *skyObject, const osg::Camera *camera, osg::State &state, DtTritonGroupTcsUserData *userData) const
 
virtual void prepHeightMapAndBreakingWavesMaps (const DtHeightMapManager *heightMapMgr, osg::State &state, osg::RenderInfo &renderInfo, DtTritonGroupTcsUserData *userData, bool forceUpdate) const
 
virtual void prepReflectionMap (osg::ref_ptr< DtPlanarReflectionCamera > planarReflectionCamera, const osg::State &state, double windSpeed, DtTritonGroupTcsUserData *userData) const
 
virtual void setupTritonLightFogVisibility (const osg::Camera *camera, DtOsgSkyObject *skyObject, std::pair< bool, float > isAboveWater, bool skyEnabled, DtTritonGroupTcsUserData *userData) const
 
virtual Vector4_32 calculateUnderWaterFogColor (Vector4_32 ambientLight, float cameraDepth) const
 
virtual std::pair< bool, float > isCameraAboveWater (Triton::Ocean *ocean, const Triton::Environment *environment, const Triton::Camera *camera) const
 
virtual void setUpTritonParticlesAdditiveBlend (void) const
 
virtual void setUpGodRaysFading (const DtOsgCullVisitorParameters *params, DtTritonGroupTcsUserData *userData) const
 
virtual void setUpZoomLevel (const DtOsgCullVisitorParameters *params, DtTritonGroupTcsUserData *userData) const
 
virtual void setUpViewport (Triton::Camera *tritonCamera, osg::Camera *camera) const
 
virtual void restoreOsgState (osg::State &state) const
 
virtual void updatePlanarReflectionCamera (const Vector4_32 &fogColor, bool skyEnabled, DtTritonGroupTcsUserData *userData) const
 
virtual void addGraphicsContextIfNecessary (osg::GraphicsContext *key)
 
virtual const osg::StateSet * shadowTechniqueStateSet (const osg::Camera *osgCamera) const
 
virtual void updateSunIntensity (const osg::Camera *osgCamera, DtTritonGroupTcsUserData *userData, double windSpeed) const
 
virtual void updateLighingBasedonSensorFX (const osg::Camera *osgCamera, DtTritonGroupTcsUserData *userData) const
 
virtual void syncHeightMapToGpu (const DtHeightMapManager *heightMapMgr, const osg::State &state, const osg::Camera *camera, DtTritonGroupTcsUserData *userData) const
 
virtual void logTritonInitializationInfo (void) const
 
virtual void updateBreakingWavesParametersInTriton (void)
 
virtual void slot_hdrEnabledChanged (bool)
 

Protected Attributes

Triton::ResourceLoader * myResourceLoader
 
Triton::Environment * myEnvironment
 
Triton::OceanmyOcean
 
double myDefaultDampingDistance
 
osg::Vec3 myOceanFloorNormal
 
osg::Vec3 myOceanFloorOrigin
 
bool myInitializationComplete
 
bool myAllowUnderwater
 
float myLightThreshold
 
float mySpecularThreshold
 
Vector4_32 myUnderwaterFogColor
 
double myUnderwaterVisibility
 
makVrv::DtDemyDe
 
osg::ref_ptr< osg::ClipNode > myClipNode
 
DtTritonManagermyTritonManager
 
DtSignalConnectionManager myConnections
 
ContextToHandleMap myOsgGcToOsGc
 
osg::ref_ptr< osg::Texture2D > myOceanMaskTexture
 
DtVector4< doublemyVrvLatLongMinMax
 
bool mySetupFailed
 
bool myMutableShadersDirty
 
std::vector< unsigned intmyMutableUserShaderVector
 
DtUniqueID myHeightMapRegisteredId
 
DtTritonImGuiHelpermyImGuiHelper
 
DtTritonRenderingParameters myRenderingParameters
 
DtSkyObjectManagermySkyObjectManager
 
const float myWindSpeedUpperBound = 40.0f
 
const float myMaxReflectionBlend = 0.5f
 
DtHeightMapSuperManagermyHeightMapSuperManager
 
const bool myHeightMapEnabled
 
const bool myBreakingWavesEnabled
 
const bool myBreakingWavesMapEnabled
 
const bool myPlanarReflectionsEnabled
 
bool myPreSubmergedHDROn
 
osg::ref_ptr
< osgEarth::GDALImageLayer > 
myMaskImageLayer
 

Private Member Functions

 DtTritonDrawable ()=delete
 
 DtTritonDrawable (const DtTritonDrawable &drawable)=delete
 
DtTritonDrawableoperator= (const DtTritonDrawable &)=delete
 

Friends

class DtTritonImGuiHelper
 

Member Typedef Documentation

typedef std::map< osg::GraphicsContext*, void* > makVrv::DtTritonDrawable::ContextToHandleMap
protected

Constructor & Destructor Documentation

makVrv::DtTritonDrawable::DtTritonDrawable ( makVrv::DtDe de,
DtTritonManager tritonManager 
)

CTOR.

virtual makVrv::DtTritonDrawable::~DtTritonDrawable ( )
protectedvirtual

Destructor.

makVrv::DtTritonDrawable::DtTritonDrawable ( )
privatedelete

Default Constructor not implemented.

makVrv::DtTritonDrawable::DtTritonDrawable ( const DtTritonDrawable drawable)
privatedelete

Copy Constructor not implemented – Copy not allowed use clone instead.

Member Function Documentation

DtTritonDrawable& makVrv::DtTritonDrawable::operator= ( const DtTritonDrawable )
privatedelete

Assignment Operator not implemented – Copy not allowed use clone.

virtual void makVrv::DtTritonDrawable::setUpEnvironment ( )
virtual

set up the environment

virtual void makVrv::DtTritonDrawable::setUpOceanMask ( )
virtual

setup the ocean mask if it has not been setup yet.

virtual Triton::Ocean* makVrv::DtTritonDrawable::ocean ( )
virtual

Return the underlying Triton::Ocean object.

virtual Triton::Environment* makVrv::DtTritonDrawable::environment ( )
virtual

Return the underlying Triton::Environment object.

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

Perform drawing of the Ocean from the render thread.

virtual void makVrv::DtTritonDrawable::setUnderwaterFogColor ( const Vector4_32 color)
virtual

Set/get the base (unlit) fog color when underwater.

virtual const Vector4_32& makVrv::DtTritonDrawable::underwaterFogColor ( ) const
virtual

Set/get the base (unlit) fog color when underwater.

virtual void makVrv::DtTritonDrawable::setUnderwaterVisibility ( double  visibility)
virtual

Set/get the visibility when underwater.

virtual double makVrv::DtTritonDrawable::underwaterVisibility ( ) const
virtual

Set/get the visibility when underwater.

virtual bool makVrv::DtTritonDrawable::isInitialized ( ) const
virtual

Whether Triton has been fully initialized (after its first frame.)

virtual void makVrv::DtTritonDrawable::setAllowUnderwaterEffects ( bool  allow)
virtual

Whether underwater fog etc. is triggered when eye goes under the water surface.

virtual bool makVrv::DtTritonDrawable::allowUnderwaterEffects ( ) const
virtual

Whether underwater fog is enabled.

virtual void makVrv::DtTritonDrawable::releaseGLObjects ( osg::State *  state = 0) const
virtual

Destroy the openGL objects.

virtual void makVrv::DtTritonDrawable::planarReflectionCameras ( std::vector< osg::ref_ptr< const DtPlanarReflectionCamera >> &  planarReflectionCameras) const
virtual

Get all available ones. Used by the imgui helper.

virtual osg::ref_ptr<DtPlanarReflectionCamera> makVrv::DtTritonDrawable::planarReflectionCamera ( osg::Camera *  osgCamera) const
virtual

accessor for the DtPlanarReflection object for a camera. SensorFX needs access to setup the shaders correctly.

virtual osg::Group* makVrv::DtTritonDrawable::getTritonGeode ( )
virtual

accessor for the triton geode object (parent of the triton drawable)

virtual const osg::Group* makVrv::DtTritonDrawable::getTritonGeode ( ) const
virtual

accessor for the triton geode object (parent of the triton drawable)

virtual const DtTritonRenderingParameters& makVrv::DtTritonDrawable::renderingParameters ( void  ) const
virtual

get the rendering parameters (const)

virtual DtTritonRenderingParameters& makVrv::DtTritonDrawable::renderingParameters ( void  )
virtual

get the rendering parameters (cnon-const)

virtual void makVrv::DtTritonDrawable::shaderUpdateLightUniforms ( osg::RenderInfo &  info,
const osg::Camera *  osgCamera,
DtTritonGroupTcsUserData userData,
double  windSpeed 
) const
protectedvirtual

update the light uniforms for a particular shader

virtual void makVrv::DtTritonDrawable::slot_preObserverUpdate ( )
protectedvirtual

setup the IMGui and read back any information from ImGui widgets

virtual bool makVrv::DtTritonDrawable::setUpOcean ( )
protectedvirtual

setup the triton drawable based on the render info called the first time the ocean is rendered or if the shaders are regenerated.

virtual void makVrv::DtTritonDrawable::cleanup ( void  )
protectedvirtual

called by the destructor or releaseGL objects to cleanup this drawable's state

virtual void makVrv::DtTritonDrawable::slot_reloadShader ( )
protectedvirtual

connected to the shared state reload shader signal in order to clean up the triton shaders

virtual void makVrv::DtTritonDrawable::applyLighting ( osg::RenderInfo &  info,
const osg::Camera *  osgCamera,
DtTritonGroupTcsUserData userData,
double  windSpeed 
) const
protectedvirtual

setup and apply the lighting for this frame

virtual bool makVrv::DtTritonDrawable::applyQuality ( ) const
protectedvirtual

update the drawable to use the current quality setting for the triton ocean

virtual void makVrv::DtTritonDrawable::applySpectralModel ( void  ) const
protectedvirtual

change spectral model if necessary

virtual void makVrv::DtTritonDrawable::updateShader ( osg::Node *  node,
osg::State &  state 
) const
protectedvirtual

called every time the drawable renders to check if the shader state has changed and if so it updates the shaders

virtual void makVrv::DtTritonDrawable::onPostTick ( void  )
protectedvirtual

connected to the post tick signal and is used to call the triton ocean's post draw function

virtual void makVrv::DtTritonDrawable::prepEnvironmentMap ( const DtOsgSkyObject skyObject,
const osg::Camera *  camera,
osg::State &  state,
DtTritonGroupTcsUserData userData 
) const
protectedvirtual

setup the environment map by getting it from the sky object

virtual void makVrv::DtTritonDrawable::prepHeightMapAndBreakingWavesMaps ( const DtHeightMapManager heightMapMgr,
osg::State &  state,
osg::RenderInfo &  renderInfo,
DtTritonGroupTcsUserData userData,
bool  forceUpdate 
) const
protectedvirtual

utility function for setting up the height map and breaking wave maps for rendering.

virtual void makVrv::DtTritonDrawable::prepReflectionMap ( osg::ref_ptr< DtPlanarReflectionCamera planarReflectionCamera,
const osg::State &  state,
double  windSpeed,
DtTritonGroupTcsUserData userData 
) const
protectedvirtual

utility function for setting up the reflection map for rendering.

virtual void makVrv::DtTritonDrawable::setupTritonLightFogVisibility ( const osg::Camera *  camera,
DtOsgSkyObject skyObject,
std::pair< bool, float >  isAboveWater,
bool  skyEnabled,
DtTritonGroupTcsUserData userData 
) const
protectedvirtual

calculate the current fog value based on if the camera is under the water or not

virtual Vector4_32 makVrv::DtTritonDrawable::calculateUnderWaterFogColor ( Vector4_32  ambientLight,
float  cameraDepth 
) const
protectedvirtual

Calculate the final underwater fog color based on the current ambient color and depth.

virtual std::pair<bool, float> makVrv::DtTritonDrawable::isCameraAboveWater ( Triton::Ocean ocean,
const Triton::Environment *  environment,
const Triton::Camera *  camera 
) const
protectedvirtual

Check if the camera is above or below the water line. Returns true/false and the depth of the camera if it is below the water 0 otherwise Modified version of isCameraAboveWater in triton.

virtual void makVrv::DtTritonDrawable::setUpTritonParticlesAdditiveBlend ( void  ) const
protectedvirtual

sets up the particle blend setting in triton based on if HDR is on or off

virtual void makVrv::DtTritonDrawable::setUpGodRaysFading ( const DtOsgCullVisitorParameters params,
DtTritonGroupTcsUserData userData 
) const
protectedvirtual

sets up the amount to fade the god rays based on the camera movement

virtual void makVrv::DtTritonDrawable::setUpZoomLevel ( const DtOsgCullVisitorParameters params,
DtTritonGroupTcsUserData userData 
) const
protectedvirtual

set the triton internal zoom level based on the cull params zoom level or use the triton override value if it is enabled.

virtual void makVrv::DtTritonDrawable::setUpViewport ( Triton::Camera *  tritonCamera,
osg::Camera *  camera 
) const
protectedvirtual

setup the triton camera's viewport based on the current osg camera's viewport

virtual void makVrv::DtTritonDrawable::restoreOsgState ( osg::State &  state) const
protectedvirtual

restore the opengl state to match the expected osg opengl state

virtual void makVrv::DtTritonDrawable::updatePlanarReflectionCamera ( const Vector4_32 fogColor,
bool  skyEnabled,
DtTritonGroupTcsUserData userData 
) const
protectedvirtual

update the planar refelction camera, pass it the mirror matrix and update the fog color

virtual void makVrv::DtTritonDrawable::addGraphicsContextIfNecessary ( osg::GraphicsContext *  key)
protectedvirtual

gets the current graphics context handle and stores it in a map with the osg GraphicsContext so we can clean up VAO's correctly needs to have the osg::GraphicsContext be the current active context so it should really only be called from a drawImplemenation()

virtual const osg::StateSet* makVrv::DtTritonDrawable::shadowTechniqueStateSet ( const osg::Camera *  osgCamera) const
protectedvirtual

get the state set for the DtOsgShadowTechnique for the passed in osg camera

virtual void makVrv::DtTritonDrawable::updateSunIntensity ( const osg::Camera *  osgCamera,
DtTritonGroupTcsUserData userData,
double  windSpeed 
) const
protectedvirtual

Update the sun intensity for triton environment based upon silverlining/skyobject & hdr.

virtual void makVrv::DtTritonDrawable::updateLighingBasedonSensorFX ( const osg::Camera *  osgCamera,
DtTritonGroupTcsUserData userData 
) const
protectedvirtual

Update the directional light position and intensity if SensorFX has been enabled.

virtual void makVrv::DtTritonDrawable::syncHeightMapToGpu ( const DtHeightMapManager heightMapMgr,
const osg::State &  state,
const osg::Camera *  camera,
DtTritonGroupTcsUserData userData 
) const
protectedvirtual

sends the height map to the gpu .

virtual void makVrv::DtTritonDrawable::logTritonInitializationInfo ( void  ) const
protectedvirtual

log once

virtual void makVrv::DtTritonDrawable::updateBreakingWavesParametersInTriton ( void  )
protectedvirtual

update settings in triton

virtual void makVrv::DtTritonDrawable::slot_hdrEnabledChanged ( bool  )
protectedvirtual

Friends And Related Function Documentation

friend class DtTritonImGuiHelper
friend

so that slot_reloadShader can be accessed

Member Data Documentation

boost::signalslib::signal<void()> makVrv::DtTritonDrawable::signal_postInitialize

Emitted when Triton has been initialized.

boost::signalslib::signal<void()> makVrv::DtTritonDrawable::signal_environmentToBeDestroyed

Emitted when the Triton environment is to be destroyed.

Triton::ResourceLoader* makVrv::DtTritonDrawable::myResourceLoader
protected
Triton::Environment* makVrv::DtTritonDrawable::myEnvironment
protected
Triton::Ocean* makVrv::DtTritonDrawable::myOcean
protected
double makVrv::DtTritonDrawable::myDefaultDampingDistance
protected
osg::Vec3 makVrv::DtTritonDrawable::myOceanFloorNormal
protected
osg::Vec3 makVrv::DtTritonDrawable::myOceanFloorOrigin
protected
bool makVrv::DtTritonDrawable::myInitializationComplete
protected
bool makVrv::DtTritonDrawable::myAllowUnderwater
protected
float makVrv::DtTritonDrawable::myLightThreshold
protected
float makVrv::DtTritonDrawable::mySpecularThreshold
protected
Vector4_32 makVrv::DtTritonDrawable::myUnderwaterFogColor
protected
double makVrv::DtTritonDrawable::myUnderwaterVisibility
protected
makVrv::DtDe& makVrv::DtTritonDrawable::myDe
protected
osg::ref_ptr< osg::ClipNode > makVrv::DtTritonDrawable::myClipNode
protected
DtTritonManager& makVrv::DtTritonDrawable::myTritonManager
protected
DtSignalConnectionManager makVrv::DtTritonDrawable::myConnections
protected
ContextToHandleMap makVrv::DtTritonDrawable::myOsgGcToOsGc
protected
osg::ref_ptr<osg::Texture2D> makVrv::DtTritonDrawable::myOceanMaskTexture
protected
DtVector4<double> makVrv::DtTritonDrawable::myVrvLatLongMinMax
protected
bool makVrv::DtTritonDrawable::mySetupFailed
protected
bool makVrv::DtTritonDrawable::myMutableShadersDirty
mutableprotected
std::vector<unsigned int> makVrv::DtTritonDrawable::myMutableUserShaderVector
mutableprotected
DtUniqueID makVrv::DtTritonDrawable::myHeightMapRegisteredId
protected
DtTritonImGuiHelper* makVrv::DtTritonDrawable::myImGuiHelper
protected
DtTritonRenderingParameters makVrv::DtTritonDrawable::myRenderingParameters
protected
DtSkyObjectManager& makVrv::DtTritonDrawable::mySkyObjectManager
protected
const float makVrv::DtTritonDrawable::myWindSpeedUpperBound = 40.0f
protected
const float makVrv::DtTritonDrawable::myMaxReflectionBlend = 0.5f
protected
DtHeightMapSuperManager& makVrv::DtTritonDrawable::myHeightMapSuperManager
protected

dereferenced

const bool makVrv::DtTritonDrawable::myHeightMapEnabled
protected
const bool makVrv::DtTritonDrawable::myBreakingWavesEnabled
protected
const bool makVrv::DtTritonDrawable::myBreakingWavesMapEnabled
protected
const bool makVrv::DtTritonDrawable::myPlanarReflectionsEnabled
protected
bool makVrv::DtTritonDrawable::myPreSubmergedHDROn
protected
osg::ref_ptr<osgEarth::GDALImageLayer> makVrv::DtTritonDrawable::myMaskImageLayer
protected

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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)