Last updated

API / geotoolkit3d / scene / volumetric / SinglePassRenderingVolume / SinglePassRenderingVolume

Namespace: SinglePassRenderingVolume

volumetric.SinglePassRenderingVolume.SinglePassRenderingVolume

Table of contents

Type Aliases

Contents

Type Aliases

Data3D

Ƭ Data3D: RawVolumeData | PointSet

Define the data format for 3D volume, either a raw volume data (user specify individual sample of the 3D volume), or a weighted pointset which will be interpolated into a voxel grid internally.


Data4D

Ƭ Data4D: Object

The format for defining a 4D volume, where each sample is defined by the user (as opposed to the PointSet data).
The 4D volume is represented by an array of 3D volumes, in which the array index represent the 4th dimension. Each individual 3D volume data is then represented by a single-dimension typed array.

Type declaration

NameTypeDescription
indexnumberThe index of 4th dimension of the 4D volume.
rawdataDataTypedArrayA typed 1D array that contains the volume 3D voxel data at the specific index on the 4th dimension.

Data4DOptionsOut

Ƭ Data4DOptionsOut: Object

The output option of 4D volume data.

Type declaration

NameTypeDescription
rawdataarrayDataTypedArray[]An array of typed 1D array that contains the volume 3D voxel data in different timestamps.

DataOptions

Ƭ DataOptions: Data3D & { type: Volume3D } | Data4D & { type: Volume4D }

The accepted options for the .setData method.
Please note that the accepted options differ based on the 3D or 4D dimensionality of the volume defined by the user.


DataOptionsOut

Ƭ DataOptionsOut: Data3D & DataSize3D & { type: Volume3D } | Data4DOptionsOut & DataSize4D & { type: Volume4D }

The data returned by the getData method.
Please note that the returned format differ based on the 3D or 4D dimensionality of the volume defined by the user.


DataSize3D

Ƭ DataSize3D: { datadimensions: Vector3 } & DataSizeCommon

Data descriptor if the volume is 3D.


DataSize4D

Ƭ DataSize4D: { datadimensions: Vector4 } & DataSizeCommon

Data descriptor if the volume is 4D.
The 4th dimension can represent the 'time' axis, and is achieved by storing an array of 3D Volumes instead of a single 3D Volume.
The volume to visualize can then be selected by setting the 4D index via .set4DVolumeIndex(), and can accept non-integer values in order to interpolate between two volume indices.


DataSizeCommon

Ƭ DataSizeCommon: Object

The common options for data descriptor.

Type declaration

NameTypeDescription
datamax?numberThe original minimum value of the data in float.
When using Uint8Array data arrays, specify the maximum value of the data.
Uint arrays encode values as [0, 1] normalized floats then apply the datamin / datamax range to each value.
datamin?numberThe original minimum value of the data in float.
When using Uint8Array data arrays, specify the minimum value of the data.
Uint arrays encode values as [0, 1] normalized floats then apply the datamin / datamax range to each value.
dataorder?DataOrderData order and coordinate system of the provided raw data.
This class supports two data orders, ZUpZYX and YUpXYZ
Please see the enum documentation DataOrder for more details.
Default value is DataOrder.ZUpZYX

DataTypedArray

Ƭ DataTypedArray: Float32Array | Uint8Array | Uint8ClampedArray

The Typed array formats accepted by the volume class.
If desired, and to save network bandwidth, values can be passed as Uint8Array directly: the values will be interpreted as normalized float encoded to integers.
In this case, be sure to specify the data range via the datamin and datamax parameters.


InitOptions

Ƭ InitOptions: DataSize3D & { type: Volume3D } | DataSize4D & { type: Volume4D }

The Volume initialization options, they determine the volume dimensionality (3D or 4D), its data size (how many sample on each axis), and optionally the data loading order (Y-up or Z-up).


MaterialOptions

Ƭ MaterialOptions: Object

The volume options related to rendering, such as the colormap, sampling rate, raytracing modes and more.

Type declaration

