POV-Ray : Newsgroups : povray.binaries.images : no smooth edges even with Antialiasing Server Time
10 Aug 2024 15:25:17 EDT (-0400)
  no smooth edges even with Antialiasing (Message 11 to 20 of 20)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: D  H  Berlin
Subject: Re: no smooth edges even with Antialiasing
Date: 20 Aug 2004 15:55:01
Message: <web.4126568b44473608e0a643bb0@news.povray.org>
Look at the yellow one. It's the same.

"Slime" <fak### [at] emailaddress> wrote:
> You could try turning on
> jittering (+J I think) which might help. You could also try AA method 2
> (+AM2) or, again, higher sampling count on the AA'ed pixels (+R4 or even
> +R5).
>
>  - Slime
>  [ http://www.slimeland.com/ ]

The whole scene: (Basically all things from the insert menu)

  #include "colors.inc"
  #include "metals.inc"
  #include "transforms.inc"

#declare licht1 = 100/100;  // arealight 1     in Prozent geteilt durch 100:
 x/100
#declare licht2 = 100/100;  // arealight 2
#declare licht3 = 100/100;  // Spotlight 1
#declare licht4 = 100/100;  // Spotlight 2
#declare text_font001 = "cyrvetic.ttf"


#if (licht1>0)
// An area light (creates soft shadows)
// WARNING: This special light can significantly slow down rendering times!
light_source {
  0*x                 // light's position (translated below)
  color rgb 0.3*licht1      // light's color
  area_light
  <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z)
  4, 4                // total number of lights in grid (4x*4z = 16 lights)
  adaptive 0          // 0,1,2,3...
  jitter              // adds random softening of light
  circular            // make the shape of the light circular
  orient              // orient light
  translate <40, 80, -40>   // <x y z> position of light
}
#end
#if (licht2>0)
// An area light (creates soft shadows)
// WARNING: This special light can significantly slow down rendering times!
light_source {
  0*x                 // light's position (translated below)
  color rgb 0.8 *licht2      // light's color
  area_light
  <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z)
  4, 4                // total number of lights in grid (4x*4z = 16 lights)
  adaptive 0          // 0,1,2,3...
  jitter              // adds random softening of light
  circular            // make the shape of the light circular
  orient              // orient light
  translate <-40, 80, 40>   // <x y z> position of light
}
#end
#if (licht3>0)
// create a point "spotlight" (conical directed) light source
light_source {
  0*x                     // light's position (translated below)
  color rgb <1,1,1>*licht3       // light's color
  spotlight               // this kind of light source
  translate <40, 81, -40> // <x y z> position of light
  point_at <0, 0, 0>      // direction of spotlight
  radius 5                // hotspot (inner, in degrees)
  tightness 50            // tightness of falloff (1...100) lower is softer,
higher is tighter
  falloff 8               // intensity falloff radius (outer, in degrees)
}
#end
#if (licht4>0)
// create a point "spotlight" (conical directed) light source
light_source {
  0*x                     // light's position (translated below)
  color rgb <1,1,1>*licht4       // light's color
  spotlight               // this kind of light source
  translate <40, 81, -40> *< -1,1,1> // <x y z> position of light
  point_at <0, 0, 0>      // direction of spotlight
  radius 1                // hotspot (inner, in degrees)
  tightness 50            // tightness of falloff (1...100) lower is softer,
higher is tighter
  falloff 1.2               // intensity falloff radius (outer, in degrees)
}
#end

camera {
//  location  <0.0, 6.0, -0.0> *<1.4,3,3>
  location  <1.0, 2.0, -5.0> *<1.4,3,1> +y*1 scale 0.022
  look_at   <0.0, 0.0,  0.04>
  translate <0.04,0.003,0>
  right     x*image_width/image_height
  angle 55
}

// An infinite planar surface
// plane {<A, B, C>, D } where: A*x + B*y + C*z = D
plane {
  y, // <X Y Z> unit surface normal, vector points "away from surface"
  0  // distance from the origin in the direction of the surface normal
  hollow on // has an inside pigment?
    pigment { color rgb <1.0,1.0,1.0> }
//    pigment { color rgb <0.7,0.5,0.3> }
//  texture { T_Wood12  finish{phong 0.4} rotate y*90 scale 0.2}
}


// Zu zeigendes Object/Macro

//
//
#macro pen (pr,pml,peakl,number_of_sides,maintex,peaktex,minetex)
// pr = penradius; pml = pen main part length; peakl = whole peak's length;
// number_of_sides = number_of_sides;
// maintex / peaktex / minetex = texture of main part / peak / mine
  #local mineradius = pr/3.8;
  #local plane_x = cos( 2*pi/number_of_sides / 2 ) * pr;
  #local i=0;
  intersection{
    union{ cylinder {0 <0,pml,0> pr }
           cone{ <0,peakl/10,0> pr*11/10 <0,-peakl,0> 0
              texture { gradient y
                      texture_map {
                        [ 0.0 minetex ]
                        [ 0.3 minetex ]
                        [ 0.35 peaktex scale peakl/2]
                        [ 1.0 peaktex scale peakl/2]
                      }
                      scale peakl
              }
           }
    }
    #while (i<number_of_sides)
        plane { x, plane_x
          rotate y*i*360/number_of_sides
        }
        #local i=i+1;
    #end
    texture {
      function{sqrt(x*x+z*z)}
      texture_map {
        [ 0.0 maintex ]
        [ 0.935 maintex ]
        [ 0.945 minetex ]
        [ 1.0 minetex ]
      }
      scale pr
    }
  rotate z*-90
  }
#end
//
object { pen(0.0025,0.14,0.009,6,T_Brass_2B,T_Wood10,pigment{Red})
//  texture { T_Wood12 }
// T_Chrome_1A
  Rotate_Around_Trans (-y*30, <0.05, 0, 0>)
  translate y*0.01
}


Post a reply to this message

From: Slime
Subject: Re: no smooth edges even with Antialiasing
Date: 20 Aug 2004 16:56:13
Message: <4126656d@news.povray.org>
Here is your image. My suspicion was that the background was so bright that
it was "drowning out" the pen colors along the edges. To a small extent this
was true. As you point out, the problem still occurs to some degree with a
background which is not too bright.

I had to change your textures to solid red, green and blue because they were
causing parse errors; not sure why. The images were rendered with the
settings +A0.1 +R4 +AM2 +J to make sure AA'ing was doing the best job it
could.

In the image, pen 1 is your original image. Pen 2 is the same image with the
plane's color set to rgb 0.63 (which is just bright enough to keep the
background white). Pen 3 is the same image with the third light source
intensity set to 0.75 and the fourth light source turned off (which creates
just enough light intensity to keep the background white, and has the effect
of not making the pen so bright).

The change made in POV-Ray 3.6 that I suspected was causing your problem is
that sample values are not clamped to the range [0,1] before being averaged
to antialias. This creates the effect that with bright objects, the
antialiasing favors the brighter objects and tends to color pixels that
color. As an example of this effect, see the other image I posted. In the
image with overly bright color values, the antialiasing has no visual
effect. Notice that the pixels which would have been antialiased instead are
completely washed out in the red and green channels and are therefore
yellow.

In my opinion, pen #3 is the one with the best antialiasing. This is because
the background is not any brighter than rgb <1,1,1>, and the pen itself does
not have any overly bright color channels, so the AA'ing is doing its job.

With pen #1 (the original), both the pen and background have color values
slightly greater than 1. This causes the effect that my other image
displays; not to such a large degree, but to some degree nonetheless. Notice
the pointy part of the pen; this happens to suffer the most.

With pen #2, the background is now about rgb <1,1,1>, but the pen is still
washed out to some degree, so the antialiasing still isn't perfect because
the redness of the edge of the pen is favored in the sample averaging.

With pen #3, as I mentioned, nothing is washed out so the AA'ing is best
there (if you agree with my assessment).

You pointed out that the problem occurs with other background colors, too. I
believe this is because the pen itself is very bright because there is so
mugh light hitting it.

If you're still not happy with the result, then that's probably because
AA'ing can't really do a perfect job anyway. You're still working with
pixels so you can't get a perfectly smooth effect. I believe image #3 is as
good as it gets without a physically higher resolution (more and smaller
pixels on your monitor).

FYI, this change in POV-Ray 3.6 was made, I believe, because people
complained that their starfields with stars smaller than pixels weren't
working with AA'ing. I mentioned that the change was not worth the effects
it would have on regular scenes with bright objects and I stand by that
opinion.

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


Post a reply to this message


Attachments:
Download 'pens.png' (40 KB) Download 'redgreenaa.png' (21 KB)

Preview of image 'pens.png'
pens.png

Preview of image 'redgreenaa.png'
redgreenaa.png


 

From: Thorsten Froehlich
Subject: Re: no smooth edges even with Antialiasing
Date: 20 Aug 2004 17:15:44
Message: <41266a00@news.povray.org>
In article <web.412595175b7ef1e2815b56e50@news.povray.org> , "D. H. Berlin"
<wee### [at] PoVStefaniede> wrote:

> What can I do against this?
> Are there some general settings which could prevent this?

