POV-Ray : Newsgroups : povray.unofficial.patches : SuperPatch / bad triangle Server Time
2 Sep 2024 18:21:54 EDT (-0400)
  SuperPatch / bad triangle (Message 1 to 5 of 5)  
From: edna dornblazer
Subject: SuperPatch / bad triangle
Date: 30 Jun 1999 19:01:52
Message: <377AA19C.7026@geocities.com>
The following triangle makes SuperPatch POV-Ray 
(at least my DJGPP build) crash with SIGSEGV when 
rendered at 320x240. 
Removing the 'reflection' from the triangle lets it render OK
so I assume this is one of those 'reflection normals, etc' 
things.
(The same scene and resolution with official POV goes
fine.)

I am curious as to how it renders in other builds of 
SuperPatch.
/*---------- bad triangle ----------------------------------*/
triangle{
        <75.194025, -159.990988, 51.303515>,
        <-110.075813, -155.973645, -48.712199>,
        <53.753353, 90.153147, 153.284065>

        texture{
                pigment { rgb<1,0,0> }
                finish { reflection .1}
        }
        rotate<0,80,0>
}

camera{
        location <450.00, 0.00, 00>
        look_at <0.00, .00, 0.00>
}
light_source {
        <1100, 100, -200>
        color 1
}

/*-----------------------------------------------*/


Post a reply to this message

From: Ron Parker
Subject: Re: SuperPatch / bad triangle
Date: 30 Jun 1999 21:01:46
Message: <377cbd70.201893467@news.povray.org>
On Wed, 30 Jun 1999 19:00:44 -0400, edna dornblazer
<hac### [at] geocitiescom> wrote:

>The following triangle makes SuperPatch POV-Ray 
>(at least my DJGPP build) crash with SIGSEGV when 
>rendered at 320x240. 
>Removing the 'reflection' from the triangle lets it render OK
>so I assume this is one of those 'reflection normals, etc' 
>things.
>(The same scene and resolution with official POV goes
>fine.)

Works fine in my Windows superpatch too.  Make sure your source has
the lighting.c that's dated June 10.  The older one has a bug when you
use reflection.  There was one other change from that version, too, in
render.c.


Post a reply to this message

From: edna dornblazer
Subject: Re: SuperPatch / bad triangle
Date: 30 Jun 1999 22:30:43
Message: <377AD28B.2BBA@geocities.com>
Ron Parker wrote:

> On Wed, 30 Jun 1999 19:00:44 -0400, edna dornblazer
> wrote:
> >The following triangle makes SuperPatch POV-Ray
> >(at least my DJGPP build) crash with SIGSEGV when
> >rendered at 320x240.
[ ... ]
> Works fine in my Windows superpatch too.  Make sure your source has
> the lighting.c that's dated June 10.  The older one has a bug when you
> use reflection.  There was one other change from that version, too, in
> render.c.

lighting.c and render.c are both from June 10.
My trace says its crashing from Reflect() calling Trace() 
which calls Determine_Apparent_Colour(),
and for some damn reason on the line call to Normal() 
(Triangle_Normal()) which is just a memcpy from and to
a couple of perfectly fine addresses.

Could there be something just so offensive about a 
particular spot (and view of that spot) on a triangle 
that POV acts like this?


Post a reply to this message

From: edna dornblazer
Subject: Re: SuperPatch / bad triangle
Date: 1 Jul 1999 13:17:23
Message: <377BA255.7E0@geocities.com>
edna dornblazer wrote:
> lighting.c and render.c are both from June 10.
> My trace says its crashing from Reflect()
[ ... ]

I think I found it.
In lighting.c, in Reflect():
    
    z = (FRAND() * 2) - 1;
    t = FRAND() * M_PI * 2;
    r = sqrt(1 - z*z);
Well, FRAND*2 (at least with MSDOS/DJGPP) on occasion returns 
numbers slightly bigger than 1.0, and the subsequent 
r=sqrt(negative number) yields NaN vectors a little later.
Replacing the r=sqrt() line with
     r = sqrt(fabs(1 - z*z));
at least lets that stupid triangle render.


Post a reply to this message

From: Ron Parker
Subject: Re: SuperPatch / bad triangle
Date: 1 Jul 1999 14:44:37
Message: <377bb715@news.povray.org>
On Thu, 01 Jul 1999 13:16:05 -0400, edna dornblazer wrote:
>edna dornblazer wrote:
>> lighting.c and render.c are both from June 10.
>> My trace says its crashing from Reflect()
>[ ... ]
>
>I think I found it.
>In lighting.c, in Reflect():
>    
>    z = (FRAND() * 2) - 1;
>    t = FRAND() * M_PI * 2;
>    r = sqrt(1 - z*z);
>Well, FRAND*2 (at least with MSDOS/DJGPP) on occasion returns 
>numbers slightly bigger than 1.0, and the subsequent 
>r=sqrt(negative number) yields NaN vectors a little later.
>Replacing the r=sqrt() line with
>     r = sqrt(fabs(1 - z*z));
>at least lets that stupid triangle render.

Ah, that makes sense.  Windows has a tendency to ignore FP errors.

Hm, I'm piling up all sorts of bugfixes.  Time for a bugfix release,
methinks.  Now to find them all...


Post a reply to this message

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