POV-Ray : Newsgroups : povray.binaries.images : Bragging on Server Time
13 Nov 2024 17:32:27 EST (-0500)
  Bragging on (Message 1 to 10 of 10)  
From: clipka
Subject: Bragging on
Date: 28 Aug 2010 11:35:31
Message: <4c792cc3@news.povray.org>
To add to my recent brags, here's focal blur:

Image #1 shows a scene rendered with original POV-Ray 3.7 beta 38; scene 
is the default "checkered plane" scene template, with focal blur enabled 
in the camera, and an additional highly emissive small sphere to show 
the bokeh:

   camera {
     ...
     focal_point <0,0,0>
     aperture 0.5
     blur_samples 1000
     confidence 0.95
     variance 1/200
   }

   sphere {              // emissive sphere
     <-2,-0.95,2>, 0.05
     texture {
       pigment { color rgb <1,1,1> }
       finish { emission 10.0 diffuse 0 ambient 0 specular 0 }
     }
   }


One nasty, clearly visible thing about POV-Ray's focal blur is the 
square-ish bokeh. Occasionally you might also see six-pointed stars, but 
most of all you have virtually zero control over this.

The reason for this is that POV-Ray does have a set of hexagonal bokehs, 
from which it chooses depending on the blur_samples setting, but to 
"fill up" to the specified blur_samples, it just fills a 2D square with 
random samples.


Another nasty thing are the occasional non-blurred pixels among the 
blurred behind the reflective sphere. Do what you will, you just can't 
get rid of them, no matter how high you crank the focal blur settings.

The reason for this is that these are pixels where POV-Ray takes just 7 
samples, then calls it a day because they happen to be almost exactly 
the same.


Image #2 shows the same scene rendered with a modified version of beta 
38, using the following changes:

* Additional samples are not taken randomly from a square, but using a 
sequence of low-discrepancy points on a disc instead (based on a Halton 
sequence).

* The "blur_samples" keyword optionally takes two parameters, in which 
case the first one specifies a /minimum/ number of samples to take, 
regardless of confidence and variance settings; in this particular 
render, this was set to "blur_samples 20, 1000".

Note how this replaces the square-ish bokeh with a more pleasing round 
one, and also avoids the occasional non-blurred pixel.


Another thing you may notice is that in image #2 the horizon appears to 
be somewhat higher than in #1, as if the image was taken from a slightly 
different camera location. In fact, this is not far from the truth, 
because I changed yet another thing:

* When "filling up" the hard-coded bokehs with additional (sub-)random 
samples, POV-Ray makes sure not to get too close to the hard-coded 
samples or already-added samples; unfortunately, it does this by 
modifying the direction, in a way that creates a bias downwards and to 
the right. I changed this to simply pick a new (sub-)random point instead.


Post a reply to this message


Attachments:
Download 'focal_blur_test_38.png' (266 KB) Download 'focal_blur_test_38plus.png' (258 KB)

Preview of image 'focal_blur_test_38.png'
focal_blur_test_38.png

Preview of image 'focal_blur_test_38plus.png'
focal_blur_test_38plus.png


 

From: Samuel Benge
Subject: Re: Bragging on
Date: 28 Aug 2010 14:25:02
Message: <web.4c795418a0307987f151112e0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> To add to my recent brags, here's focal blur:
> ...
> Image #2 shows the same scene rendered with a modified version of beta
> 38, using the following changes:
>
> * Additional samples are not taken randomly from a square, but using a
> sequence of low-discrepancy points on a disc instead (based on a Halton
> sequence).

How did I know that was coming? It seems you've a hit major mineral deposit, and
are now pulling up some real gems.

So what's next? Improved area_light sampling? Are 3D Halton sequences possible,
and if so, could they be applied to media and possibly even pigment blurring?

Sam


Post a reply to this message

From: clipka
Subject: Re: Bragging on
Date: 28 Aug 2010 14:58:15
Message: <4c795c47$1@news.povray.org>
Am 28.08.2010 20:23, schrieb Samuel Benge:

> How did I know that was coming? It seems you've a hit major mineral deposit, and
> are now pulling up some real gems.

Yup, I'm currently diving deep into random numbers and everything that 
uses them.

> So what's next? Improved area_light sampling? Are 3D Halton sequences possible,
> and if so, could they be applied to media and possibly even pigment blurring?

I indeed had a brief look into area_light sampling in this context, but 
currently it uses a somewhat different approach which is pretty much 
unsuited for halton sequences. It might be an idea to try out a 
variance/confidence approach instead of the adaptive recursion, but I'm 
not sure whether it will win much.

Media, too, uses adaptive recursion, and in this case I'm pretty sure 
it's best left the way it is.

Pigment blurring would be an interesting idea, never thought about that. 
But it would be a new feature rather than an improvement of an existing 
one, so I'll not tacke it this time.

I'm seriously pondering the use of halton sequences for anti-aliasing 
though. Again not sure whether it's a good or bad idea, but probably 
worth a try.


Post a reply to this message

From: "Jérôme M. Berger"
Subject: Re: Bragging on
Date: 28 Aug 2010 15:57:20
Message: <4c796a20$1@news.povray.org>
Samuel Benge wrote:
> clipka <ano### [at] anonymousorg> wrote:
>> To add to my recent brags, here's focal blur:
>> ...
>> Image #2 shows the same scene rendered with a modified version of beta

>> 38, using the following changes:
>>
>> * Additional samples are not taken randomly from a square, but using a

