POV-Ray : Newsgroups : povray.unofficial.patches : small mp bug Server Time
1 Nov 2024 11:15:49 EDT (-0400)
  small mp bug (Message 1 to 3 of 3)  
From: Tom Melly
Subject: small mp bug
Date: 24 Nov 2000 11:31:14
Message: <3a1e97d2$1@news.povray.org>
Hi,

the following renders fine in pov 3.1, but a small artifact appears on the
top-middle of the super elip. in megapov 0.6a. I'm using win2000 - any
thoughts?

// buggy code

#include "colors.inc"

camera{location<0,1,-20> look_at 0}
light_source{<5,5,-20> color 2}

#declare bug_block =
superellipsoid {
  <0.25, 0.25>
  scale <5,6.75,2>
  translate y*-2.25
  pigment{Gray50}
}

object{bug_block translate y*2}


Post a reply to this message

From: Pabs
Subject: Re: small mp bug
Date: 27 Nov 2000 00:11:00
Message: <3A21ED39.E9C06226@hotmail.com>
Tom Melly wrote:

> the following renders fine in pov 3.1, but a small artifact appears on the
> top-middle of the super elip. in megapov 0.6a.

It only seems to show up at high resolutions - 800x600 & above
Possibly to do with the camera location (since moving the camera lessens the
artifact).
It doesn't show up in MP0.5a but Nathan's history file say's that WMP0.6
"30.Fixed occasional artifacts in superquadratic ellipsoid." but it seems that

they were introduced rather than fixed.

--
Bye
Pabs


Post a reply to this message

From: Jérôme Grimbert
Subject: Re: small mp bug
Date: 1 Dec 2000 03:21:14
Message: <3A275F79.380BD500@atos-group.com>
Pabs wrote:
> 
> Tom Melly wrote:
> 
> > the following renders fine in pov 3.1, but a small artifact appears on the
> > top-middle of the super elip. in megapov 0.6a.
> 
> It only seems to show up at high resolutions - 800x600 & above
> Possibly to do with the camera location (since moving the camera lessens the
> artifact).
> It doesn't show up in MP0.5a but Nathan's history file say's that WMP0.6
> "30.Fixed occasional artifacts in superquadratic ellipsoid." but it seems that
> 
> they were introduced rather than fixed.

Oh no. It take me about 4 days to understand what was happening with
the provided scene (I'm not that quick :-)) and about 30 seconds
to fix it. (that's when the light stricks!)

If Nathan did apply the same patch I did to superellipsoid
 (which was to remove the two bogus affectations at the end
of the intersec_box function), I know why you get some artifact, and
how to remove them.

the artifact are the image of the second intersection of the 
superellipsoid (whereas normally you only see the first intersection).

BTW: did you know that the 'return_all_intersection' function for the
superellipsoid would always return only ONE if the superellipsoid is
not inside a CSG construct ?

The fact that the ray, when hitting the outside box (not the bounding box)
will provide two points, and that the first point is not on the superellipsoid
but that the second one *IS* on the superellipsoid will trigger the artifact,
because in the computation of surface, there is first a check with all the
hint points. *THEN* if there is no match (and no inversion of sign between
two hint points) there is a search for a possible *INTERMEDIATE* point.

The previous patch was (and is still) correct, but because it is 
mathematicaly more accurate, there is the same kind of problem as
there is with coincident surface : the floating point representation
will round the mathematic formula.
Sometime the round is to the outside (no problem), sometime it is toward
the inside of the surface: as these two points are the limits for the
search of the superellipsoid surface, if the rounding makes the limit cross
the superellipsoid surface, the artifact might come in.

My obvious correction is to add 1% to the MAX_VALUE and MIN_VALUE used to 
delimit the outside box, so that the outside box should never touch
the superellipsoid surface, so that the rounding will never make 
any of the two points cross the surface again.

so the correction is in super.c

#define MAX_VALUE  1.01
#define MIN_VALUE -1.01


Comments are welcome...


Post a reply to this message

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