ForwardRenderer

Renders the scene using the forward rendering method.

Constructor

new L3D.ForwardRenderer()

Methods

clearBuffer(camera, renderSettings)

Clear the color and depth buffers based on the camera and render stettings

Parameters
camera Camera
renderSettings RenderSettings

disableFrameShaderBlock(shaderBlockName)

Disable a ShaderBlock.

Parameters
shaderBlockName String

enableCamera(camera, renderSettings, skipViewport)

Sets the camera as the current camera, setting the viewport according to the camera info, updating matrices, etc.

Parameters
camera Camera
renderSettings RenderSettings
skipViewport bool

enableFrameShaderBlock(shaderBlockName, uniforms, textures)

Enable a ShaderBlock only during this frame.

Parameters
shaderBlockName String
uniforms Object
textures Array

getNearLights(instance, result)

Returns a list of all the lights overlapping this instance (it uses sperical bounding so it could returns lights that are not really overlapping)

Parameters
instance *
result *

processVisibleData(scene, renderSettings, cameras, lights, instances, skipCollectData)

Collect and process the rendering instances, cameras, and lights that are visible. Called once per frame before iterating cameras. Rendering order is computed here.

Parameters
scene Scene
renderSettings RenderSettings
cameras Array
lights Array
instances Array
skipCollectData bool

render(scene, renderSettings)

Render the scene.

Parameters
scene Scene
renderSettings RenderSettings

renderCamera(camera, renderSettings, scene)

Renders the scene from the given camera, using the given render settings.

Parameters
camera *
renderSettings *
scene *

renderFrameCameras(scene, cameras, renderSettings)

Renders the scene from one or more cameras.

Parameters
scene Scene
cameras Array
renderSettings RenderSettings

renderInstances(renderSettings, instances, scene)

Calls the render method for every RenderInstance, taking into account events and frustum culling.

Parameters
renderSettings RenderSettings
instances Array
scene Scene

resetGLState()

Restore the GL state to the default RenderState.

setFullViewport(x, y, w, h)

Set the current full viewport, which could be different from the canvas when rendering to an FBO or the camera has a partial viewport.

Parameters
x *
y *
w *
h *

updateRenderQueues(camera, instances)

Clears the render queues and adds objects according to their settings.

Parameters
camera *
instances *