Skip to content

Post Processing

rooomSpaces Viewer API post-processing effects for immersive environments. Apply grain, bloom, depth of field, and atmospheric effects to enhance 3D virtual space rendering.

setGrain

setGrain(params: object, [callback: Function])

Adds film-like grain texture to the rendered scene.

Available options:

  • isEnabled: boolean: state of the effect.
  • intensity: number: intensity of the grain (0.0 to 1.0 recommended).
  • isAnimated: boolean: whether grain moves dynamically or remains static.
js
api.setGrain({
  isEnabled: true,
  intensity: 0.3,
  isAnimated: true
}, function () {
  console.log('Grain effect enabled');
});

setChromaticAberration

setChromaticAberration(params: object, [callback: Function])

Simulates lens color separation at the edges of objects.

Available options:

  • isEnabled: boolean: state of the effect.
  • aberrationAmount: number: strength of color separation (0.0 to 1.0).
  • radialIntensity: number: how much the effect increases toward screen edges.
  • direction: { x: number, y: number }: directional bias for the aberration effect.
js
api.setChromaticAberration({
  isEnabled: true,
  aberrationAmount: 0.2,
  radialIntensity: 0.5,
  direction: { x: 0.1, y: 0.1 }
}, function () {
  console.log('Chromatic aberration enabled');
});

setBloom

setBloom(params: object, [callback: Function])

Makes bright areas of the scene glow and spread light.

Available options:

  • isEnabled: boolean: state of the effect.
  • threshold: number: brightness level where bloom begins (0.0 to 1.0).
  • weight: number: intensity of the bloom effect.
  • kernel: number: size of the bloom spread.
  • scale: number: overall scale of the bloom effect.
js
api.setBloom({
  isEnabled: true,
  threshold: 0.8,
  weight: 0.4,
  kernel: 64,
  scale: 1.0
}, function () {
  console.log('Bloom enabled');
});

setColorize

setColorize(params: object, [callback: Function])

Applies a color grade (hue, saturation, lightness) to the entire scene.

Available options:

  • isEnabled: boolean: state of the effect.
  • hue: number: color hue shift (-180 to 180 degrees).
  • saturation: number: color intensity adjustment (-1.0 to 1.0).
  • lightness: number: overall brightness adjustment (-1.0 to 1.0).
js
api.setColorize({
  isEnabled: true,
  hue: 15,        // Warm orange tint
  saturation: 0.2, // Slightly more vibrant
  lightness: 0.1   // Slightly brighter
}, function () {
  console.log('Colorize effect applied');
});