ImageBasedLight

ImageBasedLight

Image based lighting for the scene.

Constructor

new ImageBasedLight(options)

Parameters:
Name Type Description
options Object

Methods

_getBRDFMap(renderer, options) → {RenderTarget}

Computes brdf map

Parameters:
Name Type Description
renderer Renderer
options Object
Properties
Name Type Description
pbrMode Number

_getSpecularMaps(texture, renderer, options) → {RenderTarget}

Computes multi mip level specular map with different roughness based on a given cubemap.

Parameters:
Name Type Description
texture Texture | RenderTarget

Must be an HDR IBL to have correct PBR specular values.

renderer Renderer
options Object
Properties
Name Type Description
pbrMode Number

_getSphericalHarmonic(texture, renderer, options) → {Float32Array}

Computes the spherical harmonic coefficient based on the cubeMap.

Parameters:
Name Type Description
texture Texture | RenderTarget

Must be an Cube HDR IBL to have correct PBR irradiance values.

renderer Renderer
options Object

clear()

Clear the image based light

generateIBLMaps(inputTexture, renderer, options)

Generate the IBL related maps and set them in the class/.
The function will also generate the binaryData of the IBL maps in the memory

Parameters:
Name Type Description
inputTexture Texture | RenderTarget
renderer Renderer
options Object
Properties
Name Type Description
irradianceMapSize Number

texture size of irradianceMap. default to 32

specularMapSize Number

texture size of specularMap for IBL; default to 128;

brdfMapSize Number

texture size of brdfMap for IBL; default to 512;

skyboxEncodedSize Number

encoded texture size of the skybox map; default to 256

getTextureDataUrl()

Generate the PNG data url (base64 string) of the IBL related maps

setBRDFMap(texture, renderer, options)

Set BRDF LUT texture for this IBL

Parameters:
Name Type Description
texture Texture | RenderTarget
renderer Renderer
options Object

setCubeMap(texture, renderer, options)

Set cube map texture for this IBL

Parameters:
Name Type Description
texture Texture | RenderTarget
renderer Renderer
options Object

setIrradianceMap(texture, renderer, options)

Set irradiace texture for this IBL

Parameters:
Name Type Description
texture Texture | RenderTarget
renderer Renderer
options Object

setSpecularMaps(textures, renderer, options)

Set specular textures for this IBL

Parameters:
Name Type Description
textures Array.<Texture> | Array.<RenderTarget>
renderer Renderer
options Object