API Reference

Class List

pc.Lightmapper

The lightmapper is used to bake scene lights into textures.

Summary

Methods

bakeGenerates and applies the lightmaps.

Details

Constructor

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

Parameters

devicepc.GraphicsDeviceThe grahpics device used by the lightmapper.
rootpc.EntityThe root entity of the scene.
scenepc.SceneThe scene to lightmap.
rendererpc.ForwardRendererThe renderer.
assetsArrayArray of assets to lightmap.

Methods

bake(nodes, mode)

Generates and applies the lightmaps.

Parameters

nodespc.EntityAn array of models to render lightmaps for. If not supplied, full scene will be baked.
modeNumberBaking 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.