# Pipeline

Abstract class that is the base for all concrete rendering pipeline implementations.

#

Constructors

constructor

#

Properties

drawingSize passList speckleRenderer

#

Accessors

passes

#

Methods

createMultipleRenderTarget createRenderTarget getPass onAfterPipelineRender
onBeforePipelineRender render reset resize
setClippingPlanes update

#

Constructors

#

constructor

constructor(speckleRenderer: SpeckleRenderer)
1

Parameters

#

Properties

# drawingSize

protected drawingSize: Vector2;
1

The final display size for the pipeline in pixels. DPR is already factored in.

Returns: Vector2 (opens new window)

# passList

protected passList: Array<GPass>;
1

The pipeline's ordered GPass.

Returns: Array<GPass>

# speckleRenderer

protected speckleRenderer: SpeckleRenderer;
1

The hosting speckle renderer instance

Returns: SpeckleRenderer

#

Accessors

# passes

get passes(): Array<GPass>;
1

Gets the current ordered pass list

Returns: Array<GPass>

#

Methods

# createMultipleRenderTarget

static createMultipleRenderTarget(
    count: number,
    options?: WebGLRenderTargetOptions,
    width?: number,
    height?: number
  ): WebGLMultipleRenderTargets
1
2
3
4
5
6

Creates an MRT enabled three.js render target.

WARNING

The resulting render target will be using a 32 bit depth + stencil renderbuffer.

WARNING

Because the Speckle viewer is still using an older version of three.js the type WebGLMultipleRenderTargets does not exist anymore in their documentation. However it works similarly to the regular WebGLRenderTarget

Parameters

  • count: The number of color attachements to the framebuffer
  • optional options: WebGLRenderTargetOptions (opens new window)
  • optional width: number If none specified it will default to 1
  • optional height: number If none specified it will default to 1

Returns: WebGLMultipleRenderTargets (opens new window)

# createRenderTarget

static createRenderTarget(
    options?: WebGLRenderTargetOptions,
    width?: number,
    height?: number
  ): WebGLRenderTarget
1
2
3
4
5

Creates a three.js render target.

WARNING

The resulting render target will be using a 32 bit depth + stencil renderbuffer.

Parameters

Returns: WebGLRenderTarget (opens new window)

# getPass

getPass(name: string): GPass[]
1

Get's all the passes with the provided name

Parameters

  • name: string

Returns: GPass[]

# onAfterPipelineRender

onAfterPipelineRender(): void 
1

Callback for before the pipeline starts to render

Returns: void

# onBeforePipelineRender

onBeforePipelineRender(): void
1

Callback for before the pipeline has finished rendering

Returns: void

# render

render(): boolean
1

The pipeline's render loop. The Pipeline class offers a complete implementation for the render loop that feeds the required data into the passes. Only very specialized pipelines would require the render function overriden

Returns: boolean A true value indicates that the pipeline needs further rendering. false otherwise

# reset

reset(): void
1

Resets the pipeline

Returns: void

# resize

resize(width: number, height: number): void
1

Resizes the pipeline with the provided dimensions. The width and height are expected to be final values, as in, they should contained any DPR already factored in

Parameters

  • width: number
  • height: number

Returns: void

# setClippingPlanes

setClippingPlanes(planes: Plane[]): void
1

Propagates clipping planes towards the pipeline's consituent passes

Parameters

Returns: void