H3D API  2.4.1
GraphicsOptions.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __GRAPHICSOPTIONS_H__
30 #define __GRAPHICSOPTIONS_H__
31 
32 #include <H3D/H3DOptionNode.h>
33 #include <H3D/SFBool.h>
34 #include <H3D/SFInt32.h>
35 #include <H3D/X3DGeometryNode.h>
36 #include <H3D/ShadowCaster.h>
37 
38 namespace H3D {
39 
47  class H3DAPI_API GraphicsOptions : public H3DOptionNode {
48  public:
49 
51 
53  GraphicsOptions( Inst< SFNode > _metadata = 0,
54  Inst< SFBool > _useCaching = 0,
55  Inst< SFInt32 > _cachingDelay = 0,
56  Inst< SFBool > _cacheOnlyGeometryNodes = 0,
57  Inst< SFString > _frustumCullingMode = 0,
58  Inst< SFBool > _useDefaultShadows = 0,
59  Inst< SFFloat > _defaultShadowDarkness = 0,
60  Inst< SFFloat > _defaultShadowDepthOffset = 0,
61  Inst< SFBool > _preferVertexBufferObject = 0,
62  Inst< SFString > _defaultShadowGeometryAlgorithm = 0,
63  Inst< SFShadowCaster > _defaultShadowCaster = 0,
64  Inst< SFBool > _bindlessTextures = 0,
65  Inst< SFTime > _bindlessTexturesUnusedTime = 0,
66  Inst< SFBool > _shareTextures = 0,
67  Inst< SFInt32 > _maxTextureDimension = 0,
68  Inst< SFString > _textureCompression = 0 );
69 
70  bool cacheNode( Node *n ) {
71  if( !useCaching->getValue() ) return false;
72  if( !cacheOnlyGeometries->getValue() ) return true;
73 
74  // only X3DGeometryNodes are cached
75  return dynamic_cast< X3DGeometryNode * >( n ) != NULL;
76 
77  }
78 
84  H3DUniquePtr< SFBool > useCaching;
85 
94  H3DUniquePtr< SFInt32 > cachingDelay;
95 
96 
102  H3DUniquePtr< SFBool > cacheOnlyGeometries;
103 
119  H3DUniquePtr< SFString > frustumCullingMode;
120 
127  H3DUniquePtr< SFBool > useDefaultShadows;
128 
136  H3DUniquePtr< SFFloat > defaultShadowDarkness;
137 
148  H3DUniquePtr< SFFloat > defaultShadowDepthOffset;
149 
164  H3DUniquePtr< SFBool > preferVertexBufferObject;
165 
176  H3DUniquePtr< SFString > defaultShadowGeometryAlgorithm;
177 
182  H3DUniquePtr< SFShadowCaster > defaultShadowCaster;
183 
188  H3DUniquePtr < SFBool > bindlessTextures;
189 
195  H3DUniquePtr < SFTime > bindlessTexturesUnusedTime;
196 
201  H3DUniquePtr < SFBool > shareTextures;
202 
210  H3DUniquePtr < SFInt32 > maxTextureDimension;
211 
220  H3DUniquePtr < SFString > textureCompression;
221 
224  };
225 }
226 
227 #endif
Header file for H3DOptionNode.
Contains the SFBool field class.
Contains the SFInt32 field class.
Header file for ShadowCaster.
Header file for X3DGeometryNode, X3D scene-graph node.
Specifies parameters to use for graphical rendering of nodes.
Definition: GraphicsOptions.h:47
H3DUniquePtr< SFBool > shareTextures
Share image data which has the same URL.
Definition: GraphicsOptions.h:201
H3DUniquePtr< SFString > textureCompression
Texture compression method.
Definition: GraphicsOptions.h:220
H3DUniquePtr< SFInt32 > cachingDelay
Specifies the number of frames the fields of a node that affect the graphical rendering must be uncha...
Definition: GraphicsOptions.h:94
H3DUniquePtr< SFShadowCaster > defaultShadowCaster
The defaultShadowCaster field contains the ShadowCaster node used for default shadows.
Definition: GraphicsOptions.h:182
H3DUniquePtr< SFBool > preferVertexBufferObject
Controls rendering of certain geometries, such as IndexedTriangleSet.
Definition: GraphicsOptions.h:164
H3DUniquePtr< SFString > frustumCullingMode
Determines if view frustum culling should be made and if so at what level.
Definition: GraphicsOptions.h:119
H3DUniquePtr< SFBool > bindlessTextures
Use bindless textures when possible.
Definition: GraphicsOptions.h:188
H3DUniquePtr< SFBool > useDefaultShadows
Controls if shadows created by using the shadow field in Appearance nodes should be on or not.
Definition: GraphicsOptions.h:127
H3DUniquePtr< SFBool > cacheOnlyGeometries
If the cacheOnlyGeometries field is true only nodes that inherit from X3DGeometryNode will be cached.
Definition: GraphicsOptions.h:102
H3DUniquePtr< SFInt32 > maxTextureDimension
A maximum size for a texture dimension.
Definition: GraphicsOptions.h:210
H3DUniquePtr< SFFloat > defaultShadowDarkness
Controls the shadow darkness of the default ShadowCaster that is is used by shadows created by using ...
Definition: GraphicsOptions.h:136
H3DUniquePtr< SFBool > useCaching
The useCaching field specifies if display lists should be used to cache OpenGL calls in order to spee...
Definition: GraphicsOptions.h:84
H3DUniquePtr< SFFloat > defaultShadowDepthOffset
The defaultShadowDepthOffset field controls the z offset of drawn shadow volumes.
Definition: GraphicsOptions.h:148
H3DUniquePtr< SFTime > bindlessTexturesUnusedTime
Time which a resident texture must be unused for, before it is automatically made non-resident.
Definition: GraphicsOptions.h:195
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: GraphicsOptions.h:223
H3DUniquePtr< SFString > defaultShadowGeometryAlgorithm
The defaultShadowGeometryAlgorithm field controls how to calculate and draw the shadow volumes for ar...
Definition: GraphicsOptions.h:176
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: H3DOptionNode.h:41
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
Template to make sure that the Node that is set in a SFNode is of a specified Node type.
Definition: SFNode.h:97
This is the base node type for all geometry in X3D.
Definition: X3DGeometryNode.h:61
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194