POV-Ray : Newsgroups : povray.binaries.images : Antialiasing problems (3 images, 11k,15k,12k) Server Time
12 Aug 2024 01:27:08 EDT (-0400)
  Antialiasing problems (3 images, 11k,15k,12k) (Message 11 to 20 of 29)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 9 Messages >>>
From: Tek
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 12 Jan 2004 22:57:36
Message: <40036cb0@news.povray.org>
It depends on what you're trying to emulate. If you want anti-aliasing simply to
make it look like you started with a higher res image and reduced it, then the
way pov does it is fine. But if you want it to simulate photography then it
should combine all it's samples before clipping them. You could avoid
over-bright objects getting jagged edges by using more samples (the
anti-aliasing threshold would mean these extra samples only got used on those
high-contrast areas).

-- 
Tek
www.evilsuperbrain.com

"Slime" <fak### [at] emailaddress> wrote in message news:40034b23$1@news.povray.org...
> > Unfortunately, POV clips the colors before it combines them, rather than
> > afterward...to antialiasing, rgb 20 is the same as rgb 1.
>
> You mean fortunately. POV-Ray does this in the mathematically correct way.
> Antialiasing is a method of making an image with finite resolution appear as
> though it has infinite resolution. If POV-Ray did not do it this way, then
> extremly bright objects which are *large* (such as a sphere with color rgb
> 20) would look very aliased.
>
> Clipping after anti-aliasing would cause anti-aliasing to be useful only in
> situations where colors were not oversaturated. Just because the alternative
> would produce a specific effect in a specific situation doesn't mean that
> it's desirable.
>
>  - Slime
>  [ http://www.slimeland.com/ ]
>
>


Post a reply to this message

From: Slime
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 12 Jan 2004 23:27:59
Message: <400373cf@news.povray.org>
> You could avoid
> over-bright objects getting jagged edges by using more samples (the
> anti-aliasing threshold would mean these extra samples only got used on
those
> high-contrast areas).

If 1/9 of a pixel has the color rgb 10000, and the rest of the pixel has
other colors between 0 and 1, and clipping happens after anti-aliasing, then
the pixel is going to be 1/9 * 10000 + 8/9 * (something between 0 and 1),
which works out to be well over 1, causing the entire pixel to be
oversaturated. More samples just causes this calculation to be more
accurate, but still well over 1. If this happens at every pixel along the
edge of an object, it will look pixellated.

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


Post a reply to this message

From: Christopher James Huff
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 13 Jan 2004 07:55:10
Message: <cjameshuff-ADDABB.07552613012004@netplex.aussie.org>
In article <40034b23$1@news.povray.org>, "Slime" <fak### [at] emailaddress> 
wrote:

> > Unfortunately, POV clips the colors before it combines them, rather than
> > afterward...to antialiasing, rgb 20 is the same as rgb 1.
> 
> You mean fortunately. POV-Ray does this in the mathematically correct way.
> Antialiasing is a method of making an image with finite resolution appear as
> though it has infinite resolution. If POV-Ray did not do it this way, then
> extremly bright objects which are *large* (such as a sphere with color rgb
> 20) would look very aliased.

No, do I mean unfortunately. Clipping before antialiasing is the wrong 
way to fix this problem. Small, intense sources get completely wiped 
out. Antialiasing supersamples the scene, not some virtual model of an 
image file in a format that's limited to a tiny dynamic range.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

From: Slime
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 13 Jan 2004 10:07:56
Message: <400409cc$1@news.povray.org>
> No, do I mean unfortunately. Clipping before antialiasing is the wrong
> way to fix this problem. Small, intense sources get completely wiped
> out.

Because they're too small to be accurately represented in the final image
resolution. Just because they're intense doesn't mean they should become a
full pixel in size. This could end up producing different results depending
on what the final resolution is.

> Antialiasing supersamples the scene, not some virtual model of an
> image file in a format that's limited to a tiny dynamic range.

Antialiasing supersamples the scene, but it must take into account that the
final output will have limitations such as a finite dynamic range. The
mysterious "format" you refer to is the same as the actual format of the
final image, which is important. By clipping before averaging, anti-aliasing
produces the effect of rendering at an infinite resolution and then resizing
smaller, which is exactly what it's supposed to do.

I admit that I do see some logic in your argument - clipping before
averaging does feel artificial to some extent. However, the fact that
clipping after averaging would produce jagged edges on bright objects causes
me to believe that it would be much more useless than clipping before
averaging.

In any case, I'd appreciate if someone who's done a significant amount of
research on the topic could step in and tell us *why* POV-Ray does it the
way it does, and maybe what other popular 3D apps do, and why it is or is
not correct.

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


Post a reply to this message

From: Tek
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 13 Jan 2004 11:02:43
Message: <400416a3$1@news.povray.org>
Oh yes, I see what you mean.
Still my digital camera tends to pick up jagged edges on bright things... :)

