Skip to content

Post-Processing Effects

setBloom

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

Sets bloom post-processing effect options. Bloom creates a glow effect around bright areas of the scene.

Options:

  • intensity - The intensity of the bloom effect (number, 0-1)
  • threshold - The brightness threshold for bloom (number, 0-1)
  • enabled - Whether the effect is enabled (boolean)
js
api.setBloom({ 
  intensity: 0.5, 
  threshold: 0.8,
  enabled: true 
}, function() {
  console.log('Bloom effect updated');
});

setChromaticAberration

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

Sets chromatic aberration post-processing effect options. This effect simulates the color fringing that occurs in real camera lenses.

Options:

  • intensity - The intensity of the chromatic aberration effect (number, 0-1)
  • enabled - Whether the effect is enabled (boolean)
js
api.setChromaticAberration({ 
  intensity: 0.3,
  enabled: true 
}, function() {
  console.log('Chromatic aberration updated');
});

setColorize

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

Sets colorize post-processing effect options. This effect tints the entire scene with a specific color.

Options:

  • color - The tint color (string, hex color)
  • intensity - The intensity of the colorize effect (number, 0-1)
  • enabled - Whether the effect is enabled (boolean)
js
api.setColorize({ 
  color: '#ff0000', 
  intensity: 0.5,
  enabled: true 
}, function() {
  console.log('Colorize effect updated');
});

setGrain

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

Sets grain post-processing effect options. This effect adds film grain noise to the scene for a more cinematic look.

Options:

  • intensity - The intensity of the grain effect (number, 0-1)
  • enabled - Whether the effect is enabled (boolean)
js
api.setGrain({ 
  intensity: 0.2,
  enabled: true 
}, function() {
  console.log('Grain effect updated');
});

updateFog

updateFog(options: object, [callback: Function])

Updates fog settings in the scene. Fog creates atmospheric depth by fading distant objects.

Options:

  • density - The density of the fog (number, 0-1)
  • color - The color of the fog (string, hex color)
  • near - The near distance where fog starts (number)
  • far - The far distance where fog is maximum (number)
  • enabled - Whether fog is enabled (boolean)
js
api.updateFog({ 
  density: 0.1, 
  color: '#ffffff',
  near: 1,
  far: 100,
  enabled: true 
}, function() {
  console.log('Fog updated');
});

Built with ❤️ by rooom AG