LogoPixi’VN
pixi-jsClasses

Class: CustomRenderPipe

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:20

Internal

The CustomRenderPipe is a render pipe that allows for custom rendering logic for your renderable objects.

Example

import { RenderContainer } from 'pixi.js';

const renderContainer = new RenderContainer(
(renderer) =>  {
    renderer.clear({
      clearColor: 'green', // clear the screen to green when rendering this item
    });
})

Implements

Constructors

Constructor

> new CustomRenderPipe(renderer): CustomRenderPipe

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:26

Parameters

renderer

Renderer

Returns

CustomRenderPipe

Properties

extension

> static extension: object

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:21

name

> readonly name: "customRender"

type

> readonly type: readonly [WebGLPipes, WebGPUPipes, CanvasPipes]

Methods

addRenderable()

> addRenderable(container, instructionSet): void

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:30

This is where the renderable is added to the instruction set. This is called once per renderable. For instance, a MeshRenderPipe could be used to enqueue a 'draw mesh' command to the rendering instruction set, catering to the rendering of mesh geometry. In more complex scenarios, such as the SpritePipe, this seamlessly coordinates with a batchPipe to efficiently batch and add batch instructions to the instructions set

Add is called when the instructions set is being built.

Parameters

container

RenderContainer

instructionSet

InstructionSet

the instruction set currently being built

Returns

void

Implementation of

RenderPipe.addRenderable


destroy()

> destroy(): void

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:32

Returns

void


destroyRenderable()

> destroyRenderable(): void

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:28

Called whenever a renderable is destroyed, often the pipes keep a webGL / webGPU specific representation of the renderable that needs to be tidied up when the renderable is destroyed.

Returns

void

Implementation of

RenderPipe.destroyRenderable


execute()

> execute(container): void

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:31

this is where the actual instruction is executed - eg make the draw call activate a filter. Any instructions that have the same renderPipeId have their execute method called

Parameters

container

RenderContainer

Returns

void

Implementation of

InstructionPipe.execute


updateRenderable()

> updateRenderable(): void

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:27

Called whenever a renderable has been been updated, eg its position has changed. This is only called in the render loop if the instructions set is being reused from the last frame. Otherwise addRenderable is called.

Returns

void

Implementation of

RenderPipe.updateRenderable


validateRenderable()

> validateRenderable(): boolean

Defined in: node_modules/pixi.js/lib/scene/container/CustomRenderPipe.d.ts:29

This function is called when the renderer is determining if it can use the same instruction set again to improve performance. If this function returns true, the renderer will rebuild the whole instruction set for the scene. This is only called if the scene has not its changed its structure .

Returns

boolean

Implementation of

RenderPipe.validateRenderable