newbie question about aliasing artifacts

newbie question about aliasing artifacts

Post by Andrew McDavi » Wed, 22 Oct 1997 04:00:00



I'm trying to make a gravestone with povray 3.02 for windows and I'm
getting strange aliasing artifacts or something at the top of my
gravestone.  The top looks "dirty."  It is rounded and it is made with a
intersection between a cylinder and a box.  
        I remember seeing something about artifacts with cylinders or cones or
something in the manual, and I think it said to scale it up a tiny bit,
or change the camera angle.  I have tried both. How can I fix this?  Do
I need to decrease the anti-aliasing threshold to make these go away?  I
already tried rendering with aa .3, but they're still there.  I have
also tried using a couple different textures.

Here's the code:

#include "colors.inc"
#include "stones.inc"
camera {
location <1, 4, -4>
look_at <0, 3, 0>

Quote:}

light_source { <5, 5, 5> color White }
light_source { <7, 6, -5> color White }
//gravestones

#declare roundedGS = union {
box {  //upright box for rounded gravestone(GS)
<-1, .5, -.5>
<1, 2.5, .5>

Quote:}

box { //basestone
<-1.3, 0, -.8> //extends .3 on the edges, .5 units tall
<1.3, .5, .8> //   "
Quote:}

intersection {
box { //need to make a rounded top
<-1, 2.5, -.5>
<1, 3.5, .5>
Quote:}

cylinder { <0, 2.5, -.5>
<0, 2.5, .5>, 1
Quote:}
}

texture {T_Grnt1}
finish {ambient .3 diffuse .6}
scale <1.001, 1.001, 1.001>
Quote:}

object{roundedGS}

I'm running a pentium 133, 32 megs and windows 95.
Also, what is the difference between clipped_by and intersection?

Thanks in advance,
Andrew McDavid

 
 
 

newbie question about aliasing artifacts

Post by Benjamin Strauti » Thu, 23 Oct 1997 04:00:00


Your problem is the famous "coincidental surfaces," not with antialiasing.
The box and cylinder both have surfaces at z= +/-0.5, which messes up
POVRays calulations in that area. The best way to fix this is just to
remove the intersection entirely and replace it with the cylinder. (the
box is redundant)

Quote:> ...
> intersection {
> box { //need to make a rounded top
> <-1, 2.5, -.5>
> <1, 3.5, .5>
> }
> cylinder { <0, 2.5, -.5>
> <0, 2.5, .5>, 1
> }
> }
> ...

all of that becomes:
 cylinder { <0, 2.5, -.5>
 <0, 2.5, .5>, 1
 }

Have fun tracing!

Benjamin

Good students don't 'cheat'--they verify.
-- Steven Wright
-----------------
Benjamin Strautin


 
 
 

newbie question about aliasing artifacts

Post by Nieminen Mi » Thu, 23 Oct 1997 04:00:00


: sphere
: { 0,1 pigment { color rgbt <1,1,1,.5> }
:   clipped_by { box { <0,-1,-1><1,1,1> } }
: }

  Sorry, it should have been:

  clipped_by { box { <-1,-1,-1><0,1,1> } }

--
Hanki el?m?, hanki linux.
                                                              - Warp. -

 
 
 

newbie question about aliasing artifacts

Post by Nieminen Mi » Thu, 23 Oct 1997 04:00:00


: intersection {
: box { //need to make a rounded top
: <-1, 2.5, -.5>
: <1, 3.5, .5>
: }
: cylinder { <0, 2.5, -.5>
: <0, 2.5, .5>, 1
: }
: }

  Your code is very illegible. How about some indentation? (is that the
correct term?)
  Anyways, your problem is that the cylinder's top is exactly in the same
