POV-Ray : Newsgroups : povray.general : Blur modifier Server Time
27 Nov 2024 22:33:19 EST (-0500)
  Blur modifier (Message 1 to 6 of 6)  
From: FlyerX
Subject: Blur modifier
Date: 23 Nov 2007 21:59:47
Message: <474793a3$1@news.povray.org>
Hello,

I was wondering if there is a way of producing blur effects on a pigment 
(procedural or image map). I have been playing with the turbulence warp 
and got close results using the code below with image maps.

warp{
          turbulence <0.5,0.5,0.5>*0.005
          octaves 6
          omega 1.5
          lambda 50
         }

Unfortunately it requires quite a strong anti-aliasing setting for 
acceptable results. It works better if colors are not too dissimilar. I 
know that for image maps I can take it into a graphics editor and blur 
the image but I would like to know if there is a proven method of 
blurring pigments that can be done within POV-Ray. Specially if the 
pigment is procedural.

Other variations of the warp above are useful for weathering effects on 
pigments.

later,

FlyerX


Post a reply to this message

From: Leroy
Subject: Re: Blur modifier
Date: 23 Nov 2007 23:38:19
Message: <4747AA85.5060702@joplin.com>
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.


Post a reply to this message

From: FlyerX
Subject: Re: Blur modifier
Date: 24 Nov 2007 01:08:05
Message: <4747bfc5@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.
> 
Very good idea, thanks. It actually works. I did not think about 
average. Here is a simple code I typed for this

material{
texture{
         pigment{
         average pigment_map{
	#declare r=seed(0);
	#declare max_blur_amount=0.05; //as a fraction of 1.0
	#declare n=50; //number of samples
	#declare c=0;
	#while (c<n) //loop n times
		[1.0 image_map{sys "90.bmp" interpolate 2}
		translate<rand(r),rand(r),rand(r)>*max_blur_amount]
	#declare c=c+1;
	#end
	}
         }
}}

I hope I can put it as a macro so I can call it as a special pigment.

thanks again,

FlyerX


Post a reply to this message

From: FlyerX
Subject: Re: Blur modifier
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

From: John VanSickle
Subject: Re: Blur modifier
Date: 24 Nov 2007 02:25:50
Message: <4747d1fe@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.

That's what I do.  I average a 2x2 to 8x8 copy of the pigment, depending 
on the requirements of the image.  For some projects I've made a blurred 
image from the regular image and used that as the pigment.

I've also experimented with setting the anti-aliasing level to 4x4 
samples per pixel, a threshold of zero, and jitter set to one.  This 
takes a bit of time (but not too much), and allows certain other 
settings (such as area lights) to be set to lower levels and still 
achieve the same quality.

Regards,
John


Post a reply to this message

From: Leroy
Subject: Re: Blur modifier
Date: 24 Nov 2007 19:58:07
Message: <4748C867.9030909@joplin.com>
FlyerX wrote:
> Very good idea, thanks. It actually works. I did not think about 
> average. Here is a simple code I typed for this

You welcome. And thanks for the examples I copied them and put them in 
my snipit file.

Have fun!


Post a reply to this message

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