// random #macro Hash1(t1) #local p1=sin(t1); #local pf=cos(1e7*(p1)); abs(1e4*pf-int(1e4*pf)) #end #macro Hash2(t1,t2) #local p1=sin(t1); #local p2=cos(t2*2.2361); #local pf=cos(1e7*(p1+p2)); abs(1e4*pf-int(1e4*pf)) #end #macro Hash3(t1,t2,t3) #local p1=sin(t1); #local p2=cos(t2*2.2361); #local p3=sin(t3*1.8708+1); #local pf=cos(1e7*(p1+p2+p3)); abs(1e4*pf-int(1e4*pf)) #end // random vector #macro Hash3p (A,B,C) #local D = A; #local Vector = 2*x; #while (vlength(Vector)>1) #local Vector = *2-<1,1,1>; #local D = D+1; #end Vector #end #macro glow(glow_color,glow_size,p_location,sampn,sampm) #local p_id = 0.1; #local glow_state = 0.001; // fader #local glow_colorturb = <0.3,0.3,0.3>; //magnitude Randomness to color #local ColorJitter = (-<0.5,0.5,0.5>)*glow_colorturb; //echov(ColorJitter) //echov(ColorJitter) //echov(ColorJitter) #local Color = ( glow_color *(1+ColorJitter) // Randomness to color <0.08566,-0.00723,0.04424> *(1.001-glow_state) // fader ); #local ColorM = max(Color.x,max(Color.y,Color.z)); // highest RGB #local Color = Color/2; sphere { 0, 1 hollow no_shadow pigment {rgbf 1} finish {ambient 1 diffuse 0} interior { media { emission Color // color intervals 10 // default 10 ratio 0.9 // default 0.9 distributes intervals differently between lit and unlit areas samples sampn,sampm // default 1,1 variance 1.0/128 confidence 0.9 method 2 //1,2,3adaptive density { spherical density_map { [0.0, rgb 0 ] [0.6, rgb Color ] [1.0, rgb 2*ColorM] } } } media { absorption Color*.1 // color intervals 10 // default 10 ratio 0.9 // default 0.9 distributes intervals differently between lit and unlit areas samples sampn,sampm // default 1,1 variance 1.0/128 confidence 0.9 method 2 //1,2,3adaptive density { spherical density_map { [0.0, rgb 0 ] [0.6, rgb (ColorM-Color)] [1.0, rgb 0 ] } } } } scale glow_size //echov(0.5/glow_size) translate p_location } #end //glow(<1.0,0.2,0.2>,<2.0,100.0,2.0>,<20,0,15>,4,8)