AbstractRenderer

AbstractRenderer

Non-euclidean renderer. Takes as input the non-euclidean camera and scene and makes some magic. It should not be confused with the Three.js WebGLRenderer it relies on. Abstract class with the code common to all renderers.

Constructor

(abstract) new AbstractRenderer(shader1, shader2, set, camera, scene, params, threeRenderer)

Source:

Constructor.

Parameters:
Name Type Description
shader1 string

the first part of the geometry dependent shader

shader2 string

the second part of the geometry dependent shader

set TeleportationSet

the underlying teleportation set

camera BasicCamera

the camera

scene Scene

the scene

params Object

parameters for the Thurston part of the render. For the moment includes

threeRenderer WebGLRenderer | Object

either a Three.js renderer or the parameters to build it

  • {boolean} postprocess - Gamma and Tone correction

Classes

AbstractRenderer

Members

camera :DollyCamera

Source:

Non-euclidean camera

Type:

domElement

Source:

Shortcut to the DOM element of the underlying Three.js renderer. See Three.js doc.

maxBounces :number

Source:

Number of time the light rays bounce

Type:
  • number

postProcess :Boolean

Source:

Add post processing to the final output

Type:
  • Boolean

scene :Scene

Source:

Non-euclidean scene

Type:

set :TeleportationSet

Source:

The underlying subgroup

Type:

shader1

Source:

The first part of the geometry dependent shader.

shader2

Source:

The second part of the geometry dependent shader.

threeRenderer :WebGLRenderer

Source:

The underlying Three.js renderer If the passed argument is already a WebGLRenderer, we directly use it, otherwise, we build a WebGLRenderer from the passed parameters.

Type:
  • WebGLRenderer

threeScene :ThreeScene

Source:

The underlying Three.js scene Not to be confused with the non-euclidean scene.

Type:
  • ThreeScene

Methods

(abstract) build()

Source:

Build the Three.js scene with the non-euclidean shader.

(abstract) render()

Source:

Render the non-euclidean scene. The method build should be called before.

setAnimationLoop(callback)

Source:

Shortcut to set the animation loop of the underlying Three.js renderer. See Three.js doc.

Parameters:
Name Type Description
callback function

setClearColor(color, alpha)

Source:

Shortcut to set the clear color of the underlying Three.js renderer. See Three.js doc.

Parameters:
Name Type Description
color Color
alpha number

setPixelRatio(value)

Source:

Shortcut to set the pixel ratio of the underlying Three.js renderer. See Three.js doc.

Parameters:
Name Type Description
value number

setSize(width, height, updateStyle)

Source:

Shortcut to set the size of the underlying Three.js renderer. See Three.js doc.

Parameters:
Name Type Default Description
width number
height number
updateStyle boolean true