POV-Ray : Newsgroups : povray.programming : Randomly deviated vector : Re: Randomly deviated vector Server Time
18 May 2024 00:58:02 EDT (-0400)
  Re: Randomly deviated vector  
From: Paris
Date: 26 Oct 2006 20:00:01
Message: <web.45414ba4154caab55dbe37df0@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> The radiosity samples in POV-Ray are actually distributed on a hemisphere.
> they were once generated with a good algorithm randomly, but there is
> nothing inherently forcing you to have a fixed table other than speed.
>
> My guess is that ideally you want to use a hemisphere, too, but determined a
> cone is simpler? Or is that a cone as in cone-tracing? Either way, although


The "cone" only appears if you consider a "bundle" of all the vectors going
towards a circular section of a hemisphere.  Imagine what you would do in
order to simulate "fuzzy reflection".  Given the reflected vector, you
would need to deviate it slightly and take several random samples.  This is
precisely what I need.

Many commercial rendering packages already do this.  The difference is that
when I render using 600+ samples I begin to get banding artifacts on the
surfaces.  This happens because the basis vectors "switch" between positive
and negative on places where the largest component switches from one axis to
the next.  I described this in my post already.


> I am not sure I understand your problem correctly, the best advice would be
> to check out: <http://www.boost.org/libs/random/index.html> if you need a
> good set of random number generators. It also comes with a mapping for
> spheres that is really useful.

I can already map to a sphere just fine.  I even posted a link to the
mathematics for uniformly-distributed spheres.  That's not my problem.  My
problem is: how do I then project this random vector (taken from +Y) into a
 generic surface normal N, such that the new random vector is only so many
steradians deviated from N, maximally?   My method seems to work on paper,
but produces banding artifacts for some esoteric reason having to do with
switching of Right into "negative Right" because of projection issues.

Ideally I would not have to ROTATE the vector into position. This is way too
slow. It takes at least 4 calls to trigonometric functions such as sin()
asin() and tan().  It seems like there should be some simple,
straightforward way to just project the Random-vector-deviated-from-Y+ into
the "axis space" of N.   My method seems to do this just fine on paper, but
it produces banding artifacts in the rendered image. I dont know how else I
can explain this in simpler language for you.


Post a reply to this message

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