Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ForwardSceneRenderPass

This class renders a SceneNode hierarchy. It uses one single program for rendering the whole scene. If different programs are necessary to render a scene, multiple SceneNodes should be used for each program that is used. This renderpass calls callbacks such as updateModelTransform, which have to be set by the renderer using this renderpass.

Hierarchy

Index

Constructors

constructor

Properties

Protected Readonly _altered

_altered: ChangeLookup & { any: false; camera: false } = Object.assign(new ChangeLookup(), {any: false,camera: false,})

Alterable auxiliary object for tracking changes on render pass inputs and lazy updates.

Protected _camera

_camera: Camera
see

camera

Protected _clearColor

_clearColor: GLclampf4

Protected _context

_context: Context

Context, used to get context information and WebGL API access.

Protected _ndcOffset

_ndcOffset: GLfloat2
see

ndcOffset

Protected _opaqueGeometryMap

_opaqueGeometryMap: Map<Material, Array<[Geometry, mat4]>>

These maps are used to map from a material to all geometries using this material. Alongside the geometry a transform is saved, that is generated during a preprocessing traverse.

Protected _program

_program: Program
see

program

Protected _scene

_scene: SceneNode | undefined
see

scene

Protected _target

_target: Framebuffer
see

target

Protected _transparentGeometryMap

_transparentGeometryMap: Map<Material, Array<[Geometry, mat4]>>

bindGeometry

bindGeometry: (geometry: Geometry) => void

Type declaration

bindMaterial

bindMaterial: (material: Material) => void

Type declaration

bindUniforms

bindUniforms: () => void

Type declaration

    • (): void
    • Returns void

updateModelTransform

updateModelTransform: (matrix: mat4) => void

Type declaration

    • (matrix: mat4): void
    • Parameters

      • matrix: mat4

      Returns void

updateViewProjectionTransform

updateViewProjectionTransform: (matrix: mat4) => void

Type declaration

    • (matrix: mat4): void
    • Parameters

      • matrix: mat4

      Returns void

Accessors

camera

  • set camera(camera: Camera): void

clearColor

initialized

  • get initialized(): boolean

ndcOffset

  • The NDC offset is used for vertex displacement within subpixel space for anti-aliasing over multiple intermediate frames (multi-frame sampling).

    Parameters

    • offset: GLfloat2

      Subpixel offset used for vertex displacement (multi-frame anti-aliasing).

    Returns void

program

  • set program(program: Program): void

scene

target

Methods

Protected assertInitialized

  • assertInitialized(): void
  • Asserts the objects initialization status to be true. Note that the implementation is cached and forwarded to either an empty function when initialized and to an acutal assert(false) otherwise.

    Returns void

Protected assertUninitialized

  • assertUninitialized(): undefined
  • Asserts the objects initialization status to be false. Note that the implementation is cached and forwarded to either an empty function when uninitialized and to an acutal assert(false) otherwise.

    Returns undefined

drawCalls

  • drawCalls(renderTransparentMaterials?: boolean): void
  • Encapsulates the draw calls made to webgl. This is useful if state should not be changed before rendering, e.g. for shadow mapping.

    Parameters

    • Default value renderTransparentMaterials: boolean = true

    Returns void

frame

  • frame(): void

initialize

  • initialize(): boolean

prepare

  • prepare(): void

Protected preprocessNode

  • preprocessNode(node: SceneNode, transform: mat4): void
  • Handle a single node during preprocessing. Each GeometryComponent of the node will be added to the preprocessing maps. Afterwards all children of the node will also be processed recursively.

    Parameters

    Returns void

Protected preprocessScene

  • preprocessScene(): void

Protected renderGeometryMap

uninitialize

  • uninitialize(): void

update

  • update(override?: boolean): void

Static Protected Readonly assertInitializedFalse

Static Protected Readonly assertUninitializedFalse

Static assert_initialized

Static assert_uninitialized

Static discard

  • Method decorator for discarding of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be discarded, invokes its uninitialization, and falsifies the initialization status. In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to a static, always-failing assert and an empty/undefined function respectively.

    Returns MethodDecorator

Static initialize

  • Method decorator for initialization of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be initialized, invokes its initialization with arbitrary number of parameters, and sets the initialization status to the initialization success (either false or true). In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to either a static, always-failing assert or an empty/undefined function.

    Returns MethodDecorator

Static uninitialize

  • Method decorator for uninitialization of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be uninitialized, invokes its uninitialization, and falsifies the initialization status. In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to a static, always-failing assert and an empty/undefined function respectively.

    Returns MethodDecorator