Class: GPULayerCompositor
Defined in: GPULayerCompositor.ts:55
GPU-accelerated layer compositor using custom shaders Performs layer blending on the GPU for massive performance improvements
Constructors
Constructor
new GPULayerCompositor(vertexCount, maxLayers?): GPULayerCompositor;Defined in: GPULayerCompositor.ts:113
Parameters
vertexCount
number
maxLayers?
number = 8
Returns
GPULayerCompositor
Properties
SHADER_LAYER_CAPACITY
readonly static SHADER_LAYER_CAPACITY: 8 = 8;Defined in: GPULayerCompositor.ts:56
Methods
assessCapacity()
static assessCapacity(
renderer,
vertexCount,
maxLayers?
): GPUCompositorCapacity;Defined in: GPULayerCompositor.ts:77
Parameters
renderer
Pick<THREE.WebGLRenderer, "capabilities">
vertexCount
number
maxLayers?
number = 8
Returns
setMaterialResponse()
setMaterialResponse(response): void;Defined in: GPULayerCompositor.ts:414
Set how the composited surface responds to light, mirroring the MeshPhongMaterial properties of the CPU compositing path. Omitted fields are left unchanged. The diffuse color multiplies the composited layer colour, as a Phong material's colour multiplies vertex colours.
Parameters
response
Returns
void
copyMaterialResponse()
copyMaterialResponse(source): void;Defined in: GPULayerCompositor.ts:450
Copy the light response of an existing surface material (typically the CPU path's MeshPhongMaterial) so switching paths does not change the look.
Parameters
source
Material
Returns
void
updateLayers()
updateLayers(layers): void;Defined in: GPULayerCompositor.ts:466
Update layer data in GPU textures
Parameters
layers
Layer[]
Returns
void
getLastUpdateStats()
getLastUpdateStats(): GPUCompositorUpdateStats;Defined in: GPULayerCompositor.ts:664
Returns
getTextureMemoryUsage()
getTextureMemoryUsage(): object;Defined in: GPULayerCompositor.ts:668
Returns
object
layerTextureBytes
readonly layerTextureBytes: number;volumeColormapBytes
readonly volumeColormapBytes: number;totalBytes
readonly totalBytes: number;getMaterial()
getMaterial(): ShaderMaterial | null;Defined in: GPULayerCompositor.ts:697
Get the shader material for use with Three.js mesh
Returns
ShaderMaterial | null
setBaseColor()
setBaseColor(color): void;Defined in: GPULayerCompositor.ts:704
Update base color
Parameters
color
ColorRepresentation
Returns
void
clearBaseColor()
clearBaseColor(): void;Defined in: GPULayerCompositor.ts:716
Remove the optional implicit base so an empty GPU stack is transparent.
Returns
void
setClipPlanes()
setClipPlanes(clipPlanes): void;Defined in: GPULayerCompositor.ts:728
Update clip planes from a ClipPlaneSet. Clipping uses three.js's own material.clippingPlanes, exactly as the CPU material does, so both paths keep the same side of each plane and clip the deformed (morphed) surface. The renderer needs localClippingEnabled (the viewer sets it).
Parameters
clipPlanes
Returns
void
setClipPlane()
setClipPlane(axis, plane): void;Defined in: GPULayerCompositor.ts:736
Update a single clip plane
Parameters
axis
"x" | "y" | "z"
plane
Returns
void
clearClipPlanes()
clearClipPlanes(): void;Defined in: GPULayerCompositor.ts:744
Clear all clip planes (disable them)
Returns
void
dispose()
dispose(): void;Defined in: GPULayerCompositor.ts:762
Dispose of GPU resources
Returns
void