POV-Ray : Newsgroups : povray.beta-test : Problem with new focal blur noise pattern and animations Server Time
28 Jun 2024 11:26:37 EDT (-0400)
  Problem with new focal blur noise pattern and animations (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: clipka
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 11 Nov 2010 14:39:40
Message: <4cdc467c$1@news.povray.org>
Am 11.11.2010 16:10, schrieb Tek:

> After some testing I'm getting the impression that the bokeh filter isn't
> strictly applied. I'm getting square shapes when using a bokeh which is mostly
> black, as if the algorithm gives up after a few tries and just uses the sample
> anyway. Indeed, using a completely black bokeh filter doesn't cause any error
> and I still have blur.

This is indeed the case; the design of the algorithm was subject to the 
following constraints:

* allow the use of an arbitrary user-specified bokeh (as opposed to a 
set of hard-coded bokehs)

* allow the use of POV-Ray's pattern mechanism (as opposed to requiring 
an image file)

* produce the same output image brightness regardless of the bokeh 
pattern's average brightness (for instance a circular black-and-white 
"mask" would typically have an overall brightness of pi/4, while a 
regular hexagonal one might have an overall brightness of 3*sqrt(3)/8)

* use importance sampling to get more quality out of a given number of 
samples

All in all this calls for a monte-carlo approach at choosing sampling 
points, with some variation to make it robust against pathological cases 
- not only the (impossible-to-detect) case of an all-black bokeh 
pattern, but also e.g. an almost-all-black pattern where the combined 
choice of sample-candidate stream (in this case 2D Halton) and monte 
carlo pseudo-RNG happens to never find a suitable sample.

The current solution to the robustness issue is to monitor how well the 
algorithm is getting along at choosing samples, and adaptively brighten 
up the pattern a bit.


> This is an understandable limitation of the bokeh filter implementation, but it
> limits my ability to use it to randomize blur samples.

Not really: Any pattern utilizing high-frequency random noise with an 
overall brightness around 0.5 (in the regions that should be part of the 
bokeh) should do the trick; for instance, randomly-chosen slices of a 
scaled-down "bumps" pattern should do (modulated of course by the 
pattern you really want to achieve).


Post a reply to this message

From: Tek
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 12 Nov 2010 05:40:01
Message: <web.4cdd189351977b7ecaa39c860@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
>
> Not really: Any pattern utilizing high-frequency random noise with an
> overall brightness around 0.5 (in the regions that should be part of the
> bokeh) should do the trick; for instance, randomly-chosen slices of a
> scaled-down "bumps" pattern should do (modulated of course by the
> pattern you really want to achieve).

I tried that first, the problem was that 50% of the samples would work. I want
to generate (at least) 10 unique variations of the sampling pattern, but if I
have a noise pattern that's 50% white and 50% black then there's a 50/50 chance
that any given sample will succeed first time (and a 25% chance it will succeed
2nd time, and so on until we hit the limit of the number of attempts it makes).
So over the frames I want to blur together 50% of the samples will be the
identical 1st attempt, which creates extremely visible noise no matter how
random the remaining 50% are.

Quite simply, I have no way to guarantee, or even to make it likely, that pixels
on the next frame will use a different blur sample to this frame.

All of which can be fixed by a random seed I can set myself.


Post a reply to this message

From: Le Forgeron
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 12 Nov 2010 08:46:16
Message: <4cdd4528$1@news.povray.org>
Le 12/11/2010 11:36, Tek a écrit :

> Quite simply, I have no way to guarantee, or even to make it likely, that pixels
> on the next frame will use a different blur sample to this frame.
> 

If you use a deterministic pattern (whatever it be, with high contrast
area in <0,0><1,1>...) then from frame to frame, you can rotate and
translate it as your seed wants to govern it. you might for instance use
a checkered b&w, scaled to 1/10 (so that's potentially 50 spots out of
100), rotated on the plane by a random value (your choice of seed),
translated randomly...


Post a reply to this message

From: Tek
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 12 Nov 2010 09:25:01
Message: <web.4cdd4d1c51977b7ecaa39c860@news.povray.org>
Le_Forgeron <lef### [at] freefr> wrote:
> Le 12/11/2010 11:36, Tek a écrit :
>
> > Quite simply, I have no way to guarantee, or even to make it likely, that pixels
> > on the next frame will use a different blur sample to this frame.
> >
>
> If you use a deterministic pattern (whatever it be, with high contrast
> area in <0,0><1,1>...) then from frame to frame, you can rotate and
> translate it as your seed wants to govern it. you might for instance use
> a checkered b&w, scaled to 1/10 (so that's potentially 50 spots out of
> 100), rotated on the plane by a random value (your choice of seed),
> translated randomly...

I'm pretty sure that's what I just said.

e.g. I sample the bokeh filter for a pixel this frame and it hits a white bit,
so the sample goes through in that position. On the next frame I try to sample
the exact same position (because the halton sequence is the same), but I've
animated the bokeh pattern so there's a 50% chance it will hit white again. If
it does then the sample is in the same position, not animated.

So 50% of the noise from one frame to the next will be identical, not random. Am
I missing something?


Post a reply to this message

From: MDenham
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 12 Nov 2010 09:35:00
Message: <web.4cdd509051977b7e99c9d0770@news.povray.org>
"Tek" <tek### [at] evilsuperbraincom> wrote:
> Le_Forgeron <lef### [at] freefr> wrote:
> > Le 12/11/2010 11:36, Tek a écrit :
> >
> > > Quite simply, I have no way to guarantee, or even to make it likely, that pixels
> > > on the next frame will use a different blur sample to this frame.
> > >
> >
> > If you use a deterministic pattern (whatever it be, with high contrast
> > area in <0,0><1,1>...) then from frame to frame, you can rotate and
> > translate it as your seed wants to govern it. you might for instance use
> > a checkered b&w, scaled to 1/10 (so that's potentially 50 spots out of
> > 100), rotated on the plane by a random value (your choice of seed),
> > translated randomly...
>
> I'm pretty sure that's what I just said.
>
> e.g. I sample the bokeh filter for a pixel this frame and it hits a white bit,
> so the sample goes through in that position. On the next frame I try to sample
> the exact same position (because the halton sequence is the same), but I've
> animated the bokeh pattern so there's a 50% chance it will hit white again. If
> it does then the sample is in the same position, not animated.
>
> So 50% of the noise from one frame to the next will be identical, not random. Am
> I missing something?

So basically you want a pattern with ~50% average brightness that's guaranteed
to be black in spots that haven't been sampled in the last N frames?

That's...  possible, but ugly.  You'd need to look at the source to determine
the primes being used for the Halton sequence in question, then design your
pattern around that.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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