Class: Lightmapper

pc.Lightmapper

The lightmapper is used to bake scene lights into textures.

Constructor

new Lightmapper(device, root, scene, renderer, assets)

Parameters:
Name Type Description
device pc.GraphicsDevice The grahpics device used by the lightmapper.
root pc.Entity The root entity of the scene.
scene pc.Scene The scene to lightmap.
renderer pc.ForwardRenderer The renderer.
assets Array Array of assets to lightmap.
Source:

Methods

bake(nodes, mode)

Generates and applies the lightmaps.
Parameters:
Name Type Description
nodes pc.Entity An array of models to render lightmaps for. If not supplied, full scene will be baked.
mode Number Baking mode. Possible values:
  • pc.BAKE_COLOR: single color lightmap
  • pc.BAKE_COLORDIR: single color lightmap + dominant light direction (used for bump/specular)
Only lights with bakeDir=true will be used for generating the dominant light direction.
Source: