API Reference

Class List

pc.Scene

A scene is a container for pc.Model instances.

Summary

Properties

ambientLightThe color of the scene's ambient light.
fogThe type of fog used by the scene.
fogColorThe color of the fog (if enabled).
fogDensityThe density of the fog (if enabled).
fogEndThe distance from the viewpoint where linear fog reaches its maximum.
fogStartThe distance from the viewpoint where linear fog begins.
gammaCorrectionThe gamma correction to apply when rendering the scene.
lightmapMaxResolutionMaximum lightmap resolution
lightmapModeBaking mode, with possible values:
  • pc.
lightmapSizeMultiplierLightmap resolution multiplier
skyboxA cube map texture used as the scene's skybox.
skyboxIntensityMultiplier for skybox intensity.
skyboxMipThe mip level of the skybox to be displayed.
toneMappingThe tonemapping transform to apply when writing fragments to the frame buffer.

Methods

addModelAdds the specified model to the scene.
removeModelRemoves the specified model from the scene.
updateSynchronizes the graph node hierarchy of every model in the scene.

Details

Constructor

Scene()

Creates a new Scene.

Properties

pc.ColorambientLight

The color of the scene's ambient light. Defaults to black (0, 0, 0).

Stringfog

The type of fog used by the scene. Can be:

  • pc.FOG_NONE
  • pc.FOG_LINEAR
  • pc.FOG_EXP
  • pc.FOG_EXP2

pc.ColorfogColor

The color of the fog (if enabled). Defaults to black (0, 0, 0).

NumberfogDensity

The density of the fog (if enabled). This property is only valid if the fog property is set to pc.FOG_EXP or pc.FOG_EXP2. Defaults to 0.

NumberfogEnd

The distance from the viewpoint where linear fog reaches its maximum. This property is only valid if the fog property is set to pc.FOG_LINEAR. Defaults to 1000.

NumberfogStart

The distance from the viewpoint where linear fog begins. This property is only valid if the fog property is set to pc.FOG_LINEAR. Defaults to 1.

NumbergammaCorrection

The gamma correction to apply when rendering the scene. Can be:

  • pc.GAMMA_NONE
  • pc.GAMMA_SRGB
  • pc.GAMMA_SRGBFAST
Defaults to pc.GAMMA_NONE.

NumberlightmapMaxResolution

Maximum lightmap resolution

NumberlightmapMode

Baking mode, with 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.

NumberlightmapSizeMultiplier

Lightmap resolution multiplier

pc.Textureskybox

A cube map texture used as the scene's skybox. Defaults to null.

NumberskyboxIntensity

Multiplier for skybox intensity. Defaults to 1.

NumberskyboxMip

The mip level of the skybox to be displayed. Defaults to 0 (base level). Only valid for prefiltered cubemap skyboxes.

NumbertoneMapping

The tonemapping transform to apply when writing fragments to the frame buffer. Can be:

  • pc.TONEMAP_LINEAR
  • pc.TONEMAP_FILMIC
  • pc.TONEMAP_HEJL
  • pc.TONEMAP_ACES
Defaults to pc.TONEMAP_LINEAR.

Methods

addModel()

Adds the specified model to the scene.

removeModel()

Removes the specified model from the scene.

update()

Synchronizes the graph node hierarchy of every model in the scene.