POV-Ray : Newsgroups : povray.programming : Re: Making Media look like Halo (was Re: Lake Two ...) : Re: Making Media look like Halo (was Re: Lake Two ...) Server Time
28 Jul 2024 18:11:45 EDT (-0400)
  Re: Making Media look like Halo (was Re: Lake Two ...)  
From: Mike
Date: 20 Aug 1999 14:15:11
Message: <37BD9947.75818009@aol.com>
> Actually, the way it currently works ensures a reasonably fair distribution of
> samples whose average should converge toward the actual average of the interval.
> My way also gives a somewhat fair distribution, though it's biased toward the
> near end of the interval unless the number of samples is a power of two.
>

I agree that your method works well within the current sample splitting method.  It's
a
good way to go about having an even distribution while still allowing for the
confidence
and variance variable to do their work.

> Just using
>
>   d0=Interval->ds*Interval->samples / max_samples;
>
> (assuming you had access to max_samples) would heavily bias toward the near end
> of the interval, only sampling the far end when the near end has high variance.
> If your interval happens to fall across a sharp transition between two basically
> flat regions, and if min_samples/max_samples is small, you might never see the
> differing values at the far end of the interval.

That's why I said I would need to add supersampling.  Instead of stepping along the
ray
at even intervals that are based on max_samples, I would do it with min_samples and
sample between each one to do the supersampling - max_samples would be ignored.
Supersampling is going to require a lot more work and design modications beyond what
I've done so far, and I liked the suggestion of adding a sampling_method keyword for
this purpose.  Here's what I have so far:

Step_Size = Interval->ds / Least_Samples;

d0 = Interval->ds * Interval->samples / Least_Samples + (Step_Size * (FRAND() * 1));

I added Least_Samples to the function sample_media and pass IMedia->Min_Samples to it
prior to using the function (this is just a quick workaround).  FRAND() really should
be
multiplied by a user-defined variable but I put it there to illustrate how much this
looks like the current implimentation of media when the samples are fully randomized.

Now I haven't tried this yet, but my theory is that, if at the end of each time
through
sample_media we make:

Prev_Sample = Current_Sample

Than a supersample_media function could compare the two and if they vary by more than
a
certain value take additional samples (call itself recursively) between them until
either a max_level is reached or the extra samples don't vary enough.  All I'm doing
is
comparing how it was done with atmosphere, which we know yielded good results in a
relatively short span of time. :)

I haven't slept since I started doing this.  hee hee...think I'll go do that now.

-Mike


Post a reply to this message

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