Module: config

API for the engine's global configuration.

Use the set()/get() method to change/get the value of a property. Use the reset() method to reset all properties to their default state. Any change in configuration must occur before engine initialization. Keep in mind that some of the properties are affected by the quality profile and the user's hardware/browser. In the former case use the CUSTOM profile in order to change such properties.

Normally, the users should not alter these parameters.

Configuration Parameters Available

allow_cors
Boolean, allow cross-origin resource sharing.
allow_hidpi
Boolean, allow HIDPI mode on supported devices (use the CUSTOM profile in order to change this parameter).
alpha
Boolean, enable WebGL canvas transparency.
alpha_sort
Boolean, enable z-sorting for transparent materials.
alpha_sort_threshold
Number, camera distance threshold for transparency z-sorting.
anaglyph_use
Boolean, enable anaglyph stereo rendering. Deprecated, use stereo instead.
animation_framerate
Number, animation framerate.
anisotropic_filtering
Boolean, enable anisotropic filtering
antialiasing
Boolean, enable postprocess-based anti-aliasing (use the CUSTOM profile in order to change this parameter).
assets_path
String, path to assets directory (for get_std_assets_path()).
assets_dds_available
Boolean, allow the engine to use compressed DDS textures.
assets_pvr_available
Boolean, allow the engine to use compressed PVRST textures. textures should be present near the source textures in order to be picked up.
assets_min50_available
Boolean, allow the engine to use halved textures. The halved textures should be present near the source textures in order to be picked up.
audio
Boolean, enable Web Audio.
background_color
Array, RGBA values to use as a background color for the WebGL canvas.
built_in_module_name
String, name of the module which stores exported data (HTML export only).
canvas_resolution_factor
Boolean, set the resolution factor for the canvas.
console_verbose
Boolean, print more debug info in the browser console.
dof
Boolean, enable DOF
god_rays
Boolean, enable god rays
bloom
Boolean, enable bloom
motion_blur
Boolean, enable motion_blur
do_not_load_resources
Boolean, disable loading of assets (textures and sounds).
enable_selectable
Boolean, enable selecting of objects.
enable_outlining
Boolean, enable outlining of object.
is_mobile_device
Boolean, check mobile device.
max_fps
Number, maximum FPS limit
max_fps_physics
Number, maximum physics FPS limit
media_auto_activation
Boolean, activate media data context on mobile devices using popup dialog.
outlining_overview_mode
Boolean, make all objects selectable, enable outlining and outlining on select.
physics_enabled
Boolean, use the uranium.js physics engine.
physics_uranium_path
String, path to the uranium.js file. If not specified, search in the directory with the engine's sources.
physics_calc_fps
Boolean, return physics FPS in FPS callback.
physics_use_workers
Boolean, simulate physics in workers (default) or not.
precision
String, preferred GLSL floating point precision (use the CUSTOM profile in order to change this parameter).
prevent_caching
Boolean, prevent assets caching by appending timestamp suffix to their URLs (default) or not.
quality
Number, preferred rendering quality profile (one of P_LOW, P_HIGH, P_ULTRA, P_CUSTOM enums).
reflections
Boolean, enable reflections
refractions
Boolean, enable refractions
sfx_mix_mode
Boolean, enable the mixer mode in the SFX subsystem.
shaders_path
String, path to the shaders directory (developer version only).
shadows
Boolean, enable shadows
show_hud_debug_info
Boolean, show HUD with debug information.
smaa
Boolean, enable SMAA anti-aliasing (use the CUSTOM profile in order to change this parameter).
smaa_search_texture_path
String, path to the SMAA "search" texture. If not specified, search in the directory with the engine's sources.
smaa_area_texture_path
String, path to the SMAA "area" texture. If not specified, search in the directory with the engine's sources.
ssao
Boolean, enable SSAO
stereo
String, stereoscopic mode: "ANAGLYPH", "HMD" or "NONE".
debug_view
Boolean, enable debug view mode.
use_min50
Boolean, enable min50 textures.
gl_debug
Boolean, enable gl errors check. Very slow.

Summary

Members

Methods

Type Definitions

Detailed Description

Members

P_AUTO

Auto quality profile: cannot be used directly, only for quality auto configurators.
Type:
Source:

P_CUSTOM

Custom quality profile: use engine defaults, allow customization.
Type:
Source:

P_HIGH

High quality profile: use all requested features.
Type:
Source:

P_LOW

Low quality profile: maximize engine performance, minimize memory consumption.
Type:
Source:

P_ULTRA

Ultra quality profile: use all requested features and maximize quality.
Type:
Source:

Methods

apply_quality(quality)

Set the engine's quality profile.
Parameters:
Name Type Description
quality QualityProfile Quality profile
Source:

get(prop) → {*}

Get the value of the config property of the engine.
Parameters:
Name Type Description
prop String Property name
Returns:
Value of property
Type
*
Source:

get_std_assets_path() → {String}

Get the path to the standard assets directory.
Returns:
Path to assets
Type
String
Source:
See:

reset()

Reset all the engine's config properties to defaults.
Source:

reset_limits()

Reset context limit properties to minimum.
Source:

set(prop, value)

Set the value of the config property of the engine.
Parameters:
Name Type Description
prop String Property name
value * New property value
Source:

Type Definitions

QualityProfile

Quality profile enum. One of P_LOW, P_HIGH, P_ULTRA, P_CUSTOM.
Type:
  • Number
Source: