public class SoLDMGlobalResourceParameters extends Inventor
For extensions that use the LDM module, particularly VolumeViz, these parameters can have a significant effect on resource usage (primarily memory) and rendering performance.
Memory management
This class allows the application to specify how much CPU and GPU memory VolumeViz can use to load data and textures. By default the main memory and texture memory limits are set to a percentage of the total available system and GPU memory (see the setMaxMainMemory()
and setMaxTexMemory()
methods). Applications can use the SoCpuDevice
and SoGLDevice
classes to query the total and available memory on the CPU and GPU. There is an additional memory allocation for the BufferObject cache described below. How VolumeViz uses CPU memory depends on the data source (tiled or not tiled), the tile cache policy (see setTileCacheType()
method) and the SoPreferences
variable LDM_USE_IN_MEM_COMPRESSION.
Tiles:
VolumeViz uses a data manager called LDM to manage volume data. LDM manages volume data in chunks called "tiles". If the volume size is larger than the tile size, then there are two classes of tile: full-resolution tiles containing actual data values and low-resolution tiles containing sub-sampled data values. The application may have native data that is already tiled or the data may be pre-processed to create tiles and store them in the LDM file format. In an LDM format file the tiles may optionally be compressed to save disk space and memory, but in this case, the tiles must be expanded before sending to the GPU. If the data is not tiled, for example disk formats like DICOM and SEGY or an in-memory volume, then tiles must be created in memory at runtime.
Tile size:
Note that the default tile size is small and generally you wll get better performance with non-tiled data by explicitly setting a larger tile size (see the ldmResourceParameters field and SoLDMResourceParameters.tileDimension
). If the volume size is 512^3 or less then the tile size may be set to the volume size to avoid the overhead of tiling. Do not set the tile size larger than 512 for a volume data set. However, if the volume is actually a large "image", i.e. the Z dimension is 1, then setting the tile size to 1024 may improve performance.
Caches:
LDM allocates CPU memory for the CPU Tile Cache and the secondary BufferObject cache. The CPU tile cache is normally as large as needed or other memory requirements allow. If the volume is larger than the available or allowed CPU memory, then LDM keeps the "most important" tiles in memory (importance is determined by various heuristics set in this class and in SoLDMResourceParameters
). The BufferObject cache is normally small and is used to temporarily store tiles that are created by LDM at run-time.
setMaxMainMemory()
method. If the data set is small enough to fit in system memory, then generally the memory limit should be set high enough to allow this. If the data set is larger than system memory, then the memory limit should be set as high as possible without impacting the application's other needs for memory. If the tile size is (for example) 64 and each voxel is a float value, then each tile requires approximately 1 MB of system memory. However since Open Inventor 8.5, the system memory requirement is reduced for compressed LDM tiles (stored compressed) and for uniform tiles (stored as a single value). getMaxMainMemory()
divided by the number of datasets. Each time a new data set is created the per-dataset value is recomputed and some memory is taken away from existing data sets. Note: This default allocation of memory to multiple data sets is not optimal if the data sets have significantly different sizes. For example the memory required for a height field is normally much less than for a volume. In this case the application can explicitly allocate memory to each data set using the maxMainMemory field of the SoLDMResourceParameters
object associated with the data set (see the SoDataSet.ldmResourceParameters
field).
setMaxTexMemory()
method. This value can also be set separately for each data set using SoLDMResourceParameters
.
Warning Some systems combine GPU memory and CPU memory. If 4GB are allocated on CPU and 4GB on GPU, the system may see a total amount of 8GB of private memory used by the process, which can lead to out of memory errors or swapping issues. When dealing with such issues, it is best to ensure that the total amount of memory allocated on both CPU and GPU by the program is lower than the available CPU memory.
setTileCacheType()
). SoPreferences
variable OIV_BUFFER_OBJECT_CACHE_SIZE. The size is set in number of tiles (not amount of memory) so the actual size of this cache depends on both the tile size and the data type size, i.e. it is larger for floating point data than for byte data. The default size is 50 tiles. The BufferObject cache size can only be set globally, not for each data set. The BufferObject cache was added in Open Inventor version 8.5.
See also:
Modifier and Type | Class and Description |
---|---|
static interface |
SoLDMGlobalResourceParameters.LoadListener
Loading callback for LDM mode.
|
static class |
SoLDMGlobalResourceParameters.TileCacheTypes
Deprecated.
|
static class |
SoLDMGlobalResourceParameters.VisualFeedbackParams
Visual feedback modes.
|
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
static int |
ALL
Deprecated.
Use
SoLDMGlobalResourceParameters.TileCacheTypes.ALL instead. |
static int |
DRAW_SLICES_TEX
Deprecated.
|
static int |
DRAW_TILE_OUTLINE
Deprecated.
|
static int |
DRAW_TILES
Deprecated.
|
static int |
DRAW_TOPOLOGY
Deprecated.
|
static int |
FULLRES_ONLY
Deprecated.
|
static int |
LOWRES_ONLY
Deprecated.
|
static int |
NONE
Deprecated.
Use
SoLDMGlobalResourceParameters.TileCacheTypes.NONE instead. |
static int |
SHOW_LOAD_UNLOAD_TILES
Deprecated.
|
static int |
SHOW_TILES_VALUATED
Deprecated.
|
static int |
USE_FAKE_DATA
Deprecated.
|
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and Description |
---|---|
static void |
addLoadListener(SoLDMGlobalResourceParameters.LoadListener listener)
Sets a callback to be called with the loading state.
|
static long |
getDefaultMaxMainMem()
Returns the default maximum system (CPU) memory in MB.
|
static long |
getDefaultMaxTex2D()
Deprecated.
As of Open Inventor 9500 See documentation for more details
|
static long |
getDefaultMaxTexMem()
Returns the default maximum GPU memory in MB.
|
static boolean |
getIgnoreFullyTransparentTiles()
Returns the IgnoreFullyTransparentTiles flag.
|
static int |
getLoadNotificationRate()
Returns the load notification rate.
|
static long |
getMax2DTexMemory()
Get the maximum number of 2D textures allowed to be loaded.
|
static int |
getMax2DTextures()
Deprecated.
As of Open Inventor 9500 See documentation for more details
|
static int |
getMaxMainMemory()
Returns the maximum main memory in MB for all the VolumeViz data sets.
|
static int |
getMaxNumTriangles()
Deprecated.
As of Open Inventor 9700 See documentation for more details
|
static int |
getMaxTexMemory()
Returns the maximum texture memory in MB for all the VolumeViz data sets.
|
static boolean |
getMoveLowResolution()
Deprecated.
As of Open Inventor 9610 See documentation for more details
|
static int |
getNumIO()
Returns the current number of loading threads.
|
static boolean |
getScreenResolutionCulling()
Returns the screen resolution culling state.
|
static boolean |
getSliceEqualResolution()
Returns the slice equal resolution flag.
|
static int |
getTex2LoadRate()
Returns the maximum number of 2D textures allowed to be loaded into texture memory per frame for all the VolumeViz data sets.
|
static int |
getTex3LoadRate()
Returns the maximum number of tiles (3D textures) allowed to be downloaded into texture (GPU) memory per frame for all the VolumeViz data sets.
|
static SoLDMGlobalResourceParameters.TileCacheTypes |
getTileCacheType()
Deprecated.
As of Open Inventor 9630 See documentation for more details
|
static boolean |
getViewCulling()
Returns the view culling flag.
|
static boolean |
getViewpointRefinement()
Returns the viewpoint refinement flag.
|
static boolean |
getVisualFeedbackParam(SoLDMGlobalResourceParameters.VisualFeedbackParams param)
Returns the state of the specified visual feedback parameter.
|
static void |
removeLoadListener(SoLDMGlobalResourceParameters.LoadListener listener) |
static void |
setIgnoreFullyTransparentTiles(boolean state)
Sets the IgnoreFullyTransparentTiles flag.
|
static void |
setLoadNotificationRate(int name_17513)
Sets the load notification rate (number of tiles).
|
static void |
setMax2DTexMemory(long maxMemory)
Sets the maximum 2D texture GPU memory in MB allowed to be loaded for all VolumeViz data sets.
|
static void |
setMax2DTextures(int numTextures)
Deprecated.
As of Open Inventor 9500 See documentation for more details
|
static void |
setMaxMainMemory(int maxMainMemory)
Sets the maximum main (CPU) memory, in MB, to use for all VolumeViz data sets.
|
static void |
setMaxNumTriangles(int maxNumTriangles)
Deprecated.
As of Open Inventor 9700 See documentation for more details
|
static void |
setMaxTexMemory(int maxTexMemory)
Sets the maximum texture (GPU) memory, in MB, for all VolumeViz data sets.
|
static void |
setMoveLowResolution(boolean state)
Deprecated.
As of Open Inventor 9610 See documentation for more details
|
static void |
setNumIO(int numIO)
Sets how many simultaneous tile loading threads to use if multi I/O mode is on (it is on when LDM mode is on).
|
static void |
setScreenResolutionCulling(boolean flag)
Sets the screen resolution culling flag.
|
static void |
setSliceEqualResolution(boolean state)
Calls setSliceEqualResolution(state, true).
|
static void |
setSliceEqualResolution(boolean state,
boolean forceRedraw)
Sets the slice equal resolution flag.
|
static void |
setTex2LoadRate(int loadRate)
Sets the maximum number of 2D textures allowed to be downloaded into texture (GPU) memory per frame (render traversal) for all the VolumeViz data sets.
|
static void |
setTex3LoadRate(int loadRate)
Sets the maximum number of 3D textures allowed to be downloaded into texture (GPU) memory, per frame (render traversal), for all VolumeViz data sets.
|
static void |
setTileCacheType(SoLDMGlobalResourceParameters.TileCacheTypes cacheType)
Deprecated.
As of Open Inventor 9630 See documentation for more details
|
static void |
setViewCulling(boolean state)
Calls setViewCulling(state, true).
|
static void |
setViewCulling(boolean state,
boolean forceRedraw)
Sets the view culling flag.
|
static void |
setViewpointRefinement(boolean state)
Sets the viewpoint refinement flag.
|
static void |
setVisualFeedbackParam(SoLDMGlobalResourceParameters.VisualFeedbackParams param,
boolean state)
Sets the specified visual feedback parameter to true or false.
|
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public static final int DRAW_TILES
SoLDMGlobalResourceParameters.VisualFeedbackParams.DRAW_TILES
instead.@Deprecated public static final int DRAW_SLICES_TEX
SoLDMGlobalResourceParameters.VisualFeedbackParams.DRAW_SLICES_TEX
instead.@Deprecated public static final int DRAW_TOPOLOGY
SoLDMGlobalResourceParameters.VisualFeedbackParams.DRAW_TOPOLOGY
instead.@Deprecated public static final int DRAW_TILE_OUTLINE
SoLDMGlobalResourceParameters.VisualFeedbackParams.DRAW_TILE_OUTLINE
instead.@Deprecated public static final int SHOW_TILES_VALUATED
SoLDMGlobalResourceParameters.VisualFeedbackParams.SHOW_TILES_VALUATED
instead.@Deprecated public static final int SHOW_LOAD_UNLOAD_TILES
SoLDMGlobalResourceParameters.VisualFeedbackParams.SHOW_LOAD_UNLOAD_TILES
instead.@Deprecated public static final int USE_FAKE_DATA
SoLDMGlobalResourceParameters.VisualFeedbackParams.USE_FAKE_DATA
instead.@Deprecated public static final int NONE
SoLDMGlobalResourceParameters.TileCacheTypes.NONE
instead.@Deprecated public static final int FULLRES_ONLY
SoLDMGlobalResourceParameters.TileCacheTypes.FULLRES_ONLY
instead.@Deprecated public static final int ALL
SoLDMGlobalResourceParameters.TileCacheTypes.ALL
instead.@Deprecated public static final int LOWRES_ONLY
SoLDMGlobalResourceParameters.TileCacheTypes.LOWRES_ONLY
instead.public static void addLoadListener(SoLDMGlobalResourceParameters.LoadListener listener)
public static void removeLoadListener(SoLDMGlobalResourceParameters.LoadListener listener)
public static void setViewCulling(boolean state)
public static void setSliceEqualResolution(boolean state)
@Deprecated public static void setMax2DTextures(int numTextures)
SoLDMResourceParameters.max2DTextures
field) must be less than or equal to this value. The total amount of GPU memory allowed is set using the setMaxTexMemory
method. This method limits the amount of GPU memory that can be used by (for example) SoOrthoSlice
and SoVolumeSkin
nodes. This can be useful when combining slices and volume rendering because the 3D textures used by volume rendering require much more GPU memory. Default (since Open Inventor 8.1) is 5% of total GPU memory Deprecated. Use setMax2DTexMemory instead.Deprecated since Open Inventor 9500 public static void setTex3LoadRate(int loadRate)
Each tile needed for volume rendering (SoVolumeRender
) and volume geometry must be transfered to GPU memory as a 3D texture. So, for example, transfering 1000 tiles at the default loadRate (10) requires 100 frames. (How many seconds this takes depends on the frames per second possible, which in turn depends on many factors including the complexity of the scene graph.) Increasing the loadRate value reduces the number of frames required to reach maximum resolution. But the render traversal has to wait for the data transfer to finish, so each frame may take longer to render, increasing the total time to reach maximum resolution.
@Deprecated public static int getMax2DTextures()
public static int getMaxTexMemory()
setMaxTexMemory
.public static void setMax2DTexMemory(long maxMemory)
SoLDMResourceParameters.max2DTextures
field) must be less than or equal to this value. The total amount of GPU memory allowed is set using the setMaxTexMemory
method. This method limits the amount of GPU memory that can be used by (for example) SoOrthoSlice
and SoVolumeSkin
nodes. This can be useful when combining slices and volume rendering because the 3D textures used by volume rendering require much more GPU memory. Default is 5% of GPU memory available at application startup.public static void setTex2LoadRate(int loadRate)
Each tile needed to render a slice (SoOrthoSlice
, SoVolumeSkin
, etc) must be loaded into GPU memory as a 2D texture. Increasing the loadRate value reduces the number of frames required to reach maximum resolution. But the render traversal has to wait for the data transfer to finish, so each frame may take longer to render, increasing the total time to reach maximum resolution.
public static long getMax2DTexMemory()
setMax2DTexMemory
.public static int getTex3LoadRate()
setTex3LoadRate()
.@Deprecated public static boolean getMoveLowResolution()
setMoveLowResolution()
.Deprecated since Open Inventor 9610 SoLDMResourceParameters
' LoadPolicy field instead. public static void setMaxMainMemory(int maxMainMemory)
SoLDMResourceParameters
object (see SoDataSet.ldmResourceParameters
). The sum of all per data set values must be less than or equal to the value set here.
Default (since Open Inventor 8.1) is 50% of total CPU memory up to 70% of free memory. See SoCpuDevice
to query available CPU memory.
@Deprecated public static void setMaxNumTriangles(int maxNumTriangles)
Note: Starting with Open Inventor version 9.4, the default height field rendering algorithm (SoHeightFieldRender
) does not use this parameter. The number of triangles rendered is controlled by the current complexity setting (SoComplexity
).
The sum of the max triangles values per data set (see SoLDMResourceParameters.maxNumTriangles
field) must be less or equal to this value. This is an approximate value because some nodes using this parameter draw indivisible chunks of triangles. Particularly useful for limiting the number of triangles generated by SoHeightFieldRender.Deprecated since Open Inventor 9700
maxNumTriangles is no longer used by SoHeightFieldRender
. Number of triangles is controlled by the node SoComplexity
.
@Deprecated public static int getMaxNumTriangles()
SoHeightFieldRender
. Number of triangles is controlled by the node SoComplexity
. @Deprecated public static long getDefaultMaxTex2D()
public static void setMaxTexMemory(int maxTexMemory)
SoLDMResourceParameters
object (see SoDataSet.ldmResourceParameters
). The sum of all per data set values must be less than or equal to the value set here.
Default is 75% of GPU memory available at application startup. See SoGLDevice
to query available GPU memory.
@Deprecated public static void setMoveLowResolution(boolean state)
SoLDMResourceParameters
' LoadPolicy field instead. public static int getMaxMainMemory()
setMaxMainMemory
.public static void setViewpointRefinement(boolean state)
public static void setViewCulling(boolean state, boolean forceRedraw)
@Deprecated public static SoLDMGlobalResourceParameters.TileCacheTypes getTileCacheType()
setTileCacheType()
.Deprecated since Open Inventor 9630 SoLDMResourceParameters
in OIV 10. @Deprecated public static void setTileCacheType(SoLDMGlobalResourceParameters.TileCacheTypes cacheType)
TileCacheType
enum description and the Memory Management section for more information. SoPreferences
variable LDM_USE_IN_MEM_COMPRESSION to false (zero) effectively sets the tile cache type to mode ALL.
Added in Open Inventor 8.5.Deprecated since Open Inventor 9630
Moved to SoLDMResourceParameters
in OIV 10.
public static boolean getViewpointRefinement()
setViewpointRefinement()
.public static void setScreenResolutionCulling(boolean flag)
SoLDMResourceParameters.fixedResolution
field to force use of lower resolution tiles.public static boolean getScreenResolutionCulling()
setScreenResolutionCulling()
.public static void setIgnoreFullyTransparentTiles(boolean state)
public static boolean getIgnoreFullyTransparentTiles()
setIgnoreFullyTransparentTiles()
.public static boolean getViewCulling()
setViewCulling()
.public static void setSliceEqualResolution(boolean state, boolean forceRedraw)
SoOrthoSlice
and SoObliqueSlice
, are always rendered using a set of tiles at the same resolution level. This avoids potentially distracting visual effects caused by mixing tiles of different resolution on the same slice. But it means that the slice will be rendered at a lower resolution if it is not possible to load every tile needed for the higher resolution. When false and viewpoint refinement is enabled, higher resolution tiles will be loaded for portions of the slice closer to the camera even if it is not possible to load every high resolution tile.
An alternative strategy is to enable the SoSlice.largeSliceSupport
field. When large slice support is enabled, if all the required full resolution tiles have already been loaded, then the slice data is taken from LDM cache memory as usual. But if some required tiles are not currently in memory, the full resolution slice data will be loaded directly from the volume reader without loading the complete tiles. This reduces disk I/O and reduces the amount of system memory required to display the slice at full resolution, so larger (or more) slices can be displayed.
public static void setNumIO(int numIO)
The IVVR_MAX_NUM_LOADERS preference lets you set a maximum number of tile loading threads. If this method is called with a larger number, the number of loading threads will be set to the maximum instead. If this preference is not set, the maximum is 20.
public static int getLoadNotificationRate()
setLoadNotificationRate()
.public static long getDefaultMaxTexMem()
public static long getDefaultMaxMainMem()
public static int getTex2LoadRate()
setTex2LoadRate()
.public static boolean getSliceEqualResolution()
setSliceEqualResolution()
.public static boolean getVisualFeedbackParam(SoLDMGlobalResourceParameters.VisualFeedbackParams param)
public static void setVisualFeedbackParam(SoLDMGlobalResourceParameters.VisualFeedbackParams param, boolean state)
public static int getNumIO()
setNumIO()
.public static void setLoadNotificationRate(int name_17513)
Generated on August 20, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com