POV-Ray : Newsgroups : povray.advanced-users : Stochastics expertise needed : Re: Stochastics expertise needed Server Time
17 May 2024 01:04:01 EDT (-0400)
  Re: Stochastics expertise needed  
From: clipka
Date: 26 Aug 2016 22:21:19
Message: <57c0f91f$1@news.povray.org>
Am 27.08.2016 um 00:38 schrieb Bald Eagle:

> I think that he wants a function, an algorithm, that can be called in the source
> code of POV-Ray, in order to perform a certain task.
> It needs to be a method whereby any given point can be selected at random, and
> the function will evaluate a probability density on the sphere.
> It seems a lot to me like a highlight model.

You've hit the nail right on the head :)

This is intended to become part of a stochastic sampling mechanism,
intended to compute both diffuse interreflections (as currently computed
by radiosity) /and/ blurred reflections (as currently computed by a
dedicated algorithm in UberPOV) in one go.

A simple procedure to achieve that would be as follows:


(1) Pick a random direction, using a uniform distribution.

(2) Trace a ray in that direction to compute how much light comes from
other objects in that driection.

(3) Pretending that we have a light source in that direction, use the
established algorithms for diffuse, specular and phong to compute the
effective brightness the surface would exhibit if it was illuminated
only from this direction.

(4) Repeat, summing up the effective brightness for illumination from a
handful of directions.

(5) Divide the computed sum by the number of rays shot.


However, while this approach is ok for materials where the diffuse
contribution dominates, it's far from ideal when highlights are the
dominant component, since in that case we waste a lot of energy on
directions that contribute virtually nothing.

What we need to do is change the probability distribution of the random
directions. Ideally, the distribution should match the combined BRDF of
the diffuse, specular and phong components, but that might be difficult
to achieve, and besides all we need is a somewhat /similar/
distribution. So that's what I'm searching for.

Obviously however, if we just plug in a different random distribution
into the above mechanism, the regions with high distribution will tend
to be overrepresented in the the result; the solution to that is to
weigh the individual directions' contributions by the inverse of the
probability for picking that particular direction. But that's where I
start to struggle.


To keep things simple, I've decided /not/ to aim for a distribution that
matches a certain combined BRDF, but rather use two different
distributions: One custom-tailored for highlights, and one
custom-tailored for diffuse (cos-weighted should be ideal there). I
would then choose between the two distributions alternatingly or at random.


Post a reply to this message

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