POV-Ray : Newsgroups : povray.general : idea for an alternate type of focal blur Server Time
31 Jul 2024 10:26:30 EDT (-0400)
  idea for an alternate type of focal blur (Message 13 to 22 of 22)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Fa3ien
Subject: Re: idea for an alternate type of focal blur
Date: 21 Sep 2007 14:40:40
Message: <46f41028@news.povray.org>


> I've noticed quite a few people who use focal blur regularly say they just
> don't bother with AA - the focal blur does the job for them. Not quite what
> you're asking but it does bring potential render times down a little!

In fact, even if you turn AA on, it is unlikely that it will be used in 
highly blurred areas, since (with enough samples) the variance between
two neighbouring pixels is often to low to reach the AA threshold.

So, POV-Ray doesn't really multiply render times.  However, a more
global approach of "oversampling" features would be smart, of course.

(BTW, I think that texture-level antialiasing could be rather easy
  to implement, if only I had any knowledge of C++, sigh... but I can
  explain how to do it, if anyone is interested)

Fabien.


Post a reply to this message

From: Alain
Subject: Re: idea for an alternate type of focal blur
Date: 21 Sep 2007 15:08:38
Message: <46f416b6$1@news.povray.org>
Warp nous apporta ses lumieres en ce 2007/09/21 11:22:
> Alain <ele### [at] netscapenet> wrote:
>> Actualy, POV-Ray don't allow focal blur and AA in the same render.
> 
>   3.7 does.
> 
OK. Never tested aa with focal blur in 3.7.

-- 
Alain
-------------------------------------------------
Fundamentalism: If shit happens to a televangelist, it's okay.


Post a reply to this message

From: John VanSickle
Subject: Re: idea for an alternate type of focal blur
Date: 21 Sep 2007 18:23:07
Message: <46f4444b$1@news.povray.org>
Kenneth wrote:
> John VanSickle <evi### [at] hotmailcom> wrote:
> 
> 
>>http://graphics.pixar.com has a paper on combining focal blur,
>>anti-aliasing, motion blur, specular highlighting, area lights, and
>>blurred transparency into one feature.  To improve the quality of any of
>>these, one merely increases the anti-aliasing level.
> 
> 
> Thanks for reminding me of this link; I had seen it recently in another news
> thread comment (probably from you!) but hadn't looked at it carefully.
> 
>>The way POV-Ray handles this now is rather cumbersome.  If I set 4x4
>>anti-aliasing, and uses a 4x4 area light, the area light is fully
>>sampled for each sample of the spatial anti-aliasing, and if I throw in
>>10x oversampling for motion blur, then the scene takes 2560 times as
>>long as a scene with no area lights, anti-aliasing, or motion blur.
> 
> 
> OW!  That hurts.
> 
> Thanks for the reply; your explanation of the PIXAR method is fascinating.
> Think a similar methodolgy could make it into POV?

The caveat is that in the Pixar paper, for each ray traced from the 
viewpoint, only one shadow ray is shot per light source, and only one 
reflective ray and one transparent ray gets shot.

The shadow ray is shot to some random point on the surface of the 
light_source; this neatly simulates an area light of any size or shape, 
and even one with different colors across its face.

The reflected ray can be given the strict reflection used in POV-Ray for 
a smooth reflection, or its direction can be jittered to simulate a 
blurred reflection.

Transparency can be calculated directly from the laws of refraction, or 
the refracted ray can be jittered in order to simulate a translucent 
interior.

Motion blur is set by selecting a random time within the time slice that 
represents the duration of the frame, and positioning everything 
according to that precise time for that ray shot.  There are tricks to 
prevent a complete re-parsing of the entire shot for this, and there are 
shortcuts that trade unneeded precision for speed.

Focal blur is done by selecting a focal point and then moving the origin 
of the ray by a random amount for each camera ray.

