H3D API  2.4.1
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
H3D::GraphicsOptions Class Reference

Specifies parameters to use for graphical rendering of nodes. More...

#include <H3D/GraphicsOptions.h>

Inheritance diagram for H3D::GraphicsOptions:
Inheritance graph

Public Member Functions

 GraphicsOptions (Inst< SFNode > _metadata=0, Inst< SFBool > _useCaching=0, Inst< SFInt32 > _cachingDelay=0, Inst< SFBool > _cacheOnlyGeometryNodes=0, Inst< SFString > _frustumCullingMode=0, Inst< SFBool > _useDefaultShadows=0, Inst< SFFloat > _defaultShadowDarkness=0, Inst< SFFloat > _defaultShadowDepthOffset=0, Inst< SFBool > _preferVertexBufferObject=0, Inst< SFString > _defaultShadowGeometryAlgorithm=0, Inst< SFShadowCaster > _defaultShadowCaster=0, Inst< SFBool > _bindlessTextures=0, Inst< SFTime > _bindlessTexturesUnusedTime=0, Inst< SFBool > _shareTextures=0, Inst< SFInt32 > _maxTextureDimension=0, Inst< SFString > _textureCompression=0)
 Constructor.
 
- Public Member Functions inherited from H3D::H3DOptionNode
 H3DOptionNode (Inst< SFNode > _metadata=0)
 Constructor.
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
- Public Member Functions inherited from H3D::X3DNode
 X3DNode (Inst< SFNode > _metadata=0)
 Constructor.
 
X3DMetadataObjectgetMetadataByName (const string &_name)
 Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual void render ()
 the render() function is used for the depth-first rendering traversal of the scene-graph. More...
 
virtual void traverseSG (TraverseInfo &ti)
 traverseSG is called once per scenegraph loop on the scene in order to traverse the scenegraph. More...
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 

Public Attributes

H3DUniquePtr< SFBooluseCaching
 The useCaching field specifies if display lists should be used to cache OpenGL calls in order to speed up rendering of non-changing parts. More...
 
H3DUniquePtr< SFInt32cachingDelay
 Specifies the number of frames the fields of a node that affect the graphical rendering must be unchanged in order for a display list cache to be built. More...
 
H3DUniquePtr< SFBoolcacheOnlyGeometries
 If the cacheOnlyGeometries field is true only nodes that inherit from X3DGeometryNode will be cached. More...
 
H3DUniquePtr< SFStringfrustumCullingMode
 Determines if view frustum culling should be made and if so at what level. More...
 
H3DUniquePtr< SFBooluseDefaultShadows
 Controls if shadows created by using the shadow field in Appearance nodes should be on or not. More...
 
H3DUniquePtr< SFFloatdefaultShadowDarkness
 Controls the shadow darkness of the default ShadowCaster that is is used by shadows created by using the shadow field in Appearance nodes. More...
 
H3DUniquePtr< SFFloatdefaultShadowDepthOffset
 The defaultShadowDepthOffset field controls the z offset of drawn shadow volumes. More...
 
H3DUniquePtr< SFBoolpreferVertexBufferObject
 Controls rendering of certain geometries, such as IndexedTriangleSet. More...
 
H3DUniquePtr< SFStringdefaultShadowGeometryAlgorithm
 The defaultShadowGeometryAlgorithm field controls how to calculate and draw the shadow volumes for arbitrary volumes(see ShadowGeometry). More...
 
H3DUniquePtr< SFShadowCasterdefaultShadowCaster
 The defaultShadowCaster field contains the ShadowCaster node used for default shadows. More...
 
H3DUniquePtr< SFBoolbindlessTextures
 Use bindless textures when possible. More...
 
H3DUniquePtr< SFTimebindlessTexturesUnusedTime
 Time which a resident texture must be unused for, before it is automatically made non-resident. More...
 
H3DUniquePtr< SFBoolshareTextures
 Share image data which has the same URL. More...
 
H3DUniquePtr< SFInt32maxTextureDimension
 A maximum size for a texture dimension. More...
 
H3DUniquePtr< SFStringtextureCompression
 Texture compression method. More...
 
