camera { ... bokeh_pigment { pigment_densite } ... }
Les rayons envoyés pour le calcul du focal blur sont répartis en fonction de la valeur du pigment pigment_densite
pris dans un carré [0,1]x[0,1] en x,y. La densité est la moyenne des trois composantes R,G et B de la couleur du pigment. Par défaut dans povray les rayons sont choisis dans [0,1]x[0,1] uniformément.
une image de test.
camera { location <5,5,-5> up y right x look_at <0,1,0> focal_point <0,0,4> aperture 3 blur_samples 4000 }
camera { location <5,5,-5> up y right x look_at <0,1,0> focal_point <0,0,4> aperture 3 blur_samples 4000 bokeh_pigment { hexagon color rgb 1 color rgb 0 color rgb 0 rotate 90*x scale .5 translate <.5 ,.5 ,0> } }
et le pigment correspondant :
camera { location <5,5,-5> up y right x look_at <0,1,0> focal_point <0,0,4> aperture 3 blur_samples 4000 bokeh_pigment { gradient y color_map { [0.02 color rgb 1][0.05 color rgb 0] } scale .55 translate <.5,.5,0> } }
et le pigment correspondant :
Look for #ifdef BOKEH_PATCH in sources
The samples used in the focal blur are found by dividing [0,1]x[0,1] in a grid of size x=size y=sqrt(nb_samples/4). Then for each sub square we randomly choose a number of samples proportional to the value of the pigment in this sub square (pigment computed at the center of the sub square). If the pigment is uniform we have 4 random samples by sub squares.
In function focal_blur, a Clip_Colour(C, C) was commented to have better results.
Possible improvements/problems