Options
Menu

Class PassBase

PassBase provides an abstract base class for material shader passes. A material pass constitutes at least a render call per required renderable.

Hierarchy

  • EventDispatcher

Implements

Index

Constructors

constructor

  • Creates a new PassBase object.

    Parameters

    Returns PassBase

Properties

_elementsClass

_elementsClass: IElementsClassGL

_material

_material: GL_MaterialBase

_shader

_shader: ShaderBase

_stage

_stage: Stage

Accessors

animationSet

forceSeparateMVP

  • get (): boolean
  • set (value: boolean): void
  • Indicates whether the screen projection should be calculated by forcing a separate scene matrix and view-projection matrix. This is used to prevent rounding errors when using multiple passes with different projection code.

    Returns boolean

  • Indicates whether the screen projection should be calculated by forcing a separate scene matrix and view-projection matrix. This is used to prevent rounding errors when using multiple passes with different projection code.

    Parameters

    • value: boolean

    Returns void

images

  • Returns Array<GL_ImageBase>

preserveAlpha

  • get (): boolean
  • set (value: boolean): void
  • Indicates whether the output alpha value should remain unchanged compared to the material's original alpha.

    Returns boolean

  • Indicates whether the output alpha value should remain unchanged compared to the material's original alpha.

    Parameters

    • value: boolean

    Returns void

samplers

  • Returns Array<GL_SamplerBase>

shader

  • Returns ShaderBase

style

  • get (): Style
  • Returns Style

Methods

Private _activate

  • _activate(projection: ProjectionBase): void
  • Sets the render state for the pass that is independent of the rendered object. This needs to be called before calling pass. Before activating a pass, the previously used pass needs to be deactivated.

    Parameters

    • projection: ProjectionBase

    Returns void

Private _deactivate

  • _deactivate(): void
  • Clears the render state for the pass. This needs to be called before activating another pass.

    Returns void

_getFragmentCode

_getNormalFragmentCode

_getNormalVertexCode

_getPostAnimationFragmentCode

_getVertexCode

_includeDependencies

_initConstantData

_setRenderState

  • Renders the current pass. Before calling pass, activatePass needs to be called with the same index.

    internal

    Parameters

    • renderable: GL_RenderableBase

      The IRenderable object to draw.

    • projection: ProjectionBase

    Returns void

addEventListener

  • addEventListener(type: string, listener: function): void
  • Add an event listener

    method

    addEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

dispatchEvent

  • dispatchEvent(event: EventBase): void
  • Dispatch an event

    method

    dispatchEvent

    Parameters

    • event: EventBase

    Returns void

dispose

  • dispose(): void
  • Cleans up any resources used by the current object.

    Returns void

getImageIndex

  • getImageIndex(texture: TextureBase, index?: number): number
  • Parameters

    • texture: TextureBase
    • Default value index: number = 0

    Returns number

hasEventListener

  • hasEventListener(type: string, listener?: function): boolean
  • check if an object has an event listener assigned to it

    method

    hasListener

    Parameters

    • type: string
    • Optional listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns boolean

invalidate

  • invalidate(): void
  • Marks the shader program as invalid, so it will be recompiled before the next render.

    Returns void

removeEventListener

  • removeEventListener(type: string, listener: function): void
  • Remove an event listener

    method

    removeEventListener

    Parameters

    • type: string
    • listener: function
        • (event: EventBase): void
        • Parameters

          • event: EventBase

          Returns void

    Returns void

Generated using TypeDoc