Pscale Cd and Alpha
eharetea

Create interpolation between values in particle attributes.

The use of particle attributes to control shading values of particles.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Tuesday July 29th, 2008 09:08 PM


/*
*
* Author: Dan Lynch
*
*/

#pragma hint clr1 color
#pragma hint clr2 color
#pragma hint clr3 color
#pragma hint clr4 color

#pragma disable clr1 switchcolor 0
#pragma disable clr2 switchcolor 0
#pragma disable clr3 switchcolor 0
#pragma disable clr4 switchcolor 0

#pragma disable p1 switchpscale 0
#pragma disable p2 switchpscale 0
#pragma disable p3 switchpscale 0
#pragma disable p4 switchpscale 0

#pragma disable a1 switchalpha 0
#pragma disable a2 switchalpha 0
#pragma disable a3 switchalpha 0
#pragma disable a4 switchalpha 0

#pragma group Color clr1 clr2 clr3 clr4
#pragma group Pscale p1 p2 p3 p4
#pragma group Alpha a1 a2 a3 a4

#pragma hint switchpscale toggle
#pragma hint switchcolor toggle
#pragma hint switchalpha toggle

pop
d_agelife
        (
        int switchcolor=0switchpscale=0switchalpha=0;

        vector clr1={0,0.8,1}, clr2={1,0.65,0.03}, clr3={0.9,0.15,0.025},clr4={0.7,0.1,0};
        float a1=1a2=.75a3=.5a4=0;
        float p1=0p2=.5p3=1p4=0;
        )
{
        float plive clamp(age/life,0,1);

        if (switchalpha) {
                float alphaattrib lspline(plivea1a2a3a4);
                addattribute("Alpha"alphaattrib);
        }

        if (switchpscale) {
                float pscaleattrib lspline(plivep1p2p3p4);
                addattribute("pscale",pscaleattrib);
        }

        if (switchcolor) {
                vector newattrib lspline(pliveclr1clr2clr3clr4);
                Cd newattrib;
        }
}




Downloads:
Download: agelife.vfl 2 KB
Download: pop_attributes.hip 144 KB

Please login or Click Here to register for downloads
Creative Commons License
Pscale Cd and Alpha by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com