With the AA level set to 1x1, the results will be a very grainy image 
where these features are in force, but as the AA level climbs, the grain 
gets averaged out.  There are sampling methods that can reduce the 
graininess as well.  The paper reports that they seldom need more than 
64 samples per screen pixel.

The present POV-Ray method can involve an insane amount of rays shot, 
and the payoff is not necessarily cost-effective, because the 10x10 area 
light, necessary to make the shadows smooth, and the 4x4 spatial 
anti-aliasing necessary to remove the jaggies, multiply together to 
create 1600 shadow rays per pixel, which is probably overkill.

Regards,
John


Post a reply to this message

From: Kenneth
Subject: Re: idea for an alternate type of focal blur
Date: 22 Sep 2007 03:30:01
Message: <web.46f4c35a56160c324b0f8d440@news.povray.org>
"Bill Pragnell" <bil### [at] hotmailcom> wrote:

>
> My personal experience of focal blur is not extensive, but what you describe
> was my goal in this image:
>
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.4669ae9cb060a40a7e595fbb0%40news.povray.org%3E/
>
> The background (the object in focus - the brick structure) is not exactly an
> infinite expanse, but it certainly occupies most of the scene's depth. Is
> this the kind of thing you meant?

YES INDEED! That's exactly what I see in my mind's eye. (BTW, a *beautiful*
image there, Bill.) I'll assume you used the technique described earlier,
of setting the sharp-focus-plane far off into the distance.  I'm quite
amazed that it turned out so well, that all the bricks are in sharp focus
while just the girl is nicely blurred. I'm curious if you had to "cheat"
her closer to the camera and scaled down, to get such a nice effect. If
not, then I'm doubly amazed. I see now that POV's current blur type will do
what I want. Many thanks for the example.

KW


Post a reply to this message

From: Zeger Knaepen
Subject: Re: idea for an alternate type of focal blur
Date: 22 Sep 2007 06:21:58
Message: <46f4ecc6$1@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote in message 
news:web.46f4c35a56160c324b0f8d440@news.povray.org...
>  I'm curious if you had to "cheat"
> her closer to the camera and scaled down, to get such a nice effect.

That wouldn't be cheating, it would be an accurate reproduction of what the 
scene would be in reality.

Point is: if you design the scene accurately, you'll get realistic results.

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


Post a reply to this message

From: Bill Pragnell
Subject: Re: idea for an alternate type of focal blur
Date: 22 Sep 2007 07:10:01
Message: <web.46f4f7ae56160c323ec8e3820@news.povray.org>
"Zeger Knaepen" <zeg### [at] povplacecom> wrote:
> "Kenneth" <kdw### [at] earthlinknet> wrote in message
> news:web.46f4c35a56160c324b0f8d440@news.povray.org...
> >  I'm curious if you had to "cheat"
> > her closer to the camera and scaled down, to get such a nice effect.
>
> That wouldn't be cheating, it would be an accurate reproduction of what the
> scene would be in reality.

The scene is actually my cgsphere entry:

http://www.cgsphere.com/gallery/details/?submission_id=3254

All I did was move the camera to floor level behind the girl, still pointing
at the centre of the sphere. The blur focal point was also set to the
sphere's centre. I tweaked the aperture a little to get the effect I
wanted, but I think I only needed a couple of test renders - it basically
worked right away.

If you look closely at the blurred version, you'll notice that some of the
bricks in the foreground are also slightly blurred, but not nearly as much
as the girl.

Bill


Post a reply to this message

