Configuration options for CreativeEngine.init. An option that only one of
the two engines reads says so.
Properties#
| Property | Type | Description |
|---|---|---|
baseURL |
string |
Base URL for loading engine assets. |
license? |
string |
License key for the engine. Empty string drops the engine into Evaluation mode. |
userId? |
string |
Optional user identifier passed through to engine tracking. |
core |
object |
Where the WASM engine loads its .wasm and .data files from. The package carries them, so set this only to host them yourself. The native engine ignores it. |
core.baseURL |
string |
- |
logger |
Logger |
Custom logger. Defaults to console.log / console.warn / console.error per level. |
featureFlags? |
object |
Feature flags. |
presets |
object |
Deprecated This config key is not used anymore and will be removed. |
presets.typefaces? |
object |
Deprecated The configuration option presets.typefaces does not exist anymore. Custom typefaces should be defined as asset sources using the cesdk.engine.asset.addSource or cesdk.engine.asset.addLocalSource instead. |
forceWebGL1? |
boolean |
Force a WebGL1 context instead of the default WebGL2 (with WebGL1 fallback). The native engine ignores it. |
audioOutput? |
"none" |
"auto" |
role? |
RoleString |
Initial engine role. Defaults to ‘Creator’. |
device? |
Device |
The render device of the native engine. Defaults to 'auto': Metal, EGL or Direct3D 12, and the CPU where none is available. The WASM engine ignores it. Example await CreativeEngine.init({ license, device: 'gpu' }); await CreativeEngine.init({ license, device: 'cpu' }); |
engine? |
EngineSelection |
The engine to start. Unset, the CESDK_ENGINE environment variable chooses it, then 'auto'. 'auto' falls back to the WASM engine when this host has no native binary, the binary does not load, or the license does not cover the native engine. It logs the reason through logger, or once per process on stderr with the default logger: at the Warning level when the native binary for this host does not load, and at the Info level otherwise. An instance keeps its engine until it is disposed. Example await CreativeEngine.init({ license, engine: 'native' }); // fail instead of falling back |