POV-Ray : Newsgroups : povray.unofficial.patches : to clip or not to clip... Server Time
14 May 2024 15:06:40 EDT (-0400)
  to clip or not to clip... (Message 1 to 7 of 7)  
From: Jaime Vives Piqueres
Subject: to clip or not to clip...
Date: 30 Mar 2005 15:48:35
Message: <424b10a3$1@news.povray.org>
Hi all:

     Being a bit upset with the ultrabright artifacts produced by focal
blur while doing some HDRI tests, and after failing to alleviate them 
with insane amounts of blur_samples, confidence and variance, I decided 
to take my first look ever to the source code....

     I was sure to be wasting my time looking at something I will not
understand, but surprisingly, I found really quickly a call to
Clip_Colour() commented out on render.cpp, inside the focal_blur()
function. I restored that line back and just compiled again... you have 
the results posted on p.b.i: both images where rendered using 35 blur 
samples.

     I think I will be using this for scenes with extreme artifacts, 
while waiting for MegaPOV 1.2... ;) (I still prefer the unclipped 
version when there are not many artifacts visible, of course).

--
Jaime


Post a reply to this message

From: Warp
Subject: Re: to clip or not to clip...
Date: 30 Mar 2005 18:04:50
Message: <424b3092@news.povray.org>
Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:
>      I think I will be using this for scenes with extreme artifacts, 
> while waiting for MegaPOV 1.2... ;) (I still prefer the unclipped 
> version when there are not many artifacts visible, of course).

  The problem is exactly the same as with antialiasing: Preclipping
will always produce nice and smooth results (which is what people
usually want) but subpixel-sized brighter-than-1 details will be more
or less lost. Postclipping behaves in the exact opposite way:
Subpixel-sized details will show up, but brighter-than-1 pixels
will have ugly aliasing artifacts.
  The former works ok in 99.9% of cases but is still not perfect.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Rune
Subject: Re: to clip or not to clip...
Date: 30 Mar 2005 18:48:55
Message: <424b3ae7$1@news.povray.org>
Warp wrote:
>  The problem is exactly the same as with antialiasing: Preclipping
> will always produce nice and smooth results (which is what people
> usually want) but subpixel-sized brighter-than-1 details will be more
> or less lost. Postclipping behaves in the exact opposite way:
> Subpixel-sized details will show up, but brighter-than-1 pixels
> will have ugly aliasing artifacts.
>  The former works ok in 99.9% of cases but is still not perfect.

I don't think it's the job of antialiasing to make tiny subpixel bright 
stars and the like show up. This is the job of some kind of glare filter 
(which however doesn't exist in official POV-Ray, but that's another issue) 
that is applied before AA. This is why I find pre-clipping for AA to be 
correct.

Focal blur on the other hand should be applied before clipping, since focal 
blur, just like glare effects, should be able to make small ultra-bright 
spots become large still-rather-bright spots. The problem with artifacts 
seem to me to only occur because AA (with clipping after the focal blur but 
before the AA) is disabled when focal blur is enabled. I see no reason why 
both can't be enabled at the same time.

Wouldn't the problem in Jaime's specific case here be solved if AA and 
traditional focal blur (that is, no pre-clipping) could be enabled at the 
same time? I'm not sure, but it sounds likely to me at least.

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Christoph Hormann
Subject: Re: to clip or not to clip...
Date: 1 Apr 2005 02:19:07
Message: <424CF6B7.371A6494@gmx.de>
Jaime Vives Piqueres schrieb:
> 
> Hi all:
> 
>      Being a bit upset with the ultrabright artifacts produced by focal
> blur while doing some HDRI tests, and after failing to alleviate them
> with insane amounts of blur_samples, confidence and variance, I decided
> to take my first look ever to the source code....
> 
>      I was sure to be wasting my time looking at something I will not
> understand, but surprisingly, I found really quickly a call to
> Clip_Colour() commented out on render.cpp, inside the focal_blur()
> function. I restored that line back and just compiled again... you have
> the results posted on p.b.i: both images where rendered using 35 blur
> samples.

As others have said this is exactly the same as with antialiasing.

Note that next MegaPOV will offer a solution to apply whatever you want
- before or after antialiasing and anything between clipping or not
clipping.

-- Christoph


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: to clip or not to clip...
Date: 1 Apr 2005 03:02:20
Message: <424d000c@news.povray.org>
Christoph Hormann wrote:
> As others have said this is exactly the same as with antialiasing.

   Yes, I know, but with focal_blur, HDRI and normals, it is really too 
ugly... there are bright pixels scattered around highlights (the size of 
them depending on the amount of blurring) that you can't avoid even 
using the best settings.

> Note that next MegaPOV will offer a solution to apply whatever you want
> - before or after antialiasing and anything between clipping or not
> clipping.

   That would be very useful... thanks in advance!

--
Jaime


Post a reply to this message

From: Slime
Subject: Re: to clip or not to clip...
Date: 3 Apr 2005 04:58:00
Message: <424fb018$1@news.povray.org>
>    Yes, I know, but with focal_blur, HDRI and normals, it is really too
> ugly... there are bright pixels scattered around highlights (the size of
> them depending on the amount of blurring) that you can't avoid even
> using the best settings.


Clipping before focal blur will have a consequence that you may not have
thought of. Have you ever seen pictures of things at night, where there are
lights in the out-of-focus background? Notice that the lights appear like
bright circles; this is because their extreme brightness outweighs the
nearby objects in the area that they blur into. If you clip before blurring,
then this won't happen and the lights won't look as bright as they are.

The proper way to do what you're trying to do, is to first separate the
focal blur from anti-aliasing. They are essentially two different
procedures, but POV-Ray mixes the two because it's convenient and faster to
do them both at once. However, to avoid the ugly effect but keep the effect
I mentioned above, you must do the clipping after focal blur and before
anti-aliasing. This will slow things down as supersampled pixels will have
to have focal blur calculated on them multiple times; but then the results,
which may be very bright, will be clipped before averaging and in the final
result even very bright areas will be nicely anti-aliased.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Rune
Subject: Re: to clip or not to clip...
Date: 3 Apr 2005 07:14:00
Message: <424fcff8@news.povray.org>
Slime wrote:
> However, to avoid the ugly effect but keep the effect I
> mentioned above, you must do the clipping after focal
> blur and before anti-aliasing.

I agree. This is essentially exactly the point I was trying to make too.

Rune
-- 
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

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