Table Of Contents

Previous topic

21.34. The PhysicsManager Object

Next topic

21.36. The Profile Object

This Page

21.35. The PostEffects Object

Provides a set of post effects shaders and materials that can be used with the DeferredRendering and ForwardRendering objects.

Currently it provides the following simple effects:

  • copy: simple pass-through effect.
  • fadein: interpolates the source texture color with a fade-in color value.
  • modulate: modulates the source texture color with a modulate color value.
  • blend: blends source texture color with destination based on alpha value.
  • bicolor: interpolates between to given colors based on the luminance of the source texture color.

See ForwardRendering.draw and DeferredRendering.draw for how to use post effects.

Required scripts

The PostEffects object requires:

/*{{ javascript("jslib/posteffects.js") }}*/

21.35.1. Constructor

21.35.1.1. create

Summary

Syntax

var postEffects = PostEffects.create(graphicsDevice, shaderManager);
graphicsDevice
The GraphicsDevice object used to create shaders and materials required by the effects.
shaderManager
The ShaderManager object used to load the shaders required by the effects.

21.35.2. Method

21.35.2.1. updateShader

Summary

Updates the shaders used for the effects.

Syntax

postEffects.updateShader(shaderManager);
shaderManager
The ShaderManager object used to load the required shaders.

If the required shaders were not ready when the renderer was created this method can be used to update them.

21.35.2.2. getEffectSetupCB

Summary

Returns the effect setup callback for the requested effect.

Syntax

postEffects.getEffectSetupCB(name);
name
The name of the effect whose setup callback is requested.

This setup callback can be passed as the postFXsetupFn parameter on the DeferredRendering draw method.

21.35.2.3. destroy

Summary

Releases the PostEffects object and all the resources it allocated.

Syntax

postEffects.destroy();

21.35.3. Properties

21.35.3.1. version

Summary

The version number of the PostEffects implementation.

Syntax

var versionNumber = postEffects.version;