Vizard 8 » Command Index » Vizard modules » viz » <viz>.addEffectComposer
8.0

<viz>.addEffectComposer

Add an effect composer object

<viz>.addEffectComposer(  
source  
)  
source
Source code or filename containing composer defintion

Remarks

This command creates a new effect composer object from the specified source. The returned composer object can be applied to any <node3d> object to enable automatic shader composition.

Return Value

<composer> object

Example

code = """
Composer {

    Vertex {
        BEGIN
        void main()
        {
            vec4 eyeVertex = gl_ModelViewMatrix * gl_Vertex;
            gl_Position = gl_ProjectionMatrix * eyeVertex;
        }
        END
    }

    Fragment {
        BEGIN
        void main()
        {
            vec4 color = vec4(0.0,0.0,0.0,1.0);

            <ComputeColor>

            gl_FragColor = color;
        }
        END
    }
}
"""
composer = viz.addEffectComposer(code)

See also

<viz>.addEffect
<node3d>.apply