>> sequence of low-discrepancy points on a disc instead (based on a Halto
n
>> sequence).
> 
> How did I know that was coming? It seems you've a hit major mineral dep
osit, and
> are now pulling up some real gems.
> 
> So what's next? Improved area_light sampling? Are 3D Halton sequences p
ossible,
> and if so, could they be applied to media and possibly even pigment blu
rring?
> 
	Yes, Halton sequences can be used for any dimension. However, you
might also want to look at the Sobol sequences: IIRC they are
supposed to be faster and to be less prone to clustering artifacts
than the Halton sequences.

		Jerome
-- 
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr


Post a reply to this message


Attachments:
Download 'us-ascii' (1 KB)

From: clipka
Subject: Re: Bragging on
Date: 28 Aug 2010 16:31:26
Message: <4c79721e$1@news.povray.org>
Am 28.08.2010 21:57, schrieb "Jérôme M. Berger":

> 	Yes, Halton sequences can be used for any dimension. However, you
> might also want to look at the Sobol sequences: IIRC they are
> supposed to be faster and to be less prone to clustering artifacts
> than the Halton sequences.

Speed is not much of an issue here: For most purposes, POV-Ray 
pre-computes a suitably long sequence, and re-uses it whenever needed.

But I've deliberately designed the code in such a way that it would be 
pretty easy to replace the Halton stuff with some different 
low-discrepancy sequences.


Post a reply to this message

From: clipka
Subject: Re: Bragging on
Date: 29 Aug 2010 13:00:33
Message: <4c7a9231@news.povray.org>
Showing off a patch to generate different bokehs.

The scene is essentially the same as earlier in this thread, except that 
the tiny bright sphere now has a radius of 0.01. blur_samples are set to 
100,1000, confidence 0.99, variance 1/1000.

image #1:

     bokeh {
       pigment {
         spherical
         pigment_map {
           [0.0  color rgb 0.0]
           [0.05 color rgb 1.0]
           [0.1  color rgb 0.5]
           [0.15 color rgb 0.2]
           [0.4  color rgb 0.1]
           [1.0  color rgb 0.1]
         }
         scale 0.5
         translate <0.5,0.5,0>
       }
     }

image #2:

     bokeh {
       pigment {
         spherical
         pigment_map {
           [0.0  color rgb 0.0]
           [0.1  color rgb 0.2]
           [0.2  color rgb 0.6]
           [0.5  color rgb 0.9]
           [1.0  color rgb 1.0]
         }
         scale 0.5
         translate <0.5,0.5,0>
       }
     }

image #3:

     bokeh {
       pigment {
         image_map { png "focal_blur_test_bokeh.png" }
       }
     }

image #4:

The bokeh used in image #3.

NB: Colored bokehs are not possible; only the greyscale value of the 
pigment given is evaluated.

Coordinate range is optimized for image maps: <0,0,0> to <1,1,0>.


Post a reply to this message


Attachments:
Download 'focal_blur_test_bokeh1.png' (242 KB) Download 'focal_blur_test_bokeh2.png' (234 KB) Download 'focal_blur_test_bokeh3.png' (234 KB) Download 'focal_blur_test_bokeh.png' (13 KB)

Preview of image 'focal_blur_test_bokeh1.png'
focal_blur_test_bokeh1.png

Preview of image 'focal_blur_test_bokeh2.png'
focal_blur_test_bokeh2.png

Preview of image 'focal_blur_test_bokeh3.png'
focal_blur_test_bokeh3.png

Preview of image 'focal_blur_test_bokeh.png'
focal_blur_test_bokeh.png


 

From: Thomas de Groot
Subject: Re: Bragging on
Date: 30 Aug 2010 03:05:45
Message: <4c7b5849@news.povray.org>
"clipka" <ano### [at] anonymousorg> schreef in bericht 
news:4c792cc3@news.povray.org...
> To add to my recent brags, here's focal blur:
>

I hope you will keep on bragging for a long time :-)  Some very interesting 
developments on the way!

Thomas


Post a reply to this message

From: Mike Raiford
Subject: Re: Bragging on
Date: 2 Sep 2010 09:08:34
Message: <4c7fa1d2$1@news.povray.org>
On 8/28/2010 10:35 AM, clipka wrote:

> * Additional samples are not taken randomly from a square, but using a
> sequence of low-discrepancy points on a disc instead (based on a Halton
> sequence).

Soooo ... should I build the monument to honor you, or the Halton sequence?

GREAT WORK! I'm very impressed! Can't wait to see this stuff make it 
into the betas!
-- 
~Mike


Post a reply to this message

From: Mike Raiford
Subject: Re: Bragging on
Date: 2 Sep 2010 09:12:33
Message: <4c7fa2c1$1@news.povray.org>
On 8/29/2010 12:00 PM, clipka wrote:
> Showing off a patch to generate different bokehs.

Nice!

Does it invert the aperture shape as expected if out of focus region is 
in front of or behind the focal plane?

-- 
~Mike


Post a reply to this message

From: clipka
Subject: Re: Bragging on
Date: 2 Sep 2010 09:47:11
Message: <4c7faadf$1@news.povray.org>
Am 02.09.2010 15:09, schrieb Mike Raiford:
> On 8/29/2010 12:00 PM, clipka wrote:
>> Showing off a patch to generate different bokehs.
>
> Nice!
>
> Does it invert the aperture shape as expected if out of focus region is
> in front of or behind the focal plane?

Yup. (Original POV-Ray does that, too - except that it doesn't make any 
difference there ;-))


Post a reply to this message

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