POV-Ray : Newsgroups : povray.beta-test : Radiosity Status: Giving Up... : Re: Radiosity Status: Giving Up... Server Time
28 Jul 2024 22:25:43 EDT (-0400)
  Re: Radiosity Status: Giving Up...  
From: Warp
Date: 29 Dec 2008 17:58:24
Message: <49595610@news.povray.org>
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.)

> So it's definitely less expensive than going via a uniform distribution on a
> sphere in any case. Don't know whether that can be achieved without
> trigonometry, and at least it will involve a root somewhere as well - plus the
> math to get either a cosine weighting or a cosine weighted distribution.

  The whole idea of the given algorithm (ie. get a random point evenly
distributed on a disc and then parallel-project it to a hemisphere
correspondent to that disc) is that you don't need any trigonometry
anymore, and the points will be automatically distributed on the
hemisphere according to the cosine function. (Square root of multiplications
is equivalent to sin/cos.)

-- 
                                                          - Warp


Post a reply to this message

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