POV-Ray : Newsgroups : povray.newusers : max(0,min(1,x)) : Re: max(0,min(1,x)) Server Time
5 Sep 2024 00:15:29 EDT (-0400)
  Re: max(0,min(1,x))  
From: Marc-Hendrik Bremer
Date: 2 Oct 2002 11:36:13
Message: <3d9b126d@news.povray.org>
"Rafal 'Raf256' Maj" <raf### [at] raf256com> schrieb im Newsbeitrag
news:Xns### [at] 204213191226...
> "Marc-Hendrik Bremer" <Mar### [at] t-onlinede> wrote in
> news:3d9aec64@news.povray.org
>
> > There is really no need to build in everythink in the
> > Pov-Code.
>
> speed ?
> We have i.e. 1 room (inverted box) inside with we have camera, lightsource
> and i.e. white sphere.
> Box is covered with function with 1-3 constructions like
> max(0,min(1,x+y...))
>

I don't understand what you want to do here (covered? with a pigment, a
normal? an isosurface)? If a color_map of some sort is used, then there's no
need to use a clipping function at all.

> And now we add radiosity - fo reach pixel formula min(max(... must be
> counted about 10..50 times depending on radiosity setting - that can
> probably give 5-15% of render time lost. Hmm I guess I should just add
this
> minmax() function and see is speed improvment notacible :)

The speed increase will strongly depend on the other thinks you use in the
scene. A quick 'n dirty test gave me 0,0000073 seconds for one function call
parsed and evaluated. I don't think, that pov will have to parse the
function for every ray if you use it in a pattern or even an isosurface
(don't know for sure though).
Implement your minmax()-function, if you want to, but if you need only one
day to do it, you will have to use your function quite a lot to get your
time back :-) I'm no programmer at all, so I'm happy about everything that
makes "my life" easier - but if the parser takes longer and longer to parse
even a simple scene, because there are too many keywords to check, it
doesn't make my life easier but harder.

Greetings,

Marc-Hendrik


Post a reply to this message

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