An Effect is a named object that defines a standard appearance style, e.g. “blinn”, “translucent” and “env”.
It provides a mapping from a geometryType, e.g. “rigid” and “skinned”, to an object that can prepare a renderable so that it can be drawn. Typically the prepare function will reference shaders and techniques it has requested to be loaded.
The renderers register a number of Effects during their create() methods.
This abstraction allows custom effect types to be registered for custom geometry types.
Required scripts
The Effect object requires:
/*{{ javascript("jslib/effectmanager.js") }}*/
Summary
For a given geometry type add a prepare object that can process a renderable of that type.
Syntax
effect.add(geometryType, prepareObject);
See also Effect Registration.
Summary
Deletes the geometryType stored with the given name.
Syntax
effect.remove(name);
Summary
Returns the prepare object associated with the geometryType.
Syntax
var prepareObject = effect.get("rigid");
prepareObject.prepare(geometryInstance);
Returns a prepareObject previously registered with the add() method.