Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TestRenderer

Hierarchy

Index

Constructors

constructor

Properties

Protected _accumulate

_accumulate: AccumulatePass

Protected Readonly _altered

_altered: ChangeLookup & { any: boolean; canvasSize: boolean; clearColor: boolean; debugTexture: boolean; framePrecision: boolean; frameSize: boolean; multiFrameNumber: boolean } = ...

Alterable auxiliary object for tracking changes on renderer input and lazy updates.

Protected _blit

_blit: BlitPass

Protected _canvasSize

_canvasSize: GLsizei2 = ...

Actual, native resolution for the canvas currently in charge of controlling the renderer. This might differ from the targeted frame resolution but is required, e.g., for specific non-proportional ratios between frame size and canvas size.

Protected _clearColor

_clearColor: GLclampf4 = ...

The clear color, provided by the canvas the renderer is bound to. This is used in frame calls of inheritors.

Protected _colorRenderTexture

_colorRenderTexture: Texture2D

Protected _context

_context: Context
see

context

Protected _debugTexture

_debugTexture: number
see

debugTexture This property can be observed, e.g., aRenderer.debugTextureObservable.subscribe().

Protected _debugTextureSubject

_debugTextureSubject: ReplaySubject<number> = ...

Protected _debugTextures

_debugTextures: string[] = ...

List of textures for debugging purposes such as normals, ids, depth, masks, etc. that can be populated by the inheritor. The index of a texture identifier can then be for specifying a debug output of a render texture.

Protected _defaultFBO

_defaultFBO: DefaultFramebuffer

Protected _depthRenderbuffer

_depthRenderbuffer: Renderbuffer

Protected _extensions

_extensions: boolean = false

Protected _framePrecision

_framePrecision: Precision = ...

Targeted frame precision, e.g., used for frame accumulation. Note that any renderer is currently expected to take advantage of progressive rendering (e.g., multi-frame sampling) and accumulation as well as a blit pass (since main intend is multi-frame based rendering).

Protected _frameSize

_frameSize: GLsizei2 = ...

Targeted resolution for image synthesis. This might differ from the canvas resolution and should be used in frame calls of inheritors.

Protected _intermediateFBO

_intermediateFBO: Framebuffer

Protected _invalidate

_invalidate: Invalidate

The renderer's invalidation callback. This should usually be setup by the canvas and refer to a function in the canvas's controller, e.g., it should trigger an update within the controller.

Protected _isLoading

_isLoading: boolean
see

isLoading

Protected _loadingStatusSubscription

_loadingStatusSubscription: ReplaySubject<LoadingStatus>

This property can be observed via aRenderer.loadingState$.observe(). It is triggered when finishLoading or startLoading is called on this renderer.

Protected _multiFrameNumber

_multiFrameNumber: number

This multi-frame number is for lazy reconfiguration and set on update. The inheritor can react to changes using this.altered.multiFrameNumber.

Protected _ndcOffsetKernel

_ndcOffsetKernel: AntiAliasingKernel

Protected _ndcTriangle

_ndcTriangle: NdcFillingTriangle

Protected _program

_program: Program

Protected _testNavigation

_testNavigation: TestNavigation

Protected _uFrameNumber

_uFrameNumber: WebGLUniformLocation

Protected _uNdcOffset

_uNdcOffset: WebGLUniformLocation

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.

Type declaration

    • (): void
    • Returns void

Protected assertUninitialized

assertUninitialized: () => void = ...

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.

Type declaration

    • (): void
    • Returns void

Accessors

Protected altered

  • get altered(): boolean
  • Whether or not any of the (relevant/monitored) rendering properties has been altered. This concept should be used by other classes (e.g., camera, rendering stages) for detecting modifications relevant for rendering output.

    Returns boolean

Protected canvasSize

clearColor

  • Sets the color used for clearing the background. This setter should only be used by the canvas this renderer is bound to. Changing the frame size invalidates the renderer.

    Parameters

    • color: GLclampf4

      Red, green, blue, and alpha color components.

    Returns void

Protected context

debugTexture

  • get debugTexture(): number
  • set debugTexture(index: number): void
  • The render texture index for debug output. This is -1 when debug output is disabled. This should be used in the renderers swap implementation.

    Returns number

  • Enables to specify the index of a render texture to be blit to the back buffer for debugging. This invalidates but should result in a blit only if nothing else changed. When the requested debug texture was blit (and debugTexture was actually altered) this.debugTextureNext() should be called to inform observers.

    Parameters

    • index: number

      Render texture index based on debuggableTextures array. This should be in [-1, length of array].

    Returns void

