Off-Screen Rendering, to generate Spherical harmonics and IBL mipmaps
The Baker is published on npm with full typing support. To install, use:
$ npm install @galacean/tools-bakerThis will allow you to import package entirely using:
import * as BAKER from "@galacean/tools-baker";or individual classes using:
import { IBLBaker } from "@galacean/tools-baker";const bakedTexture = IBLBaker.fromScene(scene);
ambientLight.specularTexture = bakedTexture;
const sh = new SphericalHarmonics3();
SphericalHarmonics3Baker.fromTextureCubeMap(bakedTexture, sh);
ambientLight.diffuseMode = DiffuseMode.SphericalHarmonics;
ambientLight.diffuseSphericalHarmonics = sh;The engine is released under the MIT license. See LICENSE file.