POV-Ray : Newsgroups : povray.beta-test : Radiosity Status: Giving Up... : Re: Radiosity Status: Giving Up... Server Time
29 Jul 2024 02:29:11 EDT (-0400)
  Re: Radiosity Status: Giving Up...  
From: andrel
Date: 30 Dec 2008 11:26:07
Message: <495A4BFF.1010405@hotmail.com>
On 30-Dec-08 13:00, Warp wrote:
> andrel <a_l### [at] hotmailcom> wrote:
>> On 29-Dec-08 23:58, Warp wrote:
>>> clipka <nomail@nomail> wrote:
>>>> So yes, that should do: A loop typically taking less than two iterations (the
>>>> most expensive part probably being the RNG) and a square root. Quite
>>>> inexpensive after all.
>>>   When you project the point to the hemisphere, you'll probably need three
>>> multiplications and a square root. That's going to be much more expensive
>>> than the RNG. (High-quality RNGs are very fast. They are faster than a LCG,
>>> which consists of one integer multiplication and addition.)
> 
>> but sin and cos are (much?) more costly than sqrt and multiplication is 
>> comparatively negligible.
> 
>   I was commenting to his estimation that the RNG would be the most
> expensive part of the calculation. Certainly not true. I would estimate
> that one single sqrt() call will be several times slower than pulling a
> value from a high-quality RNG.
> 
sqrt has at worst N/2 iteration, with N the number of significant bits. 
That is a naive implementation. I thought there are even faster 
algorithms. Cheap calculators often have a button for sqrt, implying 
probably that they have a (naive) hardware implementation. I don't know 
if it is available also on more complex processors.


Post a reply to this message

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