POV-Ray : Newsgroups : povray.binaries.images : Odd blur effect: squared spheres : Re: Odd blur effect: squared spheres Server Time
7 Jun 2024 18:35:51 EDT (-0400)
  Re: Odd blur effect: squared spheres  
From: Zeger Knaepen
Date: 27 Aug 2002 16:17:34
Message: <3d6bde5e@news.povray.org>
> > I was trying to do focalblur by averaging different renders earlier this
day.  I
> > came up with the following formula to scatter points inside a regular
polygon:
> >
> >   #declare Seed=seed(whatever);
> >   #declare angles=<insert number of angles here>;
> >   #declare Rot=360*rand(Seed);
> >   #declare X=pow(rand(Seed),.5);
> >   #declare Rot2=Rot/(360/angles);
> >   #declare fraqrot=Rot2-int(Rot2);
> >   #declare fraqrot2=abs(fraqrot-.5);
> >   #declare fraqrot3=pow(fraqrot2*2,.5);
> >   #declare Location=vrotate(x*X*(.8+.2*fraqrot3),Rot*z);
>
> probably right....
> but please compare these lines to the simple way of determing a single point
> in an rectangle concerning the time it takes to compute it ...
>
> ... and then take into account, that this has to been done multiple times
> per pixel ... Maybe its ok to precompute ~2^10 such values and store them
> in a table, so you can reuse them later ... but I'm not sure this will help
Yes, a rectangle, or a circle, will be faster, that's why you should have the
option to use a circle (or a rectangle, but I don't think that would give
realistic results actually).

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)               // ZK http://www.povplace.be.tf


Post a reply to this message

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