# 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)
Parameters
- speckleRenderer: The hosting renderer as SpeckleRenderer
# 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
# 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