POV-Ray : Newsgroups : povray.general : Slightly faster VRand_On/In_Sphere() Server Time
4 Aug 2024 00:26:02 EDT (-0400)
  Slightly faster VRand_On/In_Sphere() (Message 11 to 20 of 30)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Rune
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 8 Nov 2003 11:11:00
Message: <3fad1594$1@news.povray.org>

> I suggest to replace the original rand.inc macros by these macros.

Even if the distribution of these functions are indeed even, it should
still be considered that some scenes made using the current macros may
be designed to depend on their exact output, not just the distribution.
(Just like some scenes were made to depend on the old noise_generator
before it was changed in POV-Ray 3.5.) This means that if new macros
with different output are introduced, backward compatible alternative
macros must be provided as well. This however, doesn't necessarily
prevent some users from being confused when their scenes suddenly look
different, if they're not aware of the new macros that have replaced the
old ones.

Now the question is: Is the 9% speed increase worth the hassle with the
backwards compatibility issue? I'm not for or against, I just want to
make sure that the issue is being considered.

Rune
--
3D images and anims, include files, tutorials and more:
rune|vision:  http://runevision.com **updated Sep 28**
POV-Ray Ring: http://webring.povray.co.uk


Post a reply to this message

From: Christopher James Huff
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 8 Nov 2003 12:49:14
Message: <cjameshuff-EDDF1A.12480208112003@netplex.aussie.org>
In article <3fac3188@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   (Btw, has anyone proven mathematically that the current official
> macros produce even distributions?)

Well, I've done empirical tests that seem to show that they do. And come 
up with another interesting fact: points on a sphere are uniformly 
distributed on each axis. Makes sense once you realize why (The 
boundaries of each slice subtend a greater angle as you near the edge of 
the sphere, where the radius is smaller. Any two slices through a sphere 
of the same thickness have the same surface area.), but a bit surprising 
to realize.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Warp
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 8 Nov 2003 13:10:51
Message: <3fad31ab@news.povray.org>
Rune <run### [at] runevisioncom> wrote:
> Now the question is: Is the 9% speed increase worth the hassle with the
> backwards compatibility issue? I'm not for or against, I just want to
> make sure that the issue is being considered.

  Probably not worth.

  To get a speed boost you can simply copy the macro from the include
file to your scene file. This should noticeably increase its speed due
to how POV-Ray parses macros in include files.

-- 
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}//  - Warp -


Post a reply to this message

From: Christopher James Huff
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 8 Nov 2003 16:28:44
Message: <cjameshuff-FFFF7F.16272608112003@netplex.aussie.org>
In article <3fad31ab@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> Rune <run### [at] runevisioncom> wrote:
> > Now the question is: Is the 9% speed increase worth the hassle with the
> > backwards compatibility issue? I'm not for or against, I just want to
> > make sure that the issue is being considered.
> 
>   Probably not worth.
> 
>   To get a speed boost you can simply copy the macro from the include
> file to your scene file. This should noticeably increase its speed due
> to how POV-Ray parses macros in include files.

A speed boost, but for a different reason. This new version is indeed 
faster (by 12% by my measurements...call it 10%). It's also shorter and 
easier to understand. I doubt there would be very many scenes that would 
be adversely affected. The macro versions defined could be made 
conditional on the POV-Ray #version, or just left alone with slightly 
modified names. It's a small improvement, but I think it would be worth 
it...assuming the macros can be proven to work right. (They seem to, 
from my measurements, but I haven't proven it.)

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Slime
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 8 Nov 2003 16:43:09
Message: <3fad636d$1@news.povray.org>
> Now the question is: Is the 9% speed increase worth the hassle with the
> backwards compatibility issue? I'm not for or against, I just want to
> make sure that the issue is being considered.

Is it possible to use SDL to determine the current #version, and then define
a different macro based on that? Then the better versions could be used for
scene files marked for version 3.5.1 (or whatever), and the older versions
used for older scene files.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Wolfgang Wieser
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 8 Nov 2003 18:01:27
Message: <3fad75c6@news.povray.org>
Christopher James Huff wrote:

> it...assuming the macros can be proven to work right. (They seem to,
> from my measurements, but I haven't proven it.)
> 
What exactly do you understand by a "proof"?

Wolfgang


Post a reply to this message

From: Tim Cook
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 8 Nov 2003 18:33:27
Message: <3fad7d47$1@news.povray.org>
Wolfgang Wieser wrote:
> What exactly do you understand by a "proof"?

Alchohol content of a beverage, percentage divided by half.


Post a reply to this message

From: Warp
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 8 Nov 2003 20:54:23
Message: <3fad9e4f@news.povray.org>
Wolfgang Wieser <wwi### [at] gmxde> wrote:
> What exactly do you understand by a "proof"?

  Mathematical proof. Should be unambiguous and checkable by anyone.

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Stephen McAvoy
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 9 Nov 2003 04:14:51
Message: <ub1sqvs1c3mmhmdjce4773gn691tvobnvf@4ax.com>
On Sat, 08 Nov 2003 18:34:08 -0500, Tim Cook <z99### [at] bellsouthnet> wrote:

>Alchohol content of a beverage, percentage divided by half.


Only the English could invent 'proof' in 1762, which was the technical standard
by which strength was measured until 1st January, l980.   If  gunpowder and
alcohol were mixed and  the spirit was weaker than proof strength (57% ABV),
there was just a damp fizzle. However, when whisky and gunpowder were mixed  and
there was enough alcohol in the mixture to cause ignition, then the gunpowder
flashed, providing the 'proof' of  stronger alcohol.  

To compare: Gay Lussac's ABV to UK and US Proof:

100% (Pure alcohol)  =  175 UK Proof  = 200 US proof 
50% =  87.5 UK Proof = 100 US proof
46% =   80.5 UK Proof = 92 US prof

For UK proof  multiply ABV by 1.75, for US double it

Regards
        Stephen


Post a reply to this message

From: Tim Cook
Subject: Re: Slightly faster VRand_On/In_Sphere()
Date: 9 Nov 2003 05:09:37
Message: <3fae1261$1@news.povray.org>
Stephen McAvoy wrote:
> On Sat, 08 Nov 2003 18:34:08 -0500, Tim Cook <z99### [at] bellsouthnet> wrote:
>>Alchohol content of a beverage, percentage divided by half.
> To compare: Gay Lussac's ABV to UK and US Proof:
> 100% (Pure alcohol)  =  175 UK Proof  = 200 US proof 
> 50% =  87.5 UK Proof = 100 US proof
> 46% =   80.5 UK Proof = 92 US prof

There, see?  I was right by way of accident in wording my formula;
dividing something BY half, not IN half, is the same as multiplying
by two...haha!  *sweatdrop*  *hides*


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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