lcl_variation_B.slim

[index]

13th January 2009   9:1pm 43sec
/stuhome/vsfx419/slim/lcl_variation_B.slim


slim radial_inverting the falloff



slim 1 extensions Vincent {
extensions power Vint {
//-------------------------------------------------------------------------
    template color MixKolors1 {
        previewinfo {
            shadingrate 1
            objectsize 1
            objectshape Plane
            frame 1
            }
//--------------------------------------------------------
        parameter color c1 {
            description "One of the colors to mix"
            label "Color 1"
            detail varying
            default {0 0 0}
            }
        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 float s_center {
            description "center of s"
            label "s center"
            subtype slider
            range {0 1 0.1}
            detail varying
            default 0.5
            }
        
        parameter float t_center {
            description "center of t"
            label "t center"
            subtype slider
            range {0 1 0.1} 
            detail varying
            default 0.5
            
            }
        parameter float freq {
            description "wave cycle"
            label "number of cycles"
            subtype slider
            range {0 10 1}
            detail varying
            default 5
            
            }
        
        parameter float fade {
            description "fall off"
            label "fall off"
            subtype slider
            range {0 2}
            detail varying
            default 1
            }
        
        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
        VintMixKolors1 (
                color c1;
                color c2;
                float blend;
                float s_center;
                float t_center;
                float freq;
                float fade;
                output color result;
                )
        {
        float r;
        float wave; 
        r = sqrt((pow(s-s_center, 2 ))+(pow(t-t_center, 2)));
        wave = (sin(r * 2PI * freq) + 1) * 0.5;
        //fade_off--------------------
        float radius = -0.1;
        float fadeout = sqrt(pow(s-0.5,2) + pow(t-0.5,2));
        float fade_off = smoothstep( radius, fade, fadeout);
        color R1 = mix(c1, c2, blend*wave*1-fade_off);
        result = R1;
        }
} } } }