API Docs for: 0.5.5
Show:

kick.core.Config Class

Defined in: kick/core/Config.js:5
Module: kick.core

The global configuration of the engine. Cannot be changed during runtime.

Constructor

kick.core.Config

(
  • config
)

Parameters:

  • config Config

    defines one or more properties

Example:

 <canvas id="3dCanvas" width="50" height="50"></canvas>
 <script src="require.js"></script>
 <script type="text/javascript">
     var req = require.config({
             paths: {
                 kick: 'kick-debug' // loads kick-debug.js (must be in same path)
             }
         });
     req(['kick'],
             function (kick) {
                 var config = {
                     enableDebugContext: true,
                     shadows: true
                 };
                 var engine = new kick.core.Engine('3dCanvas', config);
                 // [...]
             }
     );
 </script>

Properties

alpha

Boolean

WebGL spec: If the value is true, the drawing buffer has a depth buffer of at least 16 bits. If the value is false, no depth buffer is available.

Default: true

alpha

Boolean

WebGL spec: If the value is true, the drawing buffer has an alpha channel for the purposes of performing OpenGL destination alpha operations and compositing with the page. If the value is false, no alpha buffer is available.

Default: true

antialias

Boolean

WebGL spec: Default: true. If the value is true and the implementation supports antialiasing the drawing buffer will perform antialiasing using its choice of technique (multisample/supersample) and quality. If the value is false or the implementation does not support antialiasing, no antialiasing is performed.

Default: true

checkCanvasResizeInterval

Number deprecated

Polling of canvas resize. Default is 0 (meaning not polling)

Default: 32

enableDebugContext

Boolean

Checks for WebGL errors after each webgl function is called. Should only be used for debugging. Default value is false.

Default: false

highDPISupport

Boolean

Adds support for highDPI (such as MacBook Pro retina) Enabling this will create the canvas in high resolution - and wraps the mouse input as well.

Default: true

maxNumerOfLights

Number

Maximum number of lights in scene. Default value is 1

Default: 1

premultipliedAlpha

Boolean

WebGL spec: Default: true. If the value is true the page compositor will assume the drawing buffer contains colors with premultiplied alpha. If the value is false the page compositor will assume that colors in the drawing buffer are not premultiplied. This flag is ignored if the alpha flag is false. See Premultiplied Alpha for more information on the effects of the premultipliedAlpha flag.

Default: true

preserveDrawingBuffer

Boolean

Allows grabbing the content of the canvas using canvasObj.toDataURL(...).
Note that this has a performance penalty when enabled.
Default value is false
WebGL spec: If false, once the drawing buffer is presented as described in theDrawing Buffer section, the contents of the drawing buffer are cleared to their default values. All elements of the drawing buffer (color, depth and stencil) are cleared. If the value is true the buffers will not be cleared and will preserve their values until cleared or overwritten by the author.

Default: false

shadowDistance

Number

The maximum distance shadows are displayed from camera (the smaller the better quality of shadow map). Default value is 20

Default: 20

shadowMapQuality

Number

Shadow map resolution (relative to max texture size). Default is 1.0. Allowed values are 1/2, 1/4, 1/8, etc.

Default: 1.0

shadowNearMultiplier

Number

A multiplier that moves the near plane of the shadow map. Default is 2.0

Default: 2.0

shadows

Boolean

Use shadow maps to generate realtime shadows.
Default value is false.

Default: false

stencil

Boolean

WebGL spec: If the value is true, the drawing buffer has a stencil buffer of at least 8 bits. If the value is false, no stencil buffer is available.

Default: false

webglNotFoundFn

Function | String

function (or function name) with the signature function(domElement) called when WebGL cannot be initialized. Default function replaces the canvas element with an error description with a link to http://get.webgl.org/troubleshooting/