Class: Renderer

Renderer

Renderer performs the actual rendering of a Scene as viewed by a Camera to the screen.


new Renderer()

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

Members


<static> DebugMode

A collection of debug render modes to inspect some steps in the render pipeline.

Properties:
Name Type Default Description
NONE 0
SSAO 1
NORMAL_DEPTH 2
SHADOW_MAP 3

backgroundColor

The background Color.


camera

The Camera currently being used for rendering.


debugMode

One of {Renderer.DebugMode}


depthPrepass

Defines whether or not a depth pre-pass needs to be performed when rendering. This may improve rendering by spending less time calculating lighting on invisible fragments.


shadowMapSize

The size of the shadow atlas texture.

Methods


render(camera, scene, dt [, renderTarget])

Renders the scene through a camera. It's not recommended changing render targets if they have different sizes (so splitscreen should be fine). Otherwise, use different renderer instances.

Parameters:
Name Type Argument Description
camera

The Camera from which to view the scene.

scene

The Scene to render.

dt

The milliseconds passed since last frame.

renderTarget <optional>

An optional FrameBuffer object to render to.