Private
constructorPrivate
_cameraMain camera for this context
Private
Optional
_envmapPrivate
activeBlend mode for non-opaque instances 'NORMAL' is the default, 'ADDITIVE' is useful for particles and glowing effects
Private
camerasShow extra debug details on the canvas
Backface culling
Private
Optional
dynamicGamma correction value, default 1.0
Private
glGlobal directional light
Optional
Readonly
hudA HUD you can use to render HTML elements over the canvas
Private
instancesPrivate
instancesPrivate
instancesAll the dynamic point lights in the scene
Set the fixed time step for physics stepping, only used when physicsWorld is set
Optional
physicsIntegration with cannon-es for physics, set the CANNON.World you are using here. When set, world stepping will be called for you in the core rendering loop
Private
Optional
postOptional post effects filter to apply to the output image
Private
renderPrivate
startedThe pre-render update function, called every frame. Hook in your custom logic and processing here
Optional
now: numberGet the name of the active camera
Get the current EnvironmentMap for the scene
Add or replace a named camera to the scene
Name of the camera
Camera instance
Private
addCreate and build a custom model from a ModelBuilder and cache it for use
Builder with geometry and materials added
Name of the model
Create an instance of a billboard/sprite in the scene
Type of billboard to create (default: CYLINDRICAL)
Create a new particle system in the scene
Maximum number of particles to allow in the system
Base size of the particles, default 2
Both the instance and the particle system
Create an instance of a primitive plane
Material to apply to the plane
Width of the plane
Height of the plane
Number of subdivisions along the width
Number of subdivisions along the height
Number of times to tile the texture over the plane
Create a new point light in the scene
The new light object
Create an instance of a primitive sphere
Material to apply to the sphere
Radius of the sphere
Number of subdivisions along the horizontal
Number of subdivisions along the vertical
Model loader, loads an OBJ model from a file via URL or path and adds it to the cache This is preferred over calling Model.parse() directly
Base path to the model file, e.g. './renderable/'
Name of the model file, e.g 'teapot.obj'
Apply texture filtering as materials are loaded
Remove instance from the scene, it will no longer be rendered
Instance to remove
Private
renderRender the scene from the given camera, used internally for rendering both the main view, but also shadow maps and dynamic env maps
Optional
programOverride: ProgramInfoSet and create a dynamic environment map which will enable dynamic/realtime reflections
Position to render reflections from
Size of the map to render, note higher sizes will come with a big performance hit
Use bulit-in scanlines post effect shader
Density of the scanlines, default 1.5
Opacity of the scanlines, default 0.5
Noise level, default 0.2
Flicker ammount, default 0.015
Set the EnvironmentMap for the scene, will overwrite any existing envmap. This will enable static reflections and create a 'skybox' around the scene
Rest
...textureURLs: string[]Array of 6 texture URLs to use for the map, in the order: +X, -X, +Y, -Y, +Z, -Z
Static
initCreate & initialize a new Context which will render into provided canvas. This is where you start when using the library.
CSS selector for canvas element, default is 'canvas'
Enable anti-aliasing in the renderer, default is true
Generated using TypeDoc
The main rendering context. This is the effectively main entry point for the library. Typically you will create a single instance of this class using init() and use it to render your scene.