debugTexture$

  • get debugTexture$(): Observable<number>
  • Observable that can be used to subscribe to debug texture changes.

    Returns Observable<number>

debugTextures

  • get debugTextures(): string[]
  • Read only access to the renderers registered render textures that can be blit to the back buffer for debugging.

    Returns string[]

    • Array of render texture identifiers.

framePrecision

  • set framePrecision(precision: Precision): void

frameSize

  • Changes the frame size for rendering. This setter should only be used by the canvas this renderer is bound to. Changing the frame size invalidates the renderer.

    Note: the frame size is detached from the canvas size. When blitting the frame into the canvas, the frame is rescaled to fill or fit the canvas size.

    Parameters

    • size: GLsizei2

      Resolution of the framebuffer.

    Returns void

initialized

  • get initialized(): boolean
  • Property getter for readonly access to the initialization status of an initializable instance.

    Returns boolean

isLoading

  • get isLoading(): boolean
  • This property indicated whether a loading process is currently in progress. It can be changed by calling startLoading or finishLoading on this renderer.

    Returns boolean

loadingStatus$

  • Observable to subscribe to the current loading state of this renderer. Use aRenderer.loadingStatus$.subscribe() to register a new subscriber.

    Returns Observable<LoadingStatus>

Methods

Protected debugTextureNext

  • debugTextureNext(): void

discard

  • discard(): void
  • Should discard all assets and uninitialize all stages. super.discarded() should always be called first when overriding this function.

    Returns void

Protected finishLoading

  • finishLoading(): void
  • This method needs to be called when a loading process is finished in order to notify listeners via the observable loadingState$.

    Returns void

frame

  • frame(frameNumber: number): void
  • Controllable interface intended to trigger rendering of a full pass of the renderer that results in either an intermediate frame for accumulation to a full multi-frame or full frame for itself. The inheritor should invoke frames of relevant rendering and processing stages.

    Parameters

    • frameNumber: number

      The current frame number forwarded to onFrame.

    Returns void

frameCoords

  • frameCoords(x: number, y: number): GLfloat2
  • Transforms local viewport coordinates into local intermediate frame coordinates.

    Parameters

    • x: number

      Horizontal coordinate for the upper left corner of the viewport origin.

    • y: number

      Vertical coordinate for the upper left corner of the viewport origin.

    Returns GLfloat2

initialize

  • When extending (specializing) this class, initialize should initialize all required stages and allocate assets that are shared between multiple stages. Note that super.initialize() should always be called first when 'overriding' this function.

    Note: the context handle is stored in a property, but should be passed to the stages by specializing renderer instead. The renderer itself should not allocate rendering resources directly, thus, it should not require a webgl context.

    Parameters

    • context: Context

      Wrapped gl context for function resolution (passed to all stages).

    • callback: Invalidate

      Functions that is invoked when the renderer (or any stage) is invalidated.

    • eventProvider: EventProvider

      Provider for mouse events referring to the canvas element.

    Returns boolean

Protected invalidate

  • invalidate(force?: boolean): void

Protected onDiscarded

  • onDiscarded(): void

Protected onFrame

  • onFrame(frameNumber: number): void

Protected onInitialize

Protected onPrepare

  • onPrepare(): void

Protected onSwap

  • onSwap(): void

Protected onUninitialize

  • onUninitialize(): void

Protected onUpdate

  • onUpdate(): boolean

prepare

  • prepare(): void
  • Prepares the rendering of the next frame (or subsequent frames when multi-frame rendering). This is part of the controllable interface. The renderer should reconfigure as lazy as possible.

    Returns void

Protected startLoading

  • startLoading(): void
  • This method needs to be called by a renderer, when a loading process is started in order to notify listeners via the observable loadingState$.

    Returns void

swap

  • swap(): void

uninitialize

  • uninitialize(): void
  • Should release all assets and uninitialize all stages. super.uninitialize() should always be called first when overriding this function.

    Returns void

update

  • update(multiFrameNumber: number): boolean

Static Protected Readonly assertInitializedFalse

Static Protected Readonly assertUninitializedFalse

Static assert_initialized

  • assert_initialized(): MethodDecorator

Static assert_uninitialized

  • assert_uninitialized(): MethodDecorator

Static discard

  • discard(): MethodDecorator
  • 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

  • initialize(): MethodDecorator
  • 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

  • uninitialize(): MethodDecorator
  • 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