Yes, keep your light balanced.  Right now your scene is lit by over 200%
white light.  If you disable light source 4, the problem (almost) goes away
and your scene not only looks much better, it also renders faster with
regular antialiasing settings.

    Thorsten


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: no smooth edges even with Antialiasing
Date: 20 Aug 2004 17:18:22
Message: <41266a9e@news.povray.org>
In article <4125c6c4$1@news.povray.org> , "Eli" <eli### [at] jehoelnet> wrote:

> Maybe you should try focal blur. Nowadays I almost always use focal blur for
> antialiasing.

I am sorry to say, but this suggestion is pure nonsense.  Using focal blur
to replace antialiasing is like replacing wheels with boxes.

    Thorsten


Post a reply to this message

From: D  H  Berlin
Subject: Re: no smooth edges even with Antialiasing
Date: 21 Aug 2004 04:45:01
Message: <web.41270a6b44473608594d6aa20@news.povray.org>
Hi!

Thanks for the great answer!
Seems that you are right. I just add an image with on top a 3.6-render and
down a 3.5 render.
Seems really to be an effect of the two things: too much brightness and a
change in the render-engine.

How did you this green-red image?

Greetings
Dieter

"Slime" <fak### [at] emailaddress> wrote:
> I had to change your textures to solid red, green and blue because they were
> causing parse errors; not sure why. The images were rendered with the
> settings +A0.1 +R4 +AM2 +J to make sure AA'ing was doing the best job it
> could.
  ...
>  - Slime
>  [ http://www.slimeland.com/ ]


Post a reply to this message


Attachments:
Download 'pens36_35.png' (35 KB)

Preview of image 'pens36_35.png'
pens36_35.png


 

From: Slime
Subject: Re: no smooth edges even with Antialiasing
Date: 21 Aug 2004 04:50:21
Message: <41270ccd@news.povray.org>
> How did you this green-red image?

It's just a green sphere on a red background (with the colors specified) and
finish{ambient 1 diffuse 0} so that light sources were not necessary. Then I
rendered two versions and composited in photoshop.

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


Post a reply to this message

From: D  H  Berlin
Subject: Re: no smooth edges even with Antialiasing
Date: 21 Aug 2004 05:00:00
Message: <web.41270f0444473608c0416ede0@news.povray.org>
About the textures/colors: I forgot the line
  #include "woods.inc"

And turning off light 4 improves the edges. And then there isn't so much
difference anymore between 3.5 and 3.6.
Though i have the shadow of then pen then, as in your images.

I'm not happy. But I will find a workaround if necessary.

Thanks all for your help!

Greetings
Dieter


Post a reply to this message

From: Slime
Subject: Re: no smooth edges even with Antialiasing
Date: 21 Aug 2004 05:17:14
Message: <4127131a@news.povray.org>
> And turning off light 4 improves the edges. And then there isn't so much
> difference anymore between 3.5 and 3.6.

Yeah, I think turning down the lights is a good idea.

> Though i have the shadow of then pen then, as in your images.

If you don't want the shadow, you can either remove the white plane and put
in background{rgb 1} or put the no_shadow keyword on the pen.

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


Post a reply to this message

From: Alain
Subject: Re: no smooth edges even with Antialiasing
Date: 21 Aug 2004 09:55:57
Message: <4127546d$1@news.povray.org>
D. H. Berlin nous apporta ses lumieres ainsi en ce 21/08/2004 04:59... :

>About the textures/colors: I forgot the line
>  #include "woods.inc"
>
>And turning off light 4 improves the edges. And then there isn't so much
>difference anymore between 3.5 and 3.6.
>Though i have the shadow of then pen then, as in your images.
>
>I'm not happy. But I will find a workaround if necessary.
>
>Thanks all for your help!
>
>Greetings
>Dieter
>
You may want to lower the values of all your light_source. Define a 
reduction factor like #define Dimer=0.75;
Then, multiply the colour of all the lights by that value. It won't 
alter the tint, just the intensity.

Alain


Post a reply to this message

From: Jaap
Subject: Re: no smooth edges even with Antialiasing
Date: 24 Aug 2004 10:05:00
Message: <web.412b4aea44473608a8399d8d0@news.povray.org>
"D. H. Berlin" <wee### [at] PoVStefaniede> wrote:
> The edges are really bad at the pen's main part.

i noticed that you are using jpg files. default jpeg compression uses a
lower
resolution for red. i have experienced problems with bright red objects
many times.

antialiasing can also be affected a lot by gamma settings.
antialiasing averages the samples linearly, but on your monitor a pixel with
0.1 brightness may look a lot darker than half the brightness of a 0.2
pixel.

just a thought.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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