Skip to content

Class: VolumeLayer ​

Defined in: plot3d/volume.ts:92

Direct volume rendering: GPU raymarching through a 3D texture with front-to-back alpha compositing and a colormap transfer function. Draws the volume's bounding box (back faces) and integrates each ray across the box interior.

Implements ​

Constructors ​

Constructor ​

ts
new VolumeLayer(gl, opts): VolumeLayer;

Defined in: plot3d/volume.ts:112

Parameters ​

ParameterType
glWebGL2RenderingContext
optsVolumeOptions

Returns ​

VolumeLayer

Properties ​

id ​

ts
readonly id: string;

Defined in: plot3d/volume.ts:93

Implementation of ​

Layer3D.id


name? ​

ts
readonly optional name?: string;

Defined in: plot3d/volume.ts:94

Series name for the legend (optional).

Implementation of ​

Layer3D.name

Methods ​

bounds3() ​

ts
bounds3(): Bounds3;

Defined in: plot3d/volume.ts:205

Returns ​

Bounds3

Implementation of ​

Layer3D.bounds3


colorInfo() ​

ts
colorInfo(): ColorInfo;

Defined in: plot3d/volume.ts:207

Colormap + value range for a colorbar, if this layer is colormapped.

Returns ​

ColorInfo

Implementation of ​

Layer3D.colorInfo


dispose() ​

ts
dispose(): void;

Defined in: plot3d/volume.ts:247

Returns ​

void

Implementation of ​

Layer3D.dispose


draw() ​

ts
draw(gl, mvp): void;

Defined in: plot3d/volume.ts:219

Parameters ​

ParameterType
glWebGL2RenderingContext
mvpMat4

Returns ​

void

Implementation of ​

Layer3D.draw


setCamera() ​

ts
setCamera(worldEye): void;

Defined in: plot3d/volume.ts:210

Set the camera position in world space; converted to the volume's [0,1] local space.

Parameters ​

ParameterType
worldEye[number, number, number]

Returns ​

void


setData() ​

ts
setData(values): void;

Defined in: plot3d/volume.ts:201

Stream a new scalar volume (same dims); re-uploads the 3D texture. Call plot.refresh() after.

Parameters ​

ParameterType
valuesArrayLike<number>

Returns ​

void

MIT licensed. WebGL2 required.