Scene

class Scene(params)

Non-euclidean scene. All the objects added to the scene should belong to the same geometry

Constructor.

Arguments:
  • params (Object) – parameters of the scene including - {Fog} fog - the fog in the scene

Scene.Scene

Constructor.

Scene.background

Background material

Scene.fog

Fog in the scene

Scene.lights

type: Array.<Light>

List of all the lights in the scene.

Scene.nextId

type: number

Next available ID in the scene.

Scene.ptBackground

Background material (for path tracing)

Scene.solids

type: Array.<Solid>

List of all the solids in the scene.

Scene._add(obj)

Add exactly one object to the scene

Arguments:
  • obj (Solid|Light) – the object to add to the scene

Returns:

Scene – the current scene

Scene.add(...obj)

Add one or more object in the scene

Arguments:
  • obj (Solid|Light) – the objects to add

Returns:

Scene – the current scene

Scene.shader(shaderBuilder)

Build the shader relative to the scene. Only the dependencies (solids, shapes, materials, lights, etc) are loaded here. The scenes SDF (local and global) are built at the Renderer level. Indeed these chunk need to know what is the teleportation set to implement nearest neighbors Another strategy would be to link the scene to the teleportation set (in the constructor for instance)

Arguments:
  • shaderBuilder (ShaderBuilder) –

class Fog()

Defines a fog to be used in the scene.

Constructor. The constructor takes no argument.

Fog.Fog

Constructor. The constructor takes no argument.

Fog.shader(shaderBuilder)

Extend the given shader with the appropriate code

Arguments:
  • shaderBuilder (ShaderBuilder) – the shader builder