noa.rendering - Manages all rendering, and the BABYLON scene, materials, etc.

This module uses the following default options (from the options object passed to the Engine):

{
showFPS: false,
antiAlias: true,
clearColor: [0.8, 0.9, 1],
ambientColor: [0.5, 0.5, 0.5],
lightDiffuse: [1, 1, 1],
lightSpecular: [1, 1, 1],
lightVector: [1, -1, 0.5],
useAO: true,
AOmultipliers: [0.93, 0.8, 0.5],
reverseAOmultiplier: 1.0,
preserveDrawingBuffer: true,
octreeBlockSize: 2,
renderOnResize: true,
}

Hierarchy

  • Rendering

Properties

camera: FreeCamera

the Babylon.js FreeCamera that renders the scene

engine: Engine

the Babylon.js Engine object for the scene

light: DirectionalLight

a Babylon.js DirectionalLight that is added to the scene

renderOnResize: boolean

Whether to redraw the screen when the game is resized while paused

scene: Scene

the Babylon.js Scene object for the world

Methods

  • Adds a mesh to the engine's selection/octree logic so that it renders.

    Parameters

    • mesh: any

      the mesh to add to the scene

    • isStatic: boolean = false

      pass in true if mesh never moves (i.e. never changes chunks)

    • pos: any = null

      (optional) global position where the mesh should be

    • containingChunk: any = null

      (optional) chunk to which the mesh is statically bound

    Returns void

  • The Babylon scene object representing the game world.

    Returns Scene

  • Create a default standardMaterial:
    flat, nonspecular, fully reflects diffuse and ambient light

    Parameters

    • name: any

    Returns StandardMaterial

  • Use this to toggle the visibility of a mesh without disposing it or removing it from the scene.

    Parameters

    • mesh: Mesh
    • visible: boolean = false

    Returns void

Generated using TypeDoc