-- 
Tek
www.evilsuperbrain.com

"Slime" <fak### [at] emailaddress> wrote in message news:400373cf@news.povray.org...
> > You could avoid
> > over-bright objects getting jagged edges by using more samples (the
> > anti-aliasing threshold would mean these extra samples only got used on
> those
> > high-contrast areas).
>
> If 1/9 of a pixel has the color rgb 10000, and the rest of the pixel has
> other colors between 0 and 1, and clipping happens after anti-aliasing, then
> the pixel is going to be 1/9 * 10000 + 8/9 * (something between 0 and 1),
> which works out to be well over 1, causing the entire pixel to be
> oversaturated. More samples just causes this calculation to be more
> accurate, but still well over 1. If this happens at every pixel along the
> edge of an object, it will look pixellated.
>
>  - Slime
>  [ http://www.slimeland.com/ ]
>
>


Post a reply to this message

From: Tim Cook
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 13 Jan 2004 11:07:36
Message: <400417c8$1@news.povray.org>
Slime wrote:
> Just because they're intense doesn't mean they should become a
> full pixel in size.

Sure it does.  If a sun-sized star is a million times farther from
Earth than the sun, but a hundred million times brighter, it would
be visible during the day, even though it is otherwise too small to
be seen.


Post a reply to this message

From: Tek
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 13 Jan 2004 11:07:54
Message: <400417da$1@news.povray.org>
> Because they're too small to be accurately represented in the final image
> resolution. Just because they're intense doesn't mean they should become a
> full pixel in size. This could end up producing different results depending
> on what the final resolution is.

But what about if you take a photo of the night sky? The stars are much smaller
than 1 pixel, however they show up because of their intensity.

The colour of a pixel should be the average colour across the area of that
pixel, so if you have a star that's 1/2000th the area of the pixel and has
intensity 1000, then the pixel should have a colour of rgb 0.5. This happens in
a camera because it takes theoretically infinite samples (i.e. all the photons
hitting that pixel contribute to the brightness).

I believe that's the effect Bob was trying to simulate.

-- 
Tek
www.evilsuperbrain.com

"Slime" <fak### [at] emailaddress> wrote in message news:400409cc$1@news.povray.org...
> > No, do I mean unfortunately. Clipping before antialiasing is the wrong
> > way to fix this problem. Small, intense sources get completely wiped
> > out.
>
> Because they're too small to be accurately represented in the final image
> resolution. Just because they're intense doesn't mean they should become a
> full pixel in size. This could end up producing different results depending
> on what the final resolution is.
>
> > Antialiasing supersamples the scene, not some virtual model of an
> > image file in a format that's limited to a tiny dynamic range.
>
> Antialiasing supersamples the scene, but it must take into account that the
> final output will have limitations such as a finite dynamic range. The
> mysterious "format" you refer to is the same as the actual format of the
> final image, which is important. By clipping before averaging, anti-aliasing
> produces the effect of rendering at an infinite resolution and then resizing
> smaller, which is exactly what it's supposed to do.
>
> I admit that I do see some logic in your argument - clipping before
> averaging does feel artificial to some extent. However, the fact that
> clipping after averaging would produce jagged edges on bright objects causes
> me to believe that it would be much more useless than clipping before
> averaging.
>
> In any case, I'd appreciate if someone who's done a significant amount of
> research on the topic could step in and tell us *why* POV-Ray does it the
> way it does, and maybe what other popular 3D apps do, and why it is or is
> not correct.
>
>  - Slime
>  [ http://www.slimeland.com/ ]
>
>


Post a reply to this message

From: Christoph Hormann
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 13 Jan 2004 13:22:03
Message: <mgpdd1-f9b.ln1@triton.imagico.de>
Christopher James Huff wrote:
>
>>You mean fortunately. POV-Ray does this in the mathematically correct way.
>>Antialiasing is a method of making an image with finite resolution appear as
>>though it has infinite resolution. If POV-Ray did not do it this way, then
>>extremly bright objects which are *large* (such as a sphere with color rgb
>>20) would look very aliased.
> 
> 
> No, do I mean unfortunately. Clipping before antialiasing is the wrong 
> way to fix this problem. Small, intense sources get completely wiped 
> out. Antialiasing supersamples the scene, not some virtual model of an 
> image file in a format that's limited to a tiny dynamic range.
> 

I tend to agree with you but the whole thing is not that easy.  What 
antialiasing does is to try to approximate the integration over the 
pixel area by taking several samples.

But the problem is if it is correct to do the averaging of the samples 
(which is the approximation of the integral with a sum) with or without 
the non-linearities of the tone-mapping used (in case of standard POV 
this is gamma correction and clipping).

You can't really answer this from looking how it works in real life - 
when you take a photograph of a star the ideal camera outside the earth 
atmosphere in ideal empty space will only show an infinitely small 
point.  Of course nothing is ideal so the result will be a spot of 
finite size (with the intensity diminishing from the center to the rim). 
but how exactly the non-linearities of the film exposure work here is 
hard to tell (meaning it would be difficult to predict how bright two 
stars very close to each other will look from the appearance of them a 
distance apart).

Coming back to the actual antialiasing problem - in cases like this it 
would be quite nice to antialias before clipping, in relation with the 
high dynamic range output in next megapov this will be possible as well. 
  But there are also situations where this causes problems, see for 
example the wall edge on the right in:

http://www-public.tu-bs.de:8080/%7Ey0013390/pov/pool/chpool.jpg

where despite antialiasing the stairstep effects are quite strong which 
is to some extent caused by the tone mappping being applied after 
antialiasing.

An idea i had thought of to solve this problem (without the necessity to 
accept clipped output) was to make the tone mapping function (or an 
approximation of it) available to POV (for example as a user defined 
function) and to apply this function before the averaging of samples. 
To get back to the linear result afterwards you would need the inverse 
of this function of course (it needs to be invertible so you should not 
use hard clipping).

I don't know how useful such a feature would be but it would allow to 
adjust continuously between the two extemes.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 11 Jan. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Tek
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 13 Jan 2004 13:43:28
Message: <40043c50@news.povray.org>
> You can't really answer this from looking how it works in real life -
> when you take a photograph of a star the ideal camera outside the earth
> atmosphere in ideal empty space will only show an infinitely small
> point.

Well I was thinking of a digital camera, which works by having a grid of colour
sensors that effectively just add together the brightness due to all photons
falling upon that pixel. Surely with that a very small point would always be 1
pixel in size and have a brightness proportional to it's brightness multiplied
by how much of the area of the pixel it covers.

I'm not sure how all that corresponds to gamma ramps and such, but digital
cameras tend to get sharp images without aliasing, so surely that can be used as
a model for an anti-aliasing technique?

-- 
Tek
www.evilsuperbrain.com

"Christoph Hormann" <chr### [at] gmxde> wrote in message
news:mgp### [at] tritonimagicode...
> Christopher James Huff wrote:
> >
> >>You mean fortunately. POV-Ray does this in the mathematically correct way.
> >>Antialiasing is a method of making an image with finite resolution appear as
> >>though it has infinite resolution. If POV-Ray did not do it this way, then
> >>extremly bright objects which are *large* (such as a sphere with color rgb
> >>20) would look very aliased.
> >
> >
> > No, do I mean unfortunately. Clipping before antialiasing is the wrong
> > way to fix this problem. Small, intense sources get completely wiped
> > out. Antialiasing supersamples the scene, not some virtual model of an
> > image file in a format that's limited to a tiny dynamic range.
> >
>
> I tend to agree with you but the whole thing is not that easy.  What
> antialiasing does is to try to approximate the integration over the
> pixel area by taking several samples.
>
> But the problem is if it is correct to do the averaging of the samples
> (which is the approximation of the integral with a sum) with or without
> the non-linearities of the tone-mapping used (in case of standard POV
> this is gamma correction and clipping).
>
> You can't really answer this from looking how it works in real life -
> when you take a photograph of a star the ideal camera outside the earth
> atmosphere in ideal empty space will only show an infinitely small
> point.  Of course nothing is ideal so the result will be a spot of
> finite size (with the intensity diminishing from the center to the rim).
> but how exactly the non-linearities of the film exposure work here is
> hard to tell (meaning it would be difficult to predict how bright two
> stars very close to each other will look from the appearance of them a
> distance apart).
>
> Coming back to the actual antialiasing problem - in cases like this it
> would be quite nice to antialias before clipping, in relation with the
> high dynamic range output in next megapov this will be possible as well.
>   But there are also situations where this causes problems, see for
> example the wall edge on the right in:
>
> http://www-public.tu-bs.de:8080/%7Ey0013390/pov/pool/chpool.jpg
>
> where despite antialiasing the stairstep effects are quite strong which
> is to some extent caused by the tone mappping being applied after
> antialiasing.
>
> An idea i had thought of to solve this problem (without the necessity to
> accept clipped output) was to make the tone mapping function (or an
> approximation of it) available to POV (for example as a user defined
> function) and to apply this function before the averaging of samples.
> To get back to the linear result afterwards you would need the inverse
> of this function of course (it needs to be invertible so you should not
> use hard clipping).
>
> I don't know how useful such a feature would be but it would allow to
> adjust continuously between the two extemes.
>
> Christoph
>
> -- 
> POV-Ray tutorials, include files, Sim-POV,
> HCR-Edit and more: http://www.tu-bs.de/~y0013390/
> Last updated 11 Jan. 2004 _____./\/^>_*_<^\/\.______
>


Post a reply to this message

From: Christopher James Huff
Subject: Re: Antialiasing problems (3 images, 11k,15k,12k)
Date: 13 Jan 2004 13:51:39
Message: <cjameshuff-0C7090.13515613012004@netplex.aussie.org>
In article <400409cc$1@news.povray.org>, "Slime" <fak### [at] emailaddress> 
wrote:

> Because they're too small to be accurately represented in the final image
> resolution. Just because they're intense doesn't mean they should become a
> full pixel in size.

That is exactly what it means.


> This could end up producing different results depending
> on what the final resolution is.

Correct. For instance, a star, which is essentially a point light, will 
be a bright point...not a ball or empty space.


> Antialiasing supersamples the scene, but it must take into account that the
> final output will have limitations such as a finite dynamic range. The
> mysterious "format" you refer to is the same as the actual format of the
> final image, which is important. By clipping before averaging, anti-aliasing
> produces the effect of rendering at an infinite resolution and then resizing
> smaller, which is exactly what it's supposed to do.

No it is not. The purpose of antialiasing is to prevent aliasing 
artifacts by supersampling the scene, *not* to emulate reduction from a 
larger sized image.


> I admit that I do see some logic in your argument - clipping before
> averaging does feel artificial to some extent.

Because it *is* artificial.


> However, the fact that
> clipping after averaging would produce jagged edges on bright objects causes
> me to believe that it would be much more useless than clipping before
> averaging.

Which wipes out small details which *should* be visible.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tagpovrayorg>
http://tag.povray.org/


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 9 Messages >>>

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