color diffuus (normal Normaal; float Brilliance=1, Diffuus = .7) { normal Nn=normalize(Normaal),Ln; color kleur=0; extern point P; extern vector L; extern color Cl; illuminance(P,Nn,PI/2) { Ln = normalize(L); kleur += Cl*pow(Ln.Nn,Brilliance)*Diffuus; } return kleur; } color intercol (color C1,C2;float t) { return C1*(1-t)+C2*t; } surface material ( float transparantie=1, //transparance at edges (0: solid, 1=fuzzy edges) edgefalloff=2.5, //"fuzziness" of the edges randhelderheid=.5, //brightness of the glow on the edges brilliance=1, //brilliance (as in POV-Ray) diffuus=.7, //diffuse (as in POV-Ray) speculair=1, //specular (as in POV-Ray, except this is a darker specular-high'light') roughness=.2, //roughness, size of the dark spot metallic=0; //metallic (as in POV-Ray, although I don't really know if it has much effect here :) color indirect=0, //ambient (as in POV-Ray) Kleur2=Cs //second color (currently, the fur has only 2 colors: Cs and Kleur2) ) { point Punt=P*1; Cs=Cs*4; Kleur2=Kleur2*4; float opac = pow (abs(normalize(N).normalize(I)), edgefalloff); float randje = (1 - opac); float ruis3=noise(Punt*5); color K1=intercol(Cs,Kleur2,ruis3); point ruiskleur=((.5,.5,.5)+noise(Punt)*.5)/25; float ruis2=.25+noise(Punt/100)*.75; normal Norm=normalize(N); vector schaal=1; float ruis=pow(.25+noise(Punt*1/ruiskleur*(1/schaal))*.75*ruis2,3); color Oppervlaktekleur=K1*pow(ruis,.5); color D=diffuus(Norm,brilliance,diffuus); color D2=diffuus(Norm,brilliance*4,diffuus*.25); vector V=normalize(-I); color S=phong(Norm,V,1/roughness)*speculair*intercol((1,1,1),Oppervlaktekleur,metallic); color S2=phong(Norm,V,1/(roughness*2))*(speculair*.5)*intercol((1,1,1),Oppervlaktekleur,metallic); color gewonekleur=Oppervlaktekleur*D+S+indirect; color furkleur=Oppervlaktekleur*(D-D2)-S2+indirect; Ci = furkleur; Ci += Ci*randje*randhelderheid; float cosinus=cos(noise(P*25)*PI); float teken=cosinus/abs(cosinus); float ruis4=.1+.5+((teken*pow(abs(cosinus),.75))/2) *.9; float T=min(opac*5,1)*transparantie; Oi=max(T-(sin(T*PI)*ruis4),0); }