POV-Ray : Newsgroups : povray.general : Blur modifier : Re: Blur modifier Server Time
31 Jul 2024 04:26:28 EDT (-0400)
  Re: Blur modifier  
From: FlyerX
Date: 24 Nov 2007 02:06:05
Message: <4747cd5d$1@news.povray.org>
Leroy wrote:
> Couldn't you use the average of a pigment with its copy slightly moved?
> Come to think of it, you could use any number of copies all moved 
> differently.
> 
And here is the average with some Gaussian blurring

material{
texture{
pigment{
average pigment_map{
#declare r=seed(0);
#declare n=100; //number of samples (gets slow above 10)
#declare sigma=0.015;//as a fraction of 1.0
#declare max_blur_amount=sigma*3;//spread only 3sigmas out
#declare c=0;
#while (c<n) //loop n times
    #declare dist=<rand(r),rand(r),rand(r)>*max_blur_amount;
    #declare 
gauss=(1/2/pi/pow(sigma,2))*exp(-(pow(dist.x,2)+pow(dist.y,2)+pow(dist.z,2))/(2*pow(sigma,2)));
    [gauss image_map{sys "90.bmp" interpolate 2 } translate dist]
    #declare c=c+1;
#end
}
                }
        }
    }

later,

FlyerX


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.