- All Implemented Interfaces:
public class SoComplexity extends SoNodeShape complexity node. This node sets the current shape complexity value. This is a heuristic value which provides a hint at what geometric complexity to render shape nodes. Values range from 0 to 1, where 0 means minimum complexity and 1 means maximum complexity. Each shape node interprets complexity in its own way.
Shape complexity (
Shape complexity always affects rendering and primitive generation for the
SoCallbackAction. For some shapes, it also affects picking.
There are three ways to interpret shape complexity, depending on the
- BOUNDING_BOX complexity ignores the
valuefield and renders all shapes as bounding boxes. Each bounding box shape is drawn as if it were an
SoCubeand is subject to all of the drawing attributes of an
SoCube(current material, drawing style, etc.) except that texturing is not applied. The other two types use the
valuefield to determine the tessellation of shapes into polygons.
- OBJECT_SPACE complexity (the default) uses
valuedirectly to determine the tessellation.
- SCREEN_SPACE complexity depends on
valueand the projected size of the shape on the screen; a
valueof 0 produces the minimum tessellation for a shape, and a
valueof 1 produces a tessellation that is fine enough that each edge of a polygon is about 1 or two pixels in length. Since the projected size depends on the camera position, objects may be tessellated differently every frame if the camera is moving; note that this may have adverse effects on render caching in
The following is a sampling of the effects of shape complexity.
- Simple shapes (
SoCube, etc): controls number of faces generated.
- Markers/Points (
SoPointSet, etc): controls the number of markers/points actually drawn.
- Text (
SoText3, etc): controls tesselation of glyph edges in renderStyle POLYGON.
(Quality in renderStyle TEXTURE is controlled by
- NURBS (
SoNurbsSurface, etc): controls tesselation of the curve/surface.
SoCircularExtrusion: controls decimation of the extruded geometry.
- Volume rendering (
SoVolumeRender): controls the number of times the volume is sampled along each ray when the numSlicesControl field is set to AUTOMATIC.
- Height field rendering (
SoHeightFieldRender): controls tesselation of the height field (how many triangles are generated for rendering).
For texture nodes (
SoTextureCubeMap, etc), textureQuality controls the OpenGL minFilter, magFilter and mipmap settings that the hardware will use when applying the texture image to the geometry. With the default value (0.5) textures are not interpolated. We recommend using a higher value, e.g. 0.75, on modern graphics hardware.
For text nodes (
SoText3, etc), when the
SoFontrenderStyle field is set to TEXTURE, the OpenGL settings controlled by textureQuality strongly affect the quality of the text rendering. With the default value (0.5) textures are not interpolated, so text may appear to not be anti-aliased. We recommend using a higher value, e.g. 0.75, on modern graphics hardware.
In a few cases, e.g.
SoImageBackground, setting textureQuality to zero disables rendering complexity.
type OBJECT_SPACE value 0.5 textureQuality 0.5 bboxType BBOX_AABB
Nested Class Summary
Nested Classes Modifier and Type Class Description
SoComplexity.BboxTypesBounding box type.
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
Fields Modifier and Type Field Description
bboxTypeBounding box type to use.
textureQualityHint about texture quality.
typeHow shape complexity is interpreted.
Constructors Constructor Description
SoComplexity()Creates a complexity node with default settings.
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
public final SoSFEnum<SoComplexity.Types> typeHow shape complexity is interpreted. . Default is OBJECT_SPACE. The default value can also be set using the environment variable OIV_COMPLEXITY_TYPE.
public final SoSFFloat valueComplexity value. Default is 0.5. The default value can also be set using the environment variable OIV_COMPLEXITY (0.0 to 1.0).
public final SoSFFloat textureQualityHint about texture quality. Default is 0.5. A value of 0 indicates that the fastest texturing should be used, while a value of 1 indicates that the best quality texturing should be used. The default value can also be set using the environment variable OIV_TEXTURE_QUALITY (0.0 to 1.0).
For backward compatibility, the default value is 0.5. This value was chosen when texturing was an expensive (low performance) feature of graphics hardware. It produces relatively low quality texture rendering because no interpolation is done. On modern graphics hardware we recommend setting this to a higher value, e.g. 0.75.
The table below shows the correspondence between Open Inventor texture quality and OpenGL texture filtering options.
* minFilter value
** magFilter value
*** Need Mipmaps
<= 0.5 GL_NEAREST GL_NEAREST false ExtendedFormats or CompressedFormats <= 0.6 GL_LINEAR GL_NEAREST false ExtendedFormats or CompressedFormats <= 0.7 GL_NEAREST_MIPMAP_NEAREST GL_NEAREST true ExtendedFormats or CompressedFormats <= 0.8 GL_NEAREST_MIPMAP_LINEAR GL_LINEAR true InternalFormats or CompressedFormats <= 0.9 GL_LINEAR_MIPMAP_NEAREST GL_LINEAR true InternalFormats or CompressedFormats <= 1.0 GL_LINEAR_MIPMAP_LINEAR GL_LINEAR true InternalFormats or CompressedFormats
*** Means that Open Inventor automatically generates mipmap textures. See the OpenGL Programming Guide for information on mipmap textures.
public final SoSFEnum<SoComplexity.BboxTypes> bboxTypeBounding box type to use. . Default is BBOX_AABB. By default an Axis Aligned Bounding Box (AABB) is used. It is simpler and faster to compute but may not be a good approximation of the shape's actual volume. Using an Object Oriented Bounding box is more compute intensive, but can provide a tighter volume box allowing better performance for actions such as culling, picking and selection.
- Open Inventor 8.1