From: Alain
Subject: Re: idea for an alternate type of focal blur
Date: 22 Sep 2007 11:35:44
Message: <46f53650$1@news.povray.org>
John VanSickle nous apporta ses lumieres en ce 2007/09/21 18:23:
> Kenneth wrote:
>> John VanSickle <evi### [at] hotmailcom> wrote:
>>
>>
>>> http://graphics.pixar.com has a paper on combining focal blur,
>>> anti-aliasing, motion blur, specular highlighting, area lights, and
>>> blurred transparency into one feature.  To improve the quality of any of
>>> these, one merely increases the anti-aliasing level.
>>
>>
>> Thanks for reminding me of this link; I had seen it recently in 
>> another news
>> thread comment (probably from you!) but hadn't looked at it carefully.
>>
>>> The way POV-Ray handles this now is rather cumbersome.  If I set 4x4
>>> anti-aliasing, and uses a 4x4 area light, the area light is fully
>>> sampled for each sample of the spatial anti-aliasing, and if I throw in
>>> 10x oversampling for motion blur, then the scene takes 2560 times as
>>> long as a scene with no area lights, anti-aliasing, or motion blur.
>>
>>
>> OW!  That hurts.
>>
>> Thanks for the reply; your explanation of the PIXAR method is 
>> fascinating.
>> Think a similar methodolgy could make it into POV?
> 
> The caveat is that in the Pixar paper, for each ray traced from the 
> viewpoint, only one shadow ray is shot per light source, and only one 
> reflective ray and one transparent ray gets shot.
> 
> The shadow ray is shot to some random point on the surface of the 
> light_source; this neatly simulates an area light of any size or shape, 
> and even one with different colors across its face.
> 
> The reflected ray can be given the strict reflection used in POV-Ray for 
> a smooth reflection, or its direction can be jittered to simulate a 
> blurred reflection.
> 
> Transparency can be calculated directly from the laws of refraction, or 
> the refracted ray can be jittered in order to simulate a translucent 
> interior.
> 
> Motion blur is set by selecting a random time within the time slice that 
> represents the duration of the frame, and positioning everything 
> according to that precise time for that ray shot.  There are tricks to 
> prevent a complete re-parsing of the entire shot for this, and there are 
> shortcuts that trade unneeded precision for speed.
> 
> Focal blur is done by selecting a focal point and then moving the origin 
> of the ray by a random amount for each camera ray.
> 
> With the AA level set to 1x1, the results will be a very grainy image 
> where these features are in force, but as the AA level climbs, the grain 
> gets averaged out.  There are sampling methods that can reduce the 
> graininess as well.  The paper reports that they seldom need more than 
> 64 samples per screen pixel.
> 
> The present POV-Ray method can involve an insane amount of rays shot, 
> and the payoff is not necessarily cost-effective, because the 10x10 area 
> light, necessary to make the shadows smooth, and the 4x4 spatial 
> anti-aliasing necessary to remove the jaggies, multiply together to 
> create 1600 shadow rays per pixel, which is probably overkill.
> 
> Regards,
> John
That's why you have adaptive area_light and aa sampling (methode 2 or +am2). 
It's also why the camera with focal blur always use an adaptive sampling.
This area_light will render faster than a 10x10 without adaptive:
light_source{10 rgb 1 area_light 2*z,2*x 17,17 adaptive 1 circular orient jitter}
It also gives you smoother shadows. With adaptive, 65x65 is still prety fast, 
even 129x129 is fast...

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you even think about using Povray 
for writing letters.
Sven Rudolph (Germany)


Post a reply to this message

From: Warp
Subject: Re: idea for an alternate type of focal blur
Date: 22 Sep 2007 15:23:27
Message: <46f56bae@news.povray.org>
John VanSickle <evi### [at] hotmailcom> wrote:
> The shadow ray is shot to some random point on the surface of the 
> light_source;
[...]
> The reflected ray can be given the strict reflection used in POV-Ray for 
> a smooth reflection, or its direction can be jittered to simulate a 
> blurred reflection.

> Transparency can be calculated directly from the laws of refraction, or 
> the refracted ray can be jittered in order to simulate a translucent 
> interior.

> Motion blur is set by selecting a random time within the time slice that 
> represents the duration of the frame, and positioning everything 
> according to that precise time for that ray shot.
[...]
> Focal blur is done by selecting a focal point and then moving the origin 
> of the ray by a random amount for each camera ray.

