Class: Effect

Effect

Effect is a Component that will be picked up by the renderer for post-processing. Most effects are added to the Camera, but some could be tied to a different Entity (for example: a DirectionalLight for crepuscular rays)


new Effect()

Properties:
Name Type Description
needsNormalDepth boolean

Defines whether this Effect needs normal/depth information from the renderer.

hdrTarget FrameBuffer

The current full-resolution render target.

hdrSource Texture2D

The current full-resolution source texture.

Author:
  • derschmale <http://www.derschmale.com>

Extends

Members


entity

The target entity.

Inherited From:

onUpdate

If provided, this method will be called every frame, allowing updating the entity.

Inherited From:

Methods


_swapHDRFrontAndBack()

Child classes need to call this when rendering to and from full-resolution textures. This will effectively swap hdrSource and hdrTarget to allow ping-ponging.


draw()

This method needs to be implemented by child classes.


isSupported()

Returns whether this Effect is supported considering the current capabilities.