|
![](/i/fill.gif) |
Nathan Kopp wrotes:
> >Didn't somebody modify my create_spectrum (for photons+dispersion) macro to
> >make it better (it currently produces reddish light)? I'd like a copy of
> >the changed version if anybody has it.
> >
> >-Nathan
I've send ya a modified macro.
Only change this:
#local Huered = 0.9 - (h/0.5);
to
#local Huered = 0.9 - (h/0.45);
Now the light and shadows are white and not purplish/reddish.
Here is the complete macro:
//---Macro for light-spectrum---//
#macro create_spectrum(nelems,bright)
#local elem=1;
color_map{
#while(elem<=nelems)
/* h goes from 0 at red end to 1.0 at blue end */
#local h = (elem-1)/(nelems-1);
/* co-h goes from 1.0 at red end to 0.0 at blue end */
#local coh = 1.0 - h;
#local Huered = 0.9 - (h/0.45);
#local Hueblue = 1.0 - (coh/0.6);
#if (Huered < 0.0) #local Huered = 0.0; #end
#if (Hueblue < 0.0) #local Hueblue = 0.0; #end
#local Huered=1.0 - (1.0-Huered)*(1.0-Huered);
#local Hueblue=1.0 - (1.0-Hueblue)*(1.0-Hueblue);
#local Huegreen = 1.0 - Huered - Hueblue;
#if (h>0.85)
#local Huered = 4*(h-0.85); // was 4 - changed to 8
#end
#local ybulge = -4.0*(h-0.1)*(h-0.6);
#if (ybulge<0) #local ybulge=0; #end
#local Huered = Huered+ybulge;// * 0.5; // added * 0.5
#local Huegreen = Huegreen+ybulge;
[bright, color rgb<Huered,Huegreen,Hueblue>]
//#debug
concat("<",str(Huered,0,3),",",str(Huegreen,0,3),",",str(Hueblue,0,3),">\n")
#local elem=elem+1;
#end // while
}
#end // macro
Post a reply to this message
|
![](/i/fill.gif) |