POV-Ray : Newsgroups : povray.binaries.images : Re: bug: crackle metric 1 (9kbbu) : Re: bug: crackle metric 1 (9kbbu) Server Time
1 Sep 2024 22:14:02 EDT (-0400)
  Re: bug: crackle metric 1 (9kbbu)  
From: Ron Parker
Date: 18 Sep 2000 11:22:53
Message: <slrn8scdiv.3s4.ron.parker@fwi.com>

>Anton Sherwood wrote:
>> 
>> crackle solid metric 0.9, 1.0, 1.1
>> 
>	Shouldn't metric be always an integer? metric 1 looks like what I would
>expect anyway...

There is no reason why metric must be an integer, though using values other
than 1 or 2 can slow down the rendering.  Metric 1 looks like it's broken,
and in fact it is:

    VSub(dv, TPat->Vals.Crackle.cv[i], tv);

        if ( UseSquare ) {
            sum  = VSumSqr(dv);
                if ( Offset ) sum += Offset*Offset;
        }
    else if ( UseUnity ) {
            sum = dv[X] + dv[Y] + dv[Z];
            if ( Offset ) sum += Offset;
    }
    else {
            sum = pow( fabs( dv[X] ), Metric ) +
                      pow( fabs( dv[Y] ), Metric ) +
                          pow( fabs( dv[Z] ), Metric );
            if ( Offset ) sum += pow( Offset, Metric );
    }

Note that in the metric=1 case (UseUnity) it doesn't take the absolute
values of the components of dv, whereas in the default case it does.  The
default case is the correct one.  This same fix must be made in the case 
of the three minimum distance calculations before the loop.

-- 
Ron Parker   http://www2.fwi.com/~parkerr/traces.html
My opinions.  Mine.  Not anyone else's.


Post a reply to this message

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