> With the AA level set to 1x1, the results will be a very grainy image 
> where these features are in force, but as the AA level climbs, the grain 
> gets averaged out.  There are sampling methods that can reduce the 
> graininess as well.  The paper reports that they seldom need more than 
> 64 samples per screen pixel.

  While that idea is certainly interesting, I see one big problem with it:

  If you have reflective+refractive objects which are very slow to render
(because of all the numerous rays reflecting and refracting and thus
doubling at each intersection point, as is very normal eg. with clear
glass objects), using the AA of 64 samples per pixel will make the
rendering of those objects *very* slow.
  The default antialiasing of POV-Ray (method 1 with default settings)
uses at most 9 rays per pixel, which keeps the rendering times of
such objects bearable. I can only imagine how much it will slow down
if instead 64 rays per pixel are shot.

  My guess is that Pixar mostly avoids having such objects in their
scenes, and mostly use reflective-only and refractive-only objects,
seldom both at the same time (except if the scene *really* requires it).

-- 
                                                          - Warp


Post a reply to this message

From: Kenneth
Subject: Re: idea for an alternate type of focal blur
Date: 24 Sep 2007 15:15:00
Message: <web.46f80bca56160c32f16fbbd90@news.povray.org>
"Zeger Knaepen" <zeg### [at] povplacecom> wrote:
> "Kenneth" <kdw### [at] earthlinknet> wrote in message
> news:web.46f4c35a56160c324b0f8d440@news.povray.org...
> >  I'm curious if you had to "cheat"
> > her closer to the camera and scaled down, to get such a nice effect.
>
> That wouldn't be cheating, it would be an accurate reproduction of what the
> scene would be in reality.
>
> Point is: if you design the scene accurately, you'll get realistic results.
>

True, of course; but the image from cgsphere.com that Bill linked to
(thanks, Bill!) does show that the girl *is* quite small compared to the
brick sphere--that is, smaller than she *appears* to be in Bill's first
image. Nothing wrong with that; it just shows me what I might need to do to
get the result I'm after: positioning and scaling my foreground objects (if
necessary) to produce the desired blurring, while appearing to be in the
'correct' scale, relative to the other scene elements.

KW


Post a reply to this message

From: Alain
Subject: Re: idea for an alternate type of focal blur
Date: 24 Sep 2007 16:29:51
Message: <46f81e3f@news.povray.org>
Kenneth nous apporta ses lumieres en ce 2007/09/24 15:11:
> "Zeger Knaepen" <zeg### [at] povplacecom> wrote:
>> "Kenneth" <kdw### [at] earthlinknet> wrote in message
>> news:web.46f4c35a56160c324b0f8d440@news.povray.org...
>>>  I'm curious if you had to "cheat"
>>> her closer to the camera and scaled down, to get such a nice effect.
>> That wouldn't be cheating, it would be an accurate reproduction of what the
>> scene would be in reality.
>>
>> Point is: if you design the scene accurately, you'll get realistic results.
>>
> 
> True, of course; but the image from cgsphere.com that Bill linked to
> (thanks, Bill!) does show that the girl *is* quite small compared to the
> brick sphere--that is, smaller than she *appears* to be in Bill's first
> image. Nothing wrong with that; it just shows me what I might need to do to
> get the result I'm after: positioning and scaling my foreground objects (if
> necessary) to produce the desired blurring, while appearing to be in the
> 'correct' scale, relative to the other scene elements.
> 
> KW
> 
> 
The girl is small relative to the sphere. In the CGSphere, the camera is set at 
a relatively large distance in front of the sphere. The girl is at about the 
same distance from the camera as the sphere.
The the second case, the camera is close to the ground and just behind the girl. 
The girl is now very much closer to the camera than the sphere. That point of 
view make the girl apears much larger.

-- 
Alain
-------------------------------------------------
To err is human, to forgive is not our policy.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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