place as the box top. This should work:

  intersection
  { box { <-1, 2.5, -.5> <1, 3.6, .5> } // Note the change here
    cylinder { <0, 2.5, -.5> <0, 2.5, .5>, 1
  }

  I don't know why this happens, but apparently when povray hits a place
where two surfaces have same normals at exactly the same place, the
tracing algorithm bugs; maybe something like a division by zero or some-
thing (I think the FPU does not stop the program if a division by zero
occurs). The solution is to avoid this kind of CSG's, as I showed above.

: Also, what is the difference between clipped_by and intersection?

  Intersection creates an additional surface in the place which is cut
off. If this additional surface is not seen from the camera (ie. it's
useless) it's better to use clipped_by (faster rendering).

  Clipped_by is really strange to me, and I don't really like it.
  Suppose you have this:

sphere
{ 0,1 pigment { color rgbt <1,1,1,.5> }
  clipped_by { box { <0,-1,-1><1,1,1> } }

Quote:}

  Suppose a (camera) ray that hits this object along the x-axis.
  If the ray comes from negative x direction to positive x direction, first
it's 'outside', then it hits the sphere at <-1,0,0> and becomes 'inside',
and then it travels trhough the hole in the sphere and it's 'inside' all
the way to the infinity.
  Now suppose the ray comes from positive x direction to negative. First
it's 'outside', then it travels trough the hole in the sphere and hits
the surface again at <-1,0,0>. What happens then is unknown to me. Does it
become 'inside' and continue to infinity this way? Or does it stay 'outside'
because it came out of the sphere?
  I don't know. Both things are weird.
  I think that if you are using fog, halos, etc, better don't use clipped_by.

--
Hanki el?m?, hanki linux.
                                                              - Warp. -

 
 
 

newbie question about aliasing artifacts

Post by Scott Hil » Sat, 25 Oct 1997 04:00:00




Quote:> I'm trying to make a gravestone with povray 3.02 for windows and I'm
> getting strange aliasing artifacts or something at the top of my
> gravestone.  The top looks "dirty."  It is rounded and it is made with a
> intersection between a cylinder and a box.  
>    I remember seeing something about artifacts with cylinders or cones or
> something in the manual, and I think it said to scale it up a tiny bit,
> or change the camera angle.  I have tried both. How can I fix this?  Do
> I need to decrease the anti-aliasing threshold to make these go away?  I
> already tried rendering with aa .3, but they're still there.  I have
> also tried using a couple different textures.

<snipped code>

        Ah, the old "coincidental surfaces" feature. You see if you have two
objects that have outside surfaces in exactly the same place you get this
odd effect. You see in this bit :

intersection {
box { //need to make a rounded top
<-1, 2.5, -.5>
<1, 3.5, .5>

Quote:}

cylinder { <0, 2.5, -.5>
<0, 2.5, .5>, 1

Quote:}
}

both the box and cylinder have surfaces at z=-0.5 and z=0.5, that's what's
causing the problem. You can adjust one of the object so that this doesn't
happen, thus:

intersection {
box { //need to make a rounded top
<-1, 2.5, -.5>
<1, 3.5, .5>

Quote:}

cylinder { <0, 2.5, -.51>
<0, 2.5, .51>, 1

Quote:}
}

here I've made the cylinder that the box is intersected with poke out from
the side of the box very slightly.

HTH,

--
Scott Hill

Software Engineer (and all round nice guy)

"The best trick the devil ever pulled was convincing people he didn't
exist..."
                                                                - Verbal Kent.

"the Internet is here so we can waste time talking about nothing in
 particular when we should be working" - Marcus Hill.

 
 
 

newbie question about aliasing artifacts

Post by Jack Bo » Mon, 27 Oct 1997 03:00:00



>I'm trying to make a gravestone with povray 3.02 for windows and I'm
>getting strange aliasing artifacts or something at the top of my
>gravestone.  The top looks "dirty."  It is rounded and it is made with a
>intersection between a cylinder and a box.  
>    I remember seeing something about artifacts with cylinders or cones or
>something in the manual, and I think it said to scale it up a tiny bit,
>or change the camera angle.  I have tried both.

The problem and the scaling needed is here:

Quote:>intersection {
>box { //need to make a rounded top
><-1, 2.5, -.5>
><1, 3.5, .5>
>}
>cylinder { <0, 2.5, -.5>
><0, 2.5, .5>, 1
>}
>}

not here:

Quote:>scale <1.001, 1.001, 1.001>

When POV-Ray traces a ray to z=-0.5 it's evidently a tossup as to
whether it decides the ray first hits the end of the cylinder or the
side of the box.  For some reason on an intersection {} Pov-Ray
decides one of these surfaces is not lit.  The standard fix is to
enlarge one of the objects so the surfaces do not coincide, ie:
box {
   <-1, 2.5, -.6>
   < 1, 3.5, 0.6> // extend it here too so you won't have the same
//                   problem when you go around the back.
Quote:}

You could have done it to the cylinder instead (but not both, you
need one at +/- .5 to "clip" the other back to where it belongs)

Alternatively, you could notice that you don't need to halve the
cylinder, remove the intersection and just union the upright with
the cylinder.  You will then see that union {} does not have the
artifacting problem; that although the upright box and the cylinder
"overlap" and their end surfaces coincide you don't get the
speckling.

If I can offer some unasked-for advice based on my experience of
building objects by lining up their surfaces:
Sometimes for coordinates I use long decimals that aren't powers of
two and round off error causes the surface of one object to be in
not quite the same place as the surface of the other object.  When I
get close I can see between them.  I've gotten into the habit of
tucking one object into the other.  For example: if you did want to
take the intersection with the cylinder, something like:

intersection {
   box { //need to make a rounded top
      <-1, 2.5, -.5>
      <1, 3.5, .5>
   }
   cylinder {
      <0, 2, -.5>
      <0, 2, .5>, 1.5
   }

Quote:}

I would change the first coordinate of the box from <-1, 2.5, -.5>
to <-1, 2.4, -.5> to prevent unwanted cracks in your headstone.

Quote:>Also, what is the difference between clipped_by and intersection?

Can I get back to you on that?

-Jack                               |"There's no such thing as a
Responses and flames (but not SPAM) |stupid question, only stupid
welcome at:                         |people who ask questions."
jackbohn at bright dof net          | - Prof Berman

 
 
 

1. Newbie Q: Anti-Aliasing on text...

Ok, after searching archives about this topic, I decided to write since all
that I found got me even more confused that I originaly was.

I'm programming on Windows 95/NT. I want to draw some text on a background and
I want to antialiase it.

I've been trying to find out what PSP, Photoshop and others do when they
anti-aliase, but I can't. What the theory behind it? I'm NOT a mathematician,
so Quadratic and that kind of stuff is way over my head. I'm simply a
programmer... Can I still do it??

If I take for example the letter "A". How would I go at anti-aliasing it?
would I locate all pixels in the letter, then decrease the intensity of that
pixel and paste that pixel around it, then decreasing it and pasting it around
the previous ones?

Does:

00100
00200
12421
00200
00100

does this means that 42" is the middle pixel, and all the "2" above and
besides are adjacent pixels and should be decreased in intensity? same thing
with "1"? Then what would happen to a straight line? using this theory I could
not decrease the intensity of the pixels, since it's straight and don't need
AA except on edges...

Am I WAY off? Are there any examples out there which would be readable to me?

As a reference I'm programming in Delphi 4. I can read C/C++ just fine, so any
examples would be welcome! attachments too!

Thanks for ANY help...

--Eric Fortier

2. alias format conversion

3. Newbie: Alpha channel, Anti aliasing text and 2 channel CCIR 601 video cards

4. LW Surface editing utility?

5. Question on Moviemaker-artifacts

6. Inverse Kinematix IK

7. Oxygen VX1 in Win98 question (weird artifacts)

8. Text around circles (question 2)

9. visual artifacts question

10. Rotation Question - Artifacts

11. Newbie with newbie questions

12. Newbie newbie questions

13. This may sound as a newbie question when really i'm not actually a newbie :)