POV-Ray : Newsgroups : povray.binaries.images : Bocce - WIP : Re: Bocce - WIP Server Time
10 Dec 2024 06:51:47 EST (-0500)
  Re: Bocce - WIP  
From: Chris R
Date: 19 Jun 2024 10:15:00
Message: <web.6672e7992d85bd69a364adf25cc1b6e@news.povray.org>
"Chris R" <car### [at] comcastnet> wrote:
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > "Chris R" <car### [at] comcastnet> wrote:
> >
> > > One of the things that really helps with this is having a version of
> > > f_rounded_box that more accurately returns the distance of a point from the
> > > surface of the box.  That allows me to simply add/subtract other pigment
> > > functions with a depth I can model to the shape function in the isosurface.
> > > It's much slower than the built-in f_rounded_box, but gives more controllable
> > > results.
> >
> > Interesting.
> > What equation are you using?
> >
> > I'm wondering if you might benefit from this:
> >
> > https://iquilezles.org/articles/distfunctions/
> >
> > - BW
>
> Thanks for the link!  I'll have to compare them to what I wrote.  For my rounded
> box I basically constructed it from boxes, cylinders, and spheres for which I
> had exact distance functions; this version is much more elegant.
>
> -- Chris R.
I started with the rounded box function in the article and compared it to my
implementation, both just a straight box, and with noise added for a bumpy
surface.

First note:  The images are identical in both cases, so both functions are
computing the same thing.

Second note:  my version is 10X slower than Quilez version!

So, I will be replacing my version with the Quilez version in my code library,
and updating the library with all of the shapes from the article over time.

There is a little work in the porting, because POV-Ray functions don't take
vector arguments, so you have to unroll all of the vectors as x,y,z parameters,
but otherwise it was pretty simple.

Thanks again for the pointer!  I'm looking forward to faster renders...

-- Chris R


Post a reply to this message

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