POV-Ray : Newsgroups : povray.advanced-users : Per object antialiasing demo Server Time
25 Nov 2024 03:32:34 EST (-0500)
  Per object antialiasing demo (Message 1 to 6 of 6)  
From: Gilles Tran
Subject: Per object antialiasing demo
Date: 7 Jan 2004 20:15:13
Message: <3ffcaf21@news.povray.org>
Further to the reflection blur thread in p.general and as an answer to a
question by Christoph Hormann, here's a demo of per object antialiasing in
Cinema 4D.

The scene is built with primitives (see the POV-Ray version at the end of
this message) and uses a hard omni light, transparency and reflection. so I
guess it's mostly raytracing (no scanline).
The figure attached to the name is the render time in seconds.

No antialiasing at all : http://www.oyonale.com/temp/po_none_4s.png
OK, it's really bad.

Now with antialiasing, but a very bad one (I lowered the settings almost at
their minimum) : http://www.oyonale.com/temp/po_bad_6s.png
It's almost as bad as the non antialiased one, but notice an interesting
thing: when the shapes are seen directly (hit by the first ray), they are
already very well antialiased (see the sphere outline vs its reflection, and
the checker on the plane vs when it's seen through the yellow disc). I don't
know (yet) what causes this, as it seems a default feature.

Note that to make things look more POV-Rayish, I turned off a C4D aa feature
(MIP scaling) that tends to antialias the textures with little rendering
overhead.
With a 100% MIP scaling, the previous scene looks like this:
http://www.oyonale.com/temp/po_bad_mip_7s.png
Here the textures are quite perfect, but the shadow and outlines in the
reflection are wrong, like in the previous image. Obviously, in a real
image, I would use MIP scaling to avoid using higher aa.

In any case, I kept the bad antialiasing values and the 0% MIP scaling as a
general setting for the entire scene and then gave each object in turn a
better setting (actually the default one with a slightly lower aa
threshold - see the POV-Ray manual!).

Sphere only : http://www.oyonale.com/temp/po_bad_sph_11s.png
The sphere looks good in direct view (except a little spot on the top) and
seen through the disc but its reflection and shadow are bad, as are the disc
reflection and the plane checker seen through the disc. It means certainly
that the per object aa is applied whenever the object is hit by a ray which
is direct or transmitted, but not reflected.

Disc only : http://www.oyonale.com/temp/po_bad_dsc_11s.png
Everything that is seen through the disc is good (sphere and checkered
plane), so we can guess that the aa settings of an object are also used for
everything that can be seen through it.

Plane only : http://www.oyonale.com/temp/po_bad_plane_12s.png
Everything that is on the plane (reflection, texture and shadow) is good.
The plane looks good through the disc too. We can guess that reflections and
shadows seen on an object use its aa settings.

Entire scene with the good settings:
http://www.oyonale.com/temp/po_good_16s.png
Here everything looks good... except the little white spot on the top of the
sphere.

To get rid of it, I raise the aa quality for the sphere until it disappears:
http://www.oyonale.com/temp/po_almostperfect_38s.png
Now the spot gone from the sphere, but is still on the reflection, which is
to be expected. However, from a practical point of view, this scene is a
good compromise between render time and quality.

To get rid of the spot on the reflection, one can use a higher aa on the
plane too, while giving a much lower one to the entire scene:
http://www.oyonale.com/temp/po_perfect_134s.png

Here the higher settings are used on the entire scene, as we would do in
POV-Ray:
http://www.oyonale.com/temp/po_perfect_164s.png
Of course this one takes the longest time to render.

I guess that this illustrates how a per object aa can work in practice, and
the benefits of it, particularly in render time. In POV-Ray we could even
have the additional goodie of declaring and naming the object settings so
that turning them off and on could be done with variables.

Here's the equivalent POV-Ray scene for those interested. I used rather
extreme aa settings (+A0.0 +F +AM2 +R4 +J) so the render times are extreme
too. Certainly it could be done faster (+A0.0 +AM1 +R9 or +A0.0 +AM2 +R3) .
http://www.oyonale.com/temp/po_pov_700s.png


at the picture from a distance and slightly from above or below, and which
is absent from the high aa C4D pics. Scale down the sphere texture by 2 to
see it more clearly. It becomes visible in C4D too, but it's much less
acute, particularly if MIP scaling is used.

#include "colors.inc"
global_settings {assumed_gamma 1.0}
camera {
    location -z*600    angle 60
    right x*image_width/image_height
    look_at   z
}
background{Cyan}
light_source { <-600,-200,-300> color Red}
light_source { <600,600,-600> color White}
sphere{0,100 texture{pigment{checker Black,White scale 1/100
warp{spherical}} finish{ambient 0 diffuse 1}}}
box{<-500,-500,0>,<500,500,0.001> texture{pigment{checker Black,White scale
100}finish{ambient 0 diffuse 1 reflection 0.7}} rotate y*45 translate z*300}
disc{0,z,100 texture{pigment {rgbf <1,1,100/255,0.8>} finish{ambient 0
diffuse 1}} translate <-100,0,-300>}

G.

-- 
**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: Christoph Hormann
Subject: Re: Per object antialiasing demo
Date: 8 Jan 2004 04:42:03
Message: <c4lvc1-p9a.ln1@triton.imagico.de>
Gilles Tran wrote:
> Further to the reflection blur thread in p.general and as an answer to a
> question by Christoph Hormann, here's a demo of per object antialiasing in
> Cinema 4D.
> 
> The scene is built with primitives (see the POV-Ray version at the end of
> this message) and uses a hard omni light, transparency and reflection. so I
> guess it's mostly raytracing (no scanline).
> The figure attached to the name is the render time in seconds.
> 
> [...]

It seems about how i would expect it.

> Now with antialiasing, but a very bad one (I lowered the settings almost at
> their minimum) : http://www.oyonale.com/temp/po_bad_6s.png
> It's almost as bad as the non antialiased one, but notice an interesting
> thing: when the shapes are seen directly (hit by the first ray), they are
> already very well antialiased (see the sphere outline vs its reflection, and
> the checker on the plane vs when it's seen through the yellow disc). I don't
> know (yet) what causes this, as it seems a default feature.

To me this seems like C4D is using a non-raytracing technique for 
antialiasing here.  This would explain why it only works on the directly 
visible surfaces.

  > Here's the equivalent POV-Ray scene for those interested. I used rather
> extreme aa settings (+A0.0 +F +AM2 +R4 +J) so the render times are extreme
> too. Certainly it could be done faster (+A0.0 +AM1 +R9 or +A0.0 +AM2 +R3) .
> http://www.oyonale.com/temp/po_pov_700s.png

But using +a0.0 is completely unfair towards POV, you turn of the 
adaptive antialiasing this way - of course the render is incredibly 
slow.  Using +a0.1 instead renders ways faster (about 20x!) and looks 
better than your 16 seconds sample i think.

Christoph

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


Post a reply to this message

From: Gilles Tran
Subject: Re: Per object antialiasing demo
Date: 8 Jan 2004 05:22:44
Message: <3ffd2f74$1@news.povray.org>

news:c4lvc1-

>To me this seems like C4D is using a non-raytracing technique for
>antialiasing here.  This would explain why it only works on the directly
>visible surfaces.

This is quite probable. In fact C4D has a "geometry mode" aa which is
extremely fast but totally unusable when ray-traced shadows are used (they
don't get aa at all!). I guess that the "best mode" I used here is actually
a combination of POV-Ray-like aa (for raytraced parts) and non-raytraced aa
(whenever possible). As we can see, it results in bizarre discrepancies when
the overall aa quality is bad but the main point is that this type of system
offers a lot of room for compromises between quality and render time.
Working on a "real" C4D scene, I was able to cut down the render time by 35%
(from 49 hours to 31 hours) using a combination of low GI and low aa for
some elements, with an acceptable loss on quality on those.

> But using +a0.0 is completely unfair towards POV, you turn of the
> adaptive antialiasing this way - of course the render is incredibly
> slow.  Using +a0.1 instead renders ways faster (about 20x!) and looks
> better than your 16 seconds sample i think.


that C4D uses (by default) some sort of jittering, different from POV-Ray's,

without noticeable improvement.

I had tried +a > 0 first but it doesn't resolve the problems on the top of
the sphere (little white spots). They only disappear with a0.0, which is
something I would have to do in real image. In fact, I had to use +a0.0 with
C4D too to get rid of it, so it wasn't so unfair (and shows that C4D and
POV-Ray are extremely close here) ! In any case it didn't try to compare
POV-Ray and C4D here about speed issues, just to see how I could get the
best of both apps.

G.
-- 

**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: Christoph Hormann
Subject: Re: Per object antialiasing demo
Date: 8 Jan 2004 11:52:04
Message: <3vd0d1-scq.ln1@triton.imagico.de>
Gilles Tran wrote:
> 

pect is
> that C4D uses (by default) some sort of jittering, different from POV-R
ay's,

y, but
> without noticeable improvement.

You know you can control the amount of jitter in POV with 
Jitter_Amount=n.n / +Jn.n.  I tried for example '+A0.01 +AM2 +R6 +J10.0
'.

> I had tried +a > 0 first but it doesn't resolve the problems on the top
 of
> the sphere (little white spots). They only disappear with a0.0, which i
s
> something I would have to do in real image. In fact, I had to use +a0.0
 with
> C4D too to get rid of it, so it wasn't so unfair (and shows that C4D an
d
> POV-Ray are extremely close here) ! In any case it didn't try to compar
e
> POV-Ray and C4D here about speed issues, just to see how I could get th
e
> best of both apps.

But you should notice that with +a0.0 POV-Ray supersamples every pixel 
while i am pretty sure C4D does not.

Concerning the origin of the discussion - from my side the result is 
about: It could be useful for speed reasons to specify different aa 
settings for different parts of the scene but specifying them on per 
object basis might often not be that useful after all.  In this scene 
for example you might want to specify +a0.0 for the sphere and its 
reflection - to do this without unnecessary slowdown it would probably 
be easiest to define an aa-map - you could generate it by rendering a 
plain color version and creating a map from it in a paint program.  This 

way you could also restrict the high aa parts even further - to only the 

poles of the sphere.

Christoph

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


Post a reply to this message

From: Gilles Tran
Subject: Re: Per object antialiasing demo
Date: 8 Jan 2004 13:22:34
Message: <3ffd9fea@news.povray.org>
Gilles Tran wrote:

>You know you can control the amount of jitter in POV with
>Jitter_Amount=n.n / +Jn.n.  I tried for example '+A0.01 +AM2 +R6 +J10.0'.

Yes I tried that during the tests (including J10.0 to get extreme jitter and

and still got artefacts. I kept +J but to be frank I'm not sure it does
anything useful here.

>But you should notice that with +a0.0 POV-Ray supersamples every pixel
>while i am pretty sure C4D does not.

In fact, I was suprised to see POV-Ray crawl on a plain background{} with
a0.0, which doesn't make much sense. C4D slows down there a little bit only,
but it's a sky_sphere here so it's an object. With a0.0 on a real background
(like a complex texture on a plane), both applications crawl, and not only
with aa0.0...

>Concerning the origin of the discussion - from my side the result is
>about: It could be useful for speed reasons to specify different aa
>settings for different parts of the scene but specifying them on per
>object basis might often not be that useful after all.  In this scene
>for example you might want to specify +a0.0 for the sphere and its
>reflection - to do this without unnecessary slowdown it would probably
>be easiest to define an aa-map - you could generate it by rendering a
>plain color version and creating a map from it in a paint program.  This
>way you could also restrict the high aa parts even further - to only the
>poles of the sphere.

I think that the per object aa is an overall good compromise. It's very
user-friendly, and easy to test during development. I'm certainly going to
use it as a standard feature in my C4D scenes and these little tests have
been extremely helpful to understand what's going on. As I said in a
previous post, aa issues are usually texture or object-related so it's easy
to define. If you have an aa problem with an object, just improve its aa
settings until a compromise is reached.
I understand that the advantage of maps would be in situation where an
object could really use variable aa : this is the case for the sphere here
and even more for the plane (if we want a 100% correct reflection and
shadows). But then aa is adaptive after all, so it's not always such a
problem. Also, there's always the clumsy solution of using CSG to cut up the
object and giving different aa settings to its parts (something that would
be much easier in POV-Ray than in C4D btw). And the possibility of using
transparent discs or polygons in front of the camera to define aa zones (to
be tested though, I just made it up)...

Maps have also several practical drawbacks: first you can't fine tune aa
parameters that way unless you define one map by parameter (4 for POV-Ray)
or define a way to somehow link aa parameters to map colours. Second, you
won't use this in animation for obvious reasons (well, one could still
create the map automatically by generating a masked version of the scene
based on the objects - but then we're back to object-based aa). Third,
you'll have to repaint a map each time you move the camera or some of the
objects. I've been through this kind of manual editing in POV-Ray (to get
variable radiosity rather than variable aa in fact) and while feasible it's
a real pain.

G.

-- 

**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: Christopher James Huff
Subject: Re: Per object antialiasing demo
Date: 9 Jan 2004 16:38:59
Message: <cjameshuff-4DC325.16390809012004@netplex.aussie.org>
In article <3ffd9fea@news.povray.org>,
 "Gilles Tran" <tra### [at] inapginrafr> wrote:

> >But you should notice that with +a0.0 POV-Ray supersamples every pixel
> >while i am pretty sure C4D does not.
> 
> In fact, I was suprised to see POV-Ray crawl on a plain background{} with
> a0.0, which doesn't make much sense. C4D slows down there a little bit only,
> but it's a sky_sphere here so it's an object. With a0.0 on a real background
> (like a complex texture on a plane), both applications crawl, and not only
> with aa0.0...

a0.0 means supersample even if the color difference is 0...it makes the 
antialiasing entirely non-adaptive. A perfect black background will be 
as slow as a highly busy granite texture. Maybe POV supersamples if 
difference >= AA-threshold, while C4D supersamples if difference > 
AA-threshold.

-- 
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

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