H3D API
2.4.1
|
Specifies parameters to use for graphical rendering of nodes. More...
#include <H3D/GraphicsOptions.h>
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. | |
![]() | |
H3DOptionNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
virtual string | defaultXMLContainerField () |
Returns the default xml containerField attribute value. More... | |
![]() | |
X3DNode (Inst< SFNode > _metadata=0) | |
Constructor. | |
X3DMetadataObject * | getMetadataByName (const string &_name) |
Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More... | |
![]() | |
Node () | |
Constructor. | |
virtual Node * | clone (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. | |
X3DPrototypeInstance * | getProtoInstanceParent () |
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 Field * | getField (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< SFBool > | 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. More... | |
H3DUniquePtr< SFInt32 > | 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. More... | |
H3DUniquePtr< SFBool > | cacheOnlyGeometries |
If the cacheOnlyGeometries field is true only nodes that inherit from X3DGeometryNode will be cached. More... | |
H3DUniquePtr< SFString > | frustumCullingMode |
Determines if view frustum culling should be made and if so at what level. More... | |
H3DUniquePtr< SFBool > | useDefaultShadows |
Controls if shadows created by using the shadow field in Appearance nodes should be on or not. More... | |
H3DUniquePtr< SFFloat > | defaultShadowDarkness |
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< SFFloat > | defaultShadowDepthOffset |
The defaultShadowDepthOffset field controls the z offset of drawn shadow volumes. More... | |
H3DUniquePtr< SFBool > | preferVertexBufferObject |
Controls rendering of certain geometries, such as IndexedTriangleSet. More... | |
H3DUniquePtr< SFString > | defaultShadowGeometryAlgorithm |
The defaultShadowGeometryAlgorithm field controls how to calculate and draw the shadow volumes for arbitrary volumes(see ShadowGeometry). More... | |
H3DUniquePtr< SFShadowCaster > | defaultShadowCaster |
The defaultShadowCaster field contains the ShadowCaster node used for default shadows. More... | |
H3DUniquePtr< SFBool > | bindlessTextures |
Use bindless textures when possible. More... | |
H3DUniquePtr< SFTime > | bindlessTexturesUnusedTime |
Time which a resident texture must be unused for, before it is automatically made non-resident. More... | |
H3DUniquePtr< SFBool > | shareTextures |
Share image data which has the same URL. More... | |
H3DUniquePtr< SFInt32 > | maxTextureDimension |
A maximum size for a texture dimension. More... | |
H3DUniquePtr< SFString > | textureCompression |
Texture compression method. More... | |
![]() | |
H3DUniquePtr< Field > | updateOption |
Field to collect update event from every option parameters, all inherited Option Node should route its option parameter fields to it. | |
![]() | |
H3DUniquePtr< SFNode > | metadata |
Meta data about the node. More... | |
Static Public Attributes | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
![]() | |
static H3DNodeDatabase | database |
The H3DNodeDatabase for this node. | |
Additional Inherited Members | |
![]() | |
typedef std::map< Node *, Node * > | DeepCopyMap |
A map type used during a deep copy clone() to map from original nodes to cloned nodes. | |
![]() | |
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. | |
![]() | |
void | cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for the clone() method. More... | |
![]() | |
static Node * | getClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap) |
A helper function for nodes that implement clone() More... | |
Specifies parameters to use for graphical rendering of nodes.
Examples:
H3DUniquePtr< SFBool > H3D::GraphicsOptions::bindlessTextures |
Use bindless textures when possible.
Default value: false
Access type: inputOutput
Referenced by GraphicsOptions(), and H3D::X3DProgrammableShaderObject::X3DProgrammableShaderObject().
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().
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().
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().
H3DUniquePtr< SFShadowCaster > H3D::GraphicsOptions::defaultShadowCaster |
The defaultShadowCaster field contains the ShadowCaster node used for default shadows.
Access type: outputOnly
Referenced by GraphicsOptions().
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().
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().
H3DUniquePtr< SFString > H3D::GraphicsOptions::defaultShadowGeometryAlgorithm |
The defaultShadowGeometryAlgorithm field controls how to calculate and draw the shadow volumes for arbitrary volumes(see ShadowGeometry).
Default value: "GEOMETRY_SHADER"
Valid values: "CPU", "GEOMETRY_SHADER"
Access type: inputOutput
Referenced by GraphicsOptions(), and H3D::ShadowGeometry::update().
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:
Default value: "NO_CULLING"
Access type: inputOutput
Referenced by GraphicsOptions(), and H3D::H3DDisplayListObject::DisplayList::usingFrustumCulling().
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().
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().
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().
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().
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().
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().