NameTypeDescription
alphacorrectionfactor?numberThe corrective factor for the alpha transparency.
This alpha factor affects the opacity of each raytraced sample, higher alpha means the volume becomes more opaque.
Default value is 1.0.
clipintersection?booleanDefine clip intersection see https://threejs.org/docs/#api/en/materials/Material.clipIntersection)
clippingplanes?Plane[]Defines the clipping planes see https://threejs.org/docs/#api/en/materials/Material.clippingPlanes)
enablelighting?booleanEnable the simulation of lighting/shading of the volume rendering, by interpreting the differences in values as 3D surfaces the light can bounce off.
This can improve the sense of depth/surface in some cases.
The rendering might become slower when enabled.
raysamplingrate?numberRay sampling rate multiplier, affects how many samples per voxel are computed in each ray, default is 1.
The sampling rate can be set to anything between 0.1 and 10.0, but bear in mind a higher sampling rate will result in worse performances.
If it is set to 2, it means 2x the usual sampling (higher quality, slower)
If it is set to 0.5, it means 0.5x the usual sampling (lower quality, faster).
Higher samplings above 1x have diminishing returns, with virtually no improvement after 2x (excepted for Surface mode which is specific).
In Surface mode, when using linear/cubic interpolation, more samples increase the accuracy of the interpolation and can reduce the noise artifacts. Deprecated Deprecated since 5.0, please use options.samplingrateoptions.raysamplingrate instead.
renderingmode?RenderingModeThe mode of the volume rendering.
Default value is RenderingMode.DVR.
samplingmode?SamplingModeData texture sampling mode.
Default value is SamplingMode.Liner.
samplingrateoptions?{ enableadaptiverate?: boolean ; enablequalitypass?: boolean ; maxsamplingrate?: number ; raysamplingrate?: number }Options for the sampling rate
samplingrateoptions.enableadaptiverate?booleanEnable adaptively adjusting the rendering quality based on the hardware capabilities.
Faster GPUs will use a higher sampling rate (up to maxsamplingrate).
User can set the target GPU frame time (the time needed to render a frame) in 3D Plot option.advancedrendering.performancemetrics.targetgpuframetime.
Default is false.
samplingrateoptions.enablequalitypass?booleanEnable quality pass rendering, when enabled:
During plot's FastRendering pass the volume will use 'raysamplingrate' as sampling rate value for increased performances.
Once the plot starts Quality Rendering Pass, it will use 'maxsamplingrate' for increased quality on the still image.
plot quality pass needs to be enabled by Plot option.advancedrendering.qualityrenderpass.enable.
Default is true.
samplingrateoptions.maxsamplingrate?numberThe sampling rate on QualityRendering pass. Default is 1.0.
samplingrateoptions.raysamplingrate?numberRay sampling rate multiplier, affects how many samples per voxel are computed in each ray, default is 1.0.
The sampling rate can be set to anything between 0.1 and 10.0, but bear in mind a higher sampling rate will result in worse performances.
If it is set to 2, it means 2x the usual sampling (higher quality, slower)
If it is set to 0.5, it means 0.5x the usual sampling (lower quality, faster).
Higher samplings above 1x have diminishing returns, with virtually no improvement after 2x (excepted for Surface mode which is specific).
In Surface mode, when using linear/cubic interpolation, more samples increase the accuracy of the interpolation and can reduce the noise artifacts.
surfaceranges?Vector2[]When in Surface rendering mode, define the visible value ranges.
Up to 4 range (datamin, datamax) can be defined.
When multiple ranges are defined, the final visible range will be the Union of all ranges.
Default is one range from datamin to datamax if data has been set.
If data is empty, default value is null.
Example ts import {Vector2} from 'three'; import {RenderingMode} from '@int/geotoolkit3d/scene/volumetric/Constants'; // Change rendering to surface mode, turn on lighting, and filter values so that // only values in the union of ranges [0, 3] U [5, 7] U [9, 10] will be rendered. renderingVolume.setOptions({ renderingmode: RenderingMode.Surface, surfaceranges: [ new Vector2(0, 3), new Vector2(5, 7), new Vector2(9, 10) ] });
transferfunc?{ colormap?: string[] | Texture ; maxvalue?: number ; minvalue?: number }Transfer function option
User can use either a texture as transfer function or an array of color string
User can also specify the value range that maps to the transfer function by setting minvalue and maxvalue
Note that these values need to be in the original float type.
By default, minvalue will be 'datamin' of the data, maxvalue will be 'datamax' of the data.
transferfunc.colormap?string[] | TextureAn array of color string or a texture that represents the transfer function
transferfunc.maxvalue?numberThe max value of the data map to the transfer function.
By default, the min value of data will be used.
transferfunc.minvalue?numberThe min value of the data map to the transfer function.
By default, the min value of data will be used.
volumedimension?Vector3The volume dimensions in world space coordinates.
(Not to be confused with the data dimensions, ie: how many voxels on each axis does the data contain).
Default value is (1.0, 1.0, 1.0), and will be scaled equally proportioned to the data dimensions.

Options

Ƭ Options: Options & MaterialOptions & { data?: { datamax?: number ; datamin?: number ; dimension?: { x: number ; y: number ; z: number } ; points?: Vector4[] ; rawdata?: DataTypedArray } ; datainitialization?: InitOptions }

The options for constructor


OptionsBase

Ƭ OptionsBase: Options & MaterialOptions

The options


OptionsBaseOut

Ƭ OptionsBaseOut: Required<Options> & MaterialOptions & { datamax: number ; datamin: number }


PointSet

Ƭ PointSet: Object

The format defining a 3D volume, from an irregular set of 3D weighted points.
The volume class will then generate the voxel grid based on these points, the resolution of the voxel grid being defined by the user in the Volume dimentions initialization step (.initializeVolume method)

Type declaration

NameTypeDescription
pointsVector4[]Each point in the point set is defined by a Vector4, where the x/y/z component define the point position, and the w component define the point value. Values can then be mapped to color with a colormap for better visualization of the data.
The interpolation step used to generate the voxel grid will then use this w component and interpolate it based on distance, using the inverse distance weighting algorithm.

RawVolumeData

Ƭ RawVolumeData: Object

The format for defining a 3D volume, where each sample is defined by the user (as opposed to the PointSet data).
The volume data is passed as a single-dimension typed array.

Type declaration

NameType
rawdataDataTypedArray