Class Index | File Index

Classes


Class Renderer

Represents the rendering engine in BenchGL.
Defined in: benchgl.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Renderer(program, camera, effects)
Creates a new Renderer.
Method Summary
Method Attributes Method Name and Description
 
addLight(name, options)
Adds a light.
 
addModels(arguments)
Adds models to this Renderer.
 
addTexture(name, options)
Adds a single texture.
 
addTextures(options)
Adds multiple textures.
 
background(r, g, b, a)
Clear the background.
 
Renders all the models registered to the Renderer.
 
renderModel(model)
Renders a model.
 
setAmbientColor(r, g, b, a)
Sets the world ambient color.
 
setClearColor(r, g, b, a)
Sets the clear color for the backgrond.
 
setDirectionalColor(r, g, b, a)
Sets the world directional light color.
 
Sets the world directional light vector.
 
Setups camera uniforms in the current shader program.
 
Setups special effects uniforms in the current shader program.
 
Setups lights uniforms in the current shader program.
 
Setups lights uniforms in the current shader program.
 
useAlphaBlending(blending, options)
Switches alpha-blending.
 
useLights(lighting)
Switches lighting.
 
useTextures(texturing)
Switches texturing.
Class Detail
Renderer(program, camera, effects)
Creates a new Renderer.
Parameters:
{Program} program
The current active shader program.
{Camera} camera
The camera holding the point of view over the world.
{Object} effects
Contains special effects' specifications.
Method Detail
addLight(name, options)
Adds a light.
Parameters:
{String} name
The name for the light.
{Object} options
Contains information about the light.

addModels(arguments)
Adds models to this Renderer.
Parameters:
{Object} arguments
The models to load.

addTexture(name, options)
Adds a single texture.
Parameters:
{String} name
The name for the texture.
{Object} options
Contains information about the texture.

addTextures(options)
Adds multiple textures.
Parameters:
{Object} options
Contains information about the textures to load.

background(r, g, b, a)
Clear the background.
Parameters:
r
g
b
a

renderAll()
Renders all the models registered to the Renderer.

renderModel(model)
Renders a model.
Parameters:
{Model} model
The model to render.

setAmbientColor(r, g, b, a)
Sets the world ambient color.
Parameters:
{Number} r
The red component of the color.
{Number} g
The green component of the color.
{Number} b
The blue component of the color.
{Number} a
The alpha component of the color.

setClearColor(r, g, b, a)
Sets the clear color for the backgrond.
Parameters:
{Number} r
The red component of the color.
{Number} g
The green component of the color.
{Number} b
The blue component of the color.
{Number} a
The alpha component of the color.

setDirectionalColor(r, g, b, a)
Sets the world directional light color.
Parameters:
{Number} r
The red component of the color.
{Number} g
The green component of the color.
{Number} b
The blue component of the color.
{Number} a
The alpha component of the color.

setLightingDirection(x, y, z)
Sets the world directional light vector.
Parameters:
{Number} x
The x component of the vector.
{Number} y
The y component of the vector.
{Number} z
The z component of the vector.

setupCamera()
Setups camera uniforms in the current shader program.

setupEffects()
Setups special effects uniforms in the current shader program.

setupLights()
Setups lights uniforms in the current shader program.

setupTextures()
Setups lights uniforms in the current shader program.

useAlphaBlending(blending, options)
Switches alpha-blending.
Parameters:
{Boolean} blending
True to enable blending, else otherwise.
{Object} options Optional
Contain info over about blending functions.

useLights(lighting)
Switches lighting.
Parameters:
{Boolean} lighting
True to enable lighting, else otherwise.

useTextures(texturing)
Switches texturing.
Parameters:
{Boolean} texturing
True to enable texturing, else otherwise.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu May 19 2011 00:47:49 GMT+0200 (CEST)