Clone this wiki locally
CubicVR.start provides a very simple way to start your application. For more refined startup with additional options, see the CubicVR.init function.
core_fs are typically left undefined as they will be automatically bundled with CubicVR.js when consolidated or minified. While in expanded form the paths to the core shaders will be determined automatically based on the inclusion of CubicVR.js.
If a canvas is not provided a full-browser one will be created for you with resize support. To add any object that has a
.resize(x,y) method to the resize call just use
CubicVR.addResizable(object). Most relevant objects such as Scene, Layout, Camera, PostProcessingChain and more already support being added to the global-resize list.
pass: Function to call if successfully initialized. It will be passed the GL context and Canvas. format:
fail(optional) : A function to call if WebGL init fails, optionally a string to display. A default string is used if not provided.
canvas(optional) : This can be the ID of a canvas in the format
"#idname"or if left undefined will create it's own full-browser canvas.
core_vs(optional) : This can be the path to the core vertex shader, if left undefined the default path will be determined automatically.
core_fs(optional) : This can be the path to the core fragment shader, if left undefined the default path will be determined automatically.
A valid WebGL context if successful, falsey value if not.