Composer Molecule

Add post-processing effects to a scene.

Summary
Composer Molecule
Preference Dialog
CommentsThe composer molecule daisy-chains together a series of post-processing effect filters, called the passes, and applies them to a 3D scene.
Properties
typestring, ( r )
pref.namestring, ( r )
sceneobject, ( r )
cameraobject, ( r )
quadobject, ( r )
passesarray, ( r )
rendererobject, ( r, w )
Functions
attach
detach
delete
rename
clone
serialize
render
pass

Preference Dialog

Comments

The composer molecule daisy-chains together a series of post-processing effect filters, called the passes, and applies them to a 3D scene.  Unlike camera, composer does not render automatically.  You mush call its render function to manually render to screen, or to a frame buffer.  You can do so within a script molecule triggered by scene.render event which is guaranteed to be executed per rendering cycle.

The composer allows you to add custom effect by building your own shader material using CG Molecules and Material Molecule.

Properties

type

string, ( r )

Type of this molecule, composer.

pref.name

string, ( r )

The scriptable name for this molecule.  This name can be set using rename function dynamically.

scene

object, ( r )

Returns the internal scene object.

camera

object, ( r )

Returns the internal orthographic camera object.

quad

object, ( r )

Returns the internal quad plane.

passes

array, ( r )

Returns an array of all the shader passes.

renderer

object, ( r, w )

Gets/Sets the internal renderer of this composer.

Functions

attach

attach(droplet);

Attach this molecule to the given droplet.

Parameters

droplet(object) a droplet.

Returns

N/A

detach

detach();

Remove this molecule from its droplet.

Parameters

N/A

Returns

N/A

delete

delete();

Delete this molecule.

Parameters

N/A

Returns

N/A

rename

rename(name);

Rename this molecule.

Parameters

name(string) a new name.

Returns

N/A

clone

clone();

Create a clone of this molecule.

Parameters

N/A

Returns

(object) a molecule.

serialize

serialize();

Serialize this molecule into its JSON representation.

Parameters

N/A

Returns

(string) JSON representation of a molecule.

render

render(delta);

Render to host camera’s render target, usually the screen.

Parameters

delta(float) Optional.  a time increment.

Returns

N/A

pass

pass(type);

Returns an array of effect passes by type, or simply the effect pass itself, if only one is found.

Parameters

type(string) the type of pass.  (e.g ‘vblur’, ‘bloom’, ‘focus’, ‘film’, ‘dotscreen’, ‘ssao’, ‘edge’, ‘colorify’, etc.)

Returns

(mixed) an array of effect passes, or simply the pass, if only one is found.

Close