- Public Attributes inherited from H3D::H3DOptionNode
H3DUniquePtr< FieldupdateOption
 Field to collect update event from every option parameters, all inherited Option Node should route its option parameter fields to it.
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 Meta data about the node. More...
 

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 

Additional Inherited Members

- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 

Detailed Description

Specifies parameters to use for graphical rendering of nodes.

Examples:

Member Data Documentation

◆ bindlessTextures

H3DUniquePtr< SFBool > H3D::GraphicsOptions::bindlessTextures

Use bindless textures when possible.

Default value: false
Access type: inputOutput

Referenced by GraphicsOptions(), and H3D::X3DProgrammableShaderObject::X3DProgrammableShaderObject().

◆ bindlessTexturesUnusedTime

H3DUniquePtr< SFTime > H3D::GraphicsOptions::bindlessTexturesUnusedTime

Time which a resident texture must be unused for, before it is automatically made non-resident.

(seconds)

Default value: 5
Access type: inputOutput

Referenced by GraphicsOptions(), and H3D::Scene::idle().

◆ cacheOnlyGeometries

H3DUniquePtr< SFBool > H3D::GraphicsOptions::cacheOnlyGeometries

If the cacheOnlyGeometries field is true only nodes that inherit from X3DGeometryNode will be cached.

Default value: false
Access type: inputOutput

Referenced by GraphicsOptions(), and H3D::H3DDisplayListObject::DisplayList::usingCaching().

◆ cachingDelay

H3DUniquePtr< SFInt32 > H3D::GraphicsOptions::cachingDelay

Specifies the number of frames the fields of a node that affect the graphical rendering must be unchanged in order for a display list cache to be built.

E.g. a value of 3 means that a display list will be build after rendering the node successfully 3 frames in a row without changes to any fields that affect the rendering.

Default value: 3
Access type: inputOutput

Referenced by H3D::H3DDisplayListObject::DisplayList::cachingDelay(), H3D::X3DGeometryNode::DisplayList::cachingDelay(), and GraphicsOptions().

◆ defaultShadowCaster

H3DUniquePtr< SFShadowCaster > H3D::GraphicsOptions::defaultShadowCaster

The defaultShadowCaster field contains the ShadowCaster node used for default shadows.

Access type: outputOnly

Referenced by GraphicsOptions().

◆ defaultShadowDarkness

H3DUniquePtr< SFFloat > H3D::GraphicsOptions::defaultShadowDarkness

Controls the shadow darkness of the default ShadowCaster that is is used by shadows created by using the shadow field in Appearance nodes.

This option will only have effect if part of a GlobalSettings node.

Default value: 0.4
Access type: inputOutput

Referenced by GraphicsOptions(), H3D::FrameBufferTextureGenerator::render(), and H3D::H3DWindowNode::render().

◆ defaultShadowDepthOffset

H3DUniquePtr< SFFloat > H3D::GraphicsOptions::defaultShadowDepthOffset

The defaultShadowDepthOffset field controls the z offset of drawn shadow volumes.

The z offset will be r * defaultShadowDepthOffset where r is the smallest value that is guaranteed to produce a resolvable z offset for a given implementation. If this value is set to too small there will be z-fighting between shadow and object that casts the shadow(flickering). If this happens increase this value. The value needed depends on the precision of the depth buffer.

Default value: 6
Access type: inputOutput

Referenced by GraphicsOptions(), H3D::FrameBufferTextureGenerator::render(), and H3D::H3DWindowNode::render().

◆ defaultShadowGeometryAlgorithm

H3DUniquePtr< SFString > H3D::GraphicsOptions::defaultShadowGeometryAlgorithm

The defaultShadowGeometryAlgorithm field controls how to calculate and draw the shadow volumes for arbitrary volumes(see ShadowGeometry).

  • "GEOMETRY_SHADER" means that all is done in a geometry shader on the graphics card (if supported). This is faster but could have worse precision (depending on graphics card).
  • "CPU" - all calculations for the shadow volume is done on the CPU.

Default value: "GEOMETRY_SHADER"
Valid values: "CPU", "GEOMETRY_SHADER"
Access type: inputOutput

Referenced by GraphicsOptions(), and H3D::ShadowGeometry::update().

◆ frustumCullingMode

H3DUniquePtr< SFString > H3D::GraphicsOptions::frustumCullingMode

Determines if view frustum culling should be made and if so at what level.

View frustum culling will use the bounding box of a node and check it against the 6 planes of the view frustum to determine if it should be rendered or not. Everything that is outside the view frustum can be skipped.

Valid values are:

  • "NO_CULLING" - no view frustum culling is done.
  • "GEOMETRY" - culling is done at the geometry level, i.e. only X3DGeometryNodes will perform culling
  • "ALL" - culling will be done on all nodes with a bounding box in the scene graph.

Default value: "NO_CULLING"
Access type: inputOutput

Referenced by GraphicsOptions(), and H3D::H3DDisplayListObject::DisplayList::usingFrustumCulling().

◆ maxTextureDimension

H3DUniquePtr< SFInt32 > H3D::GraphicsOptions::maxTextureDimension

A maximum size for a texture dimension.

If <= 0 then no maximum limit is enforced. Otherwise, if a texture dimension exceeds the limit it is resized to the limit.

Default value: -1
Access type: inputOutput

Referenced by H3D::X3DTexture2DNode::glTexImage(), H3D::X3DTexture3DNode::glTexImage(), and GraphicsOptions().

◆ preferVertexBufferObject

H3DUniquePtr< SFBool > H3D::GraphicsOptions::preferVertexBufferObject

Controls rendering of certain geometries, such as IndexedTriangleSet.

If true then the affected geometries are rendered using vertex buffer object otherwise they are rendered as vertex arrays. This can be used to increase performance for certain geometries, such as large IndexedTriangleSets. Vertex buffer objects are only used if the graphics card supports it. Note that useCaching should be set to false to get the biggest effect from vertex buffer objects. NOTE: At the moment, no check is done that sizeof( GLfloat ) == sizeof( H3DFloat ), the same is true for the pairs GLdouble/H3DDouble and GLuint/H3DInt32. If you use this feature, make sure that this is true.

Default value: false
Access type: inputOutput

Referenced by GraphicsOptions(), H3D::Capsule::render(), H3D::Cylinder::render(), H3D::ElevationGrid::render(), H3D::FullscreenRectangle::render(), H3D::IndexedLineSet::render(), H3D::IndexedTriangleFanSet::render(), H3D::IndexedTriangleSet::render(), H3D::IndexedTriangleStripSet::render(), H3D::LineSet::render(), H3D::PointSet::render(), H3D::Polyline2D::render(), H3D::Polypoint2D::render(), H3D::Sphere::render(), H3D::SuperShape::render(), H3D::TriangleSet::render(), H3D::TriangleSet2D::render(), and H3D::TriangleStripSet::render().

◆ shareTextures

H3DUniquePtr< SFBool > H3D::GraphicsOptions::shareTextures

Share image data which has the same URL.

Default value: false
Access type: inputOutput

Referenced by GraphicsOptions(), and H3D::ImageTexture::useSharing().

◆ textureCompression

H3DUniquePtr< SFString > H3D::GraphicsOptions::textureCompression

Texture compression method.

May be overridden by individual TextureProperties nodes

Access type: inputOutput
Default value: "DEFAULT"
Valid values : "DEFAULT", "BC1", "BC2", "BC3", "BC4" "BC5", "BC6", "BC7"

Referenced by GraphicsOptions().

◆ useCaching

H3DUniquePtr< SFBool > H3D::GraphicsOptions::useCaching

The useCaching field specifies if display lists should be used to cache OpenGL calls in order to speed up rendering of non-changing parts.

Default value: true
Access type: inputOutput

Referenced by GraphicsOptions(), H3D::H3DDisplayListObject::DisplayList::usingCaching(), and H3D::X3DGeometryNode::DisplayList::usingCaching().

◆ useDefaultShadows

H3DUniquePtr< SFBool > H3D::GraphicsOptions::useDefaultShadows

Controls if shadows created by using the shadow field in Appearance nodes should be on or not.

This option will only have effect if part of a GlobalSettings node.

Default value: true
Access type: inputOutput

Referenced by GraphicsOptions(), H3D::FrameBufferTextureGenerator::render(), and H3D::H3DWindowNode::render().


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