CG Molecule

Add a vertex or fragment shader using the build-in editor.

Summary
CG Molecule
Preference Dialog
CommentsTypically, shader codes are executed by the GPU when a shader material is being rendered.
Properties
typestring, ( r )
pref.namestring, ( r )
pref.typestring, ( r, w )
scriptstring, ( r, w )
Functions
attach
detach
delete
rename
clone
serialize

Preference Dialog

Comments

Typically, shader codes are executed by the GPU when a shader material is being rendered.  To tie this shader code to a material, you can use Material Molecule’s Preferece Dialog to create a shader material first and select this shader from a drop down.  In the same dialog, an Object Molecule can also be selected as uniforms to be passed to the shader as input parameters.

Properties

type

string, ( r )

Type of this molecule, cg.

pref.name

string, ( r )

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

pref.type

string, ( r, w )

Gets/Sets the type of shader script, vertex or fragment.

script

string, ( r, w )

Gets/Sets the shader script.

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.

Close