POV-Ray : Newsgroups : povray.programming : >1600 radiosity samples: right costheta distribution? Server Time
4 Oct 2024 21:12:27 EDT (-0400)
  >1600 radiosity samples: right costheta distribution? (Message 25 to 34 of 34)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Rafal 'Raf256' Maj
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 5 Jan 2003 18:26:53
Message: <Xns92FB456D2A3Fraf256com@204.213.191.226>
"Anders K." <and### [at] kaseorgcom> wrote in
news:3e1744a3$1@news.povray.org 

> Rafal 'Raf256' Maj wrote:
>> much memory
> Uh, it won't? Just the tables for up to 1600 samples would require 3.7
> MB in packed format, and we want to go well beyond that!

MB or KB ? I thought that each record is 3 doubles ?
3*4*8*1600 = 150 kB

3*4*8*1600*1600/2 = 117 MB for array like :
(x), // count=1
(x,x), // count=2
(x,x,x), // count=3
//...
(x,x,x,x,x.....) // count = 1600

117 MB is too big in fact... so maybe generate only support every 10-th 
copunt above 300 ?
so count can be : 1,2,3...299,300, 310,320,330...
and every 20-th >600 600,620,640...
in that way array for count=3000 could be about hmm 50 MB i estimate ?

It can be downloaded as separate file from ftp://


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Warp
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 5 Jan 2003 19:02:44
Message: <3e18c7a4@news.povray.org>
Rafal 'Raf256' Maj <raf### [at] raf256com> wrote:
> in that way array for count=3000 could be about hmm 50 MB i estimate ?

  I don't feel quite comfortable with the program taking so much memory
just for a huge table.
  Perhaps a better (and more memory-saving) method should be developed?

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: Mael
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 6 Jan 2003 04:23:29
Message: <3e194b11$1@news.povray.org>
> then build (x,y,z) with same x,y and z=sqrt(x*x+y*y)

hmm sorry, the correct is z=sqrt(1-x*x-y*y)
I tried it for the halton distribution (see on
http://195.221.122.126/samples/samples.html)

M


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 6 Jan 2003 06:24:21
Message: <Xns92FB7DFB8CF75raf256com@204.213.191.226>
Warp <war### [at] tagpovrayorg> wrote in news:3e18c7a4@news.povray.org

>   I don't feel quite comfortable with the program taking so much memory
> just for a huge table.
>   Perhaps a better (and more memory-saving) method should be developed?

How about allowing only some fixed count numbers, like : 

1..50 increment by 1 - 1,2,3
50..100 inc by 10 - 50,60,70
100,300 inc by 20
300..1000 inc by 50
1000..5000 inc by 200


-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Warp
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 6 Jan 2003 08:35:57
Message: <3e19863d@news.povray.org>
Rafal 'Raf256' Maj <raf### [at] raf256com> wrote:
> How about allowing only some fixed count numbers

  That sounds more like a kludge than a solution. :)

  I was thinking more like storing only some of the points and interpolating
the rest on the fly or whatever.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

From: Rafal 'Raf256' Maj
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 9 Jan 2003 03:01:42
Message: <Xns92FE5BA7EB5C8raf256com@204.213.191.226>
Warp <war### [at] tagpovrayorg> wrote in news:3e19863d@news.povray.org

>> How about allowing only some fixed count numbers
>   That sounds more like a kludge than a solution. :)

but why :) ? I realy doubt if someone will see difference beetween
1043 and 1044 conut...



-- 
#macro g(U,V)(.4*abs(sin(9*sqrt(pow(x-U,2)+pow(y-V,2))))*pow(1-min(1,(sqrt(
pow(x-U,2)+pow(y-V,2))*.3)),2)+.9)#end#macro p(c)#if(c>1)#local l=mod(c,100
);g(2*div(l,10)-8,2*mod(l,10)-8)*p(div(c,100))#else 1#end#end light_source{
y 2}sphere{z*20 9pigment{function{p(26252423)*p(36455644)*p(66656463)}}}//M


Post a reply to this message

From: Mark Weyer
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 10 Jan 2003 04:55:09
Message: <3E1E9B1E.CCBF5699@frege.mathematik.uni-freiburg.de>
> First of all there is no 'correct' distribution, you can only try to
> measure the quality of your sample set and compare it to others.  One
> measurement of quality would be to measure the distance of each point to
> its nearest neighbor - if this is very similar for all samples the
> distribution is quite good (a non uniform distribution is more difficult
> of course).

I do not think that would be a good measurement. In the following
example, the distance to the nearest neighbour is EQUAL for all points
(it is always 1 because the points are paired), while I expect you to
agree
that this is not a good distribution. (The example fills a rectangle,
not a
hemisphere, but that is irrelevant.)

   +----------------------------------------+
   |      *                                 |
   |  **  * *                               |
   |        *  **                           |
   | **                                     |
   |     *   **                             |
   |     *                                  |
   | **     **                              |
   |    **                                  |
   |  *    **                               |
   |  *                                     |
   |                                        |
   |                                        |
   |                                        |
   |                                        |
   |                                        |
   |                                        |
   |                                        |
   |                                        |
   |                                        |
   |                                        |
   +----------------------------------------+

Even if you ,,disallow'' the unevenness depicted here, you are bound
to get grid artefacts, which can be a real killer, if the sample grid
interacts with some object grid in the scene in a moir'e way.

Proposal for quality measurement: Density. Given a subset A of the
space you want to fill, the density is the quotient of the number of
samples inside A and the size (here: area) of A. The density should
not differ much for different A. As we intend a discrete distribution,
we have to restrict the quality measurement to A of a suitable minimum
size.

  Mark


Post a reply to this message

From: Christoph Hormann
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 10 Jan 2003 05:30:38
Message: <3E1EA0CD.ACEF6B4D@gmx.de>
Mark Weyer wrote:
> 
> > First of all there is no 'correct' distribution, you can only try to
> > measure the quality of your sample set and compare it to others.  One
> > measurement of quality would be to measure the distance of each point to
> > its nearest neighbor - if this is very similar for all samples the
> > distribution is quite good (a non uniform distribution is more difficult
> > of course).
> 
> I do not think that would be a good measurement. In the following
> example, the distance to the nearest neighbour is EQUAL for all points
> (it is always 1 because the points are paired), while I expect you to
> agree
> that this is not a good distribution. (The example fills a rectangle,
> not a
> hemisphere, but that is irrelevant.)
> 
> [...]

You are right, this is not a very good measurement.  None the less with
some change it is suited for comparing distributions.  From all
distributions with N points the one with the largest minimum distance
between two points could be considered as the best.  

A different measurement would be calculating the sum of the inverse
distances of every point to all other points.  All this sums together
should be low for a good distribution.

> 
> Proposal for quality measurement: Density. Given a subset A of the
> space you want to fill, the density is the quotient of the number of
> samples inside A and the size (here: area) of A. The density should
> not differ much for different A. As we intend a discrete distribution,
> we have to restrict the quality measurement to A of a suitable minimum
> size.

The problem is that this would not detect anisotropy.  

One important point about radiosity sampling is that the mathematically
best distribution is not necessarily the best for high quality radiosity
results.  As you already mentioned regularity artefacts are a major
problem.  The halton distribution Mael implemented seems to work quite
well at high count values although it is surely not the best in terms of
mathematical quality measurements.  

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 31 Dec. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: Mark Weyer
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 10 Jan 2003 06:06:10
Message: <3E1EABC1.2C2E5C3@frege.mathematik.uni-freiburg.de>
> You are right, this is not a very good measurement.  None the less with
> some change it is suited for comparing distributions.  From all
> distributions with N points the one with the largest minimum distance
> between two points could be considered as the best.

Without having tried I would suspect this to favor grids.

> A different measurement would be calculating the sum of the inverse
> distances of every point to all other points.  All this sums together
> should be low for a good distribution.

Another aspect are boundary effects. Take, for simplicity, a
one-dimensional
example: 4 points in the unit interval. In the optimum one point will be
at 0
and another at one. Because of symmetry the other two will be at x and
1-x.
The function you want to minimze then is 4/x+4/(1-x)+2/(1-2x). The
optimum
due to common sense is x=1/3 while this does not minimize the function:
Its derivative at 1/3 is 9, while it would be 0 at the minimum.

This does not matter though, if the distribution is calculated on a
boundary-less space, such as a torus, and then mapped to the space we
are interested in.

> The problem is that this would not detect anisotropy.

What is anisotropy?

  Mark


Post a reply to this message

From: T J Viking
Subject: Re: >1600 radiosity samples: right costheta distribution?
Date: 6 Feb 2003 08:34:01
Message: <3e426449$1@news.povray.org>
> >> How about allowing only some fixed count numbers
> >   That sounds more like a kludge than a solution. :)
>
> but why :) ? I realy doubt if someone will see difference beetween
> 1043 and 1044 conut...

Ive done such tables in my renderer, storing normal coordinates in float format (not
the double).

Made tables from 4 (4x4) to 32 (32x32) [ as you can see Ive iterated through N
generating NxN samples) and it occupies much less
space

Tabulated ray directions were calculated by computer simulated annealing.
A few variants of distributions: uniform, pure cosine and a few variants of
degenerated BRDFs.
Each variant occupies something like 140KB for full series of samples 4x4, 5x5,...
32x32.

Samples were distributed perfectly, leaving some place to add some noise ("perfect"
Poisson discs).

There is really no need for having tables for 4,5,6,7,8.....4096 samples, just because
from Monte Carlo theorem of reconstruction  2-times increase in samples lowers the
noise sqrt(2).


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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