Skip to content
Christian Schlinkmann edited this page Mar 31, 2016 · 8 revisions

In xml3d.js, general parameters are part of the DOM, for instance attributes of a node. However, some parameters are rather implementation-specific or tied to a certain rendering algorithm. Configuring the implementation or a specific renderer is done through options.

Global Options

Available options can be queried:

 > XML3D.options.getKeys()
   ["loglevel", "renderer-frustumculling", "renderer-faceculling", "renderer-frontface"] 

Setting and getting of option values with getValue and setValue:

 > XML3D.options.getValue("loglevel")
   "warning"
 > XML3D.options.setValue("loglevel", "debug")`

Alternatively, global options can be set via query string of the URL. Then the option key needs to be prefixed with xml3d-:

  http://xml3d.github.io/xml3d-examples/examples/shaderOverrides/index.html?stats&xml3d-renderer-frustumculling=false

Available Options

Key Default Value Possible Values Description
loglevel warning exception, error, warning, info, debug Configure the verbosity of the console logger
resource-crossorigin-attribute anonymous anonymous, use-credentials The value attached to the crossorigin field of all img and video elements fetched by XML3D
renderer-frustumculling true true, false (De-)activate frustum culling
renderer-faceculling none none, back, front, both (De-)activate face culling
renderer-frontface ccw ccw, cw Define which side of a polygon is the front facing side.
renderer-movement-aware-click-handler false true, false If true then a click event will only be generated if the mouse did not move between mousedown and mouseup.
renderer-mousemove-picking true true, false Disabling this can improve performance in scenes that don't require onmouseout and onmouseover events for rendered objects.
renderer-continuous false true, false Setting this true will force the renderer to draw new frames at a continuous 30 fps. If false a new frame will only be drawn when something has changed.
renderer-ssao false true, false Experimental Screen Space Ambient Occlusion effect. Usually requires tinkering with the rest of the renderer-ssao parameters on a per-scene basis to get a decent result.

Per-element options

Not yet available

Clone this wiki locally