POV-Ray : Newsgroups : povray.beta-test : Problem with new focal blur noise pattern and animations Server Time
28 Jun 2024 11:26:36 EDT (-0400)
  Problem with new focal blur noise pattern and animations (Message 6 to 15 of 15)  
<<< Previous 5 Messages Goto Initial 10 Messages
From: Tek
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 11 Nov 2010 06:40:00
Message: <web.4cdbd50651977b7ecaa39c860@news.povray.org>
Le_Forgeron <jgr### [at] freefr> wrote:
> For 3.7beta, you might have a look at the bokeh setting to vary the sampling
>
> http://wiki.povray.org/content/Documentation:Reference_Section_3
>
> Using a moving pattern of your choice for the distribution of the
> samples grid.

Good idea, but sometimes it still samples the same points (particularly with
very low numbers of samples).


Post a reply to this message

From: Tek
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 11 Nov 2010 10:15:00
Message: <web.4cdc075a51977b7ecaa39c860@news.povray.org>
"Tek" <tek### [at] evilsuperbraincom> wrote:
> Le_Forgeron <jgr### [at] freefr> wrote:
> > For 3.7beta, you might have a look at the bokeh setting to vary the sampling
> >
> > http://wiki.povray.org/content/Documentation:Reference_Section_3
> >
> > Using a moving pattern of your choice for the distribution of the
> > samples grid.
>
> Good idea, but sometimes it still samples the same points (particularly with
> very low numbers of samples).

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 an understandable limitation of the bokeh filter implementation, but it
limits my ability to use it to randomize blur samples.

Anyway, for the time being I don't really need high quality focal blur in an
animation, and if I do I can just use more blur_samples to brute-force it. But
it would be nice if someone could take a look at the code to fix these niggles.


Post a reply to this message

From: clipka
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 11 Nov 2010 12:24:44
Message: <4cdc26dc$1@news.povray.org>
Am 10.11.2010 14:42, schrieb Tek:
> It seems like the "random" samples for focal blur are now the same on every
> frame of an animation. Is there any way to randomize it per frame?
>
> I don't mind a bit of noise but if it's not moving it looks like I'm viewing the
> scene through a distorted pane of glass. I'm pretty sure it didn't used to have
> this problem (though admittedly I don't often use blur in animations).

Using the very same focal blur sample sequence for all frames of an 
animation is by design, not by error; I'm pretty sure both earlier 3.7 
betas and 3.6 did the same (they used a pseudo-RNG instead of a Halton 
sequence, but unless I'm totally mistaken they started the PRNG all over 
again with the very same seed for each frame). There appears to be 
consensus among the POV-Ray animators that static noise should be 
favored over dynamic noise.


Post a reply to this message

From: Warp
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 11 Nov 2010 12:58:25
Message: <4cdc2ec1@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Using the very same focal blur sample sequence for all frames of an 
> animation is by design, not by error; I'm pretty sure both earlier 3.7 
> betas and 3.6 did the same (they used a pseudo-RNG instead of a Halton 
> sequence, but unless I'm totally mistaken they started the PRNG all over 
> again with the very same seed for each frame). There appears to be 
> consensus among the POV-Ray animators that static noise should be 
> favored over dynamic noise.

  How hard would it be to make it optional?

-- 
                                                          - Warp


Post a reply to this message

From: Tek
Subject: Re: Problem with new focal blur noise pattern and animations
Date: 11 Nov 2010 13:10:01
Message: <web.4cdc315551977b7ecaa39c860@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
>
> There appears to be
> consensus among the POV-Ray animators that static noise should be
> favored over dynamic noise.

Is there? Can you point me to some discussion of this topic, since I strongly
disagree.

Noise that remains static in screen space when everything else is moving draws
attention to itself. Conversely, animated noise can look quite realistic
provided you have a high enough number of samples for it to pass for film-grain,
and if you don't have enough samples it's going to look bad either way.

Obviously there's no "right" answer to which is the best error (they're both
wrong!), but it would be really nice to have the ability to set the random seed
for the focal blur so I can chose if it changes or not.

Incidentally, I'm pretty sure Pixar use animated noise... though I've failed to
Google a reference for that.


Post a reply to this message

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 5 Messages Goto Initial 10 Messages

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