# Pipeline
Abstract class that is the base for all concrete rendering pipeline implementations.
# Constructors
| constructor |
|---|
# Properties
| drawingSize | passList | speckleRenderer |
|---|
# Accessors
| options | passes |
|---|
# Methods
| createMultipleRenderTarget | createRenderTarget | getPass | onAfterPipelineRender |
|---|---|---|---|
| onBeforePipelineRender | render | reset | resize |
| setClippingPlanes | update |
# Typedefs
| BasePipelineOptions | EdgesPipelineOptions | PipelineOptions |
|---|
# Constructors
# constructor
constructor(speckleRenderer: SpeckleRenderer, options: BasePipelineOptions)
Parameters
- speckleRenderer: The hosting renderer as SpeckleRenderer
- options: Options to init the pipeline with BasePipelineOptions
# Properties
# drawingSize
protected drawingSize: Vector2;
The final display size for the pipeline in pixels. DPR is already factored in.
Returns: Vector2 (opens new window)
# passList
protected passList: Array<GPass>;
The pipeline's ordered GPass.
Returns: Array<GPass>
# speckleRenderer
protected speckleRenderer: SpeckleRenderer;
The hosting speckle renderer instance
Returns: SpeckleRenderer
# Accessors
# options
get options(): BasePipelineOptions;
set options(value: BasePipelineOptions): void
2
Gets and sets the pipeline options
Returns: BasePipelineOptions or extending types
# passes
get passes(): Array<GPass>;
Gets the current ordered pass list
Returns: Array<GPass>
# Methods
# createMultipleRenderTarget
static createMultipleRenderTarget(
count: number,
options?: WebGLRenderTargetOptions,
width?: number,
height?: number
): WebGLMultipleRenderTargets
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
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
- 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: WebGLRenderTarget (opens new window)
# getPass
getPass(name: string): GPass[]
Get's all the passes with the provided name
Parameters
- name: string
Returns: GPass[]
# onAfterPipelineRender
onAfterPipelineRender(): void
Callback for before the pipeline starts to render
Returns: void
# onBeforePipelineRender
onBeforePipelineRender(): void
Callback for before the pipeline has finished rendering
Returns: void
# render
render(): boolean
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
Resets the pipeline
Returns: void
# resize
resize(width: number, height: number): void
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
Propagates clipping planes towards the pipeline's consituent passes
Parameters
- planes: The clipping Planes (opens new window)
Returns: void
# Typedefs
# BasePipelineOptions
interface BasePipelineOptions {}
Base pipeline options
# EdgesPipelineOptions
interface EdgesPipelineOptions extends BasePipelineOptions {
outlineThickness?: number
outlineColor?: number
outlineOpacity?: number
}
2
3
4
5
The options applicable to the EdgesPipeline
- optional outlineThickness: number The width of the outlines in pixels
- optional outlineColor: number The color of the outlines
- optional outlineOpacity: number The opacity of the outlines
# PipelineOptions
interface PipelineOptions extends BasePipelineOptions {
edges?: boolean
}
2
3
The options applicable to any pipeline
- optional edges: boolean If edges should be overlayed
WARNING
Setting this options will automatically apply edges/outlines to the stock pipelines. Setting this options will not automatically apply edges/outlines to custom pipelines! You will need to integrate the existing EdgesPipeline as a subpipeline in your custom pipeline