mixpillcolor.slim

[index]

22th February 2009   0:2am 0sec
/home/cleong20/Desktop/vsfx419/slim/mixpillcolor.slim


mixpill_slimnode



# Sample template that uses RSLFunction
slim 1 extensions Vint {
extensions power Vint {
    # A template is an appearance that is used to generate functions and
    # is fundamental to Slim's shader creation features. Templates are
    # containers of properties.
    template color mixpillcolor {
        previewinfo {
            shadingrate 1
            objectsize 1
            objectshape Plane
            frame 1
            }
        # Parameters are used to collect all information associated
        # with a single parameter of an appearance.
        parameter color c1 {
            description "One of the colors to mix"
            label "Color 1"
            detail varying
            default {1 1 1}
            }
        parameter color c2 {
            description "One of the colors to mix"
            label "Color 2"
            detail varying
            default {1 1 1}
            }
        parameter float blend {
            description "How much of Color 2 to mix with Color 1"
            label "Blend"
            subtype slider
            range {0 1}
            detail varying
            default 0.5
            }
    
        parameter color result {
                access output
                display hidden
                }
        # The RSLFunction is where the calculations are done.
        # The order in which the parameters are declared must
        # match the order in which they are described above.
        RSLFunction {
        void
        Vintmixpillcolor (
                color c1;
                color c2;
                float blend;
                output color result;
                )
        {
        //float wave = sin(((s*(-1*st_switch+1) + t*(st_switch))*2PI*freq) + 1) * 0.5;  
        //flaot wave;
        //if (st_switch == 0)
        //        wave = (sin(s*2PI*freq)+1)*0.5;
        //else 
        //        wave = (sin(t*2PI*freq)+1)*0.5;
        result = mix(c1, c2, blend * t);
        }
} } } }