API Reference

Class List

Lightmapper

The lightmapper is used to bake scene lights into textures.

Summary

Methods

bake

Generates and applies the lightmaps.

Details

Constructor

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

Parameters

deviceGraphicsDevice

The grahpics device used by the lightmapper.

rootEntity

The root entity of the scene.

sceneScene

The scene to lightmap.

rendererForwardRenderer

The renderer.

assetsAssetRegistry

Registry of assets to lightmap.

Methods

bake(nodes, [mode])

Generates and applies the lightmaps.

Parameters

nodesEntity[], null

An array of entities (with model or render components) to render lightmaps for. If not supplied, the entire scene will be baked.

modenumber

Baking mode. Can be:

  • BAKE_COLOR: single color lightmap
  • 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. Defaults to BAKE_COLORDIR.