POV-Ray : Newsgroups : povray.unofficial.patches : Sampling in pov3.5 Server Time
5 Jul 2024 14:37:34 EDT (-0400)
  Sampling in pov3.5 (Message 23 to 32 of 32)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Anders K 
Subject: Re: Sampling in pov3.5
Date: 5 Jan 2003 19:07:41
Message: <3e18c8cd@news.povray.org>
Christoph Hormann wrote:
> I have made some first actual renders with new distributions, here are
> some results:

I'm curious -- could you also try random sampling, without using precomputed
tables?

Anders

--
#macro E(D)(#if(D<2)D#else#declare I=I+1;mod(pow(.5mod(I 6))*asc(substr(
"X0(1X([\\&Q@TV'YDGU`3F(-V[6Y4aL4XFUTD#N#F8\\A+F1BFO4`#bJN61EM8PFSbFA?C"
I/6 1))2)<1#end)#end#macro R(D,I,T,X,Y)#if(E(D))R(D-1I,T,Y/2X)R(D-1I,T+Y
/2Y/2X)#else box{T T+X+Y pigment{rgb E(2)*9}}#end#end R(10,5z*3-1v*2u*2)


Post a reply to this message

From: Warp
Subject: Re: Sampling in pov3.5
Date: 5 Jan 2003 22:48:41
Message: <3e18fc99@news.povray.org>
Anders K. <and### [at] kaseorgcom> wrote:
> I'm curious -- could you also try random sampling, without using precomputed
> tables?

  I would guess that this might add more graininess to the lighting, as the
amount and color of the light will change more randomly from one sampling
point to the next. This might also make it slower as the algorithm can't
reuse old values so often (because now they change more than the error bound
threshold more often).
  (Naturally I can't know for sure as I only have a vague idea about how
Ward's stochastic global illumination algorithm works. This was just a
guess.)

-- 
#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: Mael
Subject: Re: Sampling in pov3.5
Date: 6 Jan 2003 08:07:38
Message: <3e197f9a$1@news.povray.org>
> The third image shows the result when using a completely uniform
> distribution and weighting the samples according to cosine theta.  The
> result seems worse although a final conclusion would require further
> tests.  The interesting thing is that turning off the different weighting
> strongly weakens the artefacts (fourth image).

there is an error in the comment in povray source code, the samples are
distributed according to cos(theta)*sin(theta) (we can also confirm this by
looking at the illuminance integral)
I've made a graph with the distribution for the pov samples (compared to cos
and cos*sin) at http://195.221.122.126/samples/proba.jpg

M


Post a reply to this message

From: Christoph Hormann
Subject: Re: Sampling in pov3.5
Date: 6 Jan 2003 08:14:50
Message: <3E19814A.5E148BDE@gmx.de>
Mael wrote:
> 
> there is an error in the comment in povray source code, the samples are
> distributed according to cos(theta)*sin(theta) (we can also confirm this by
> looking at the illuminance integral)
> I've made a graph with the distribution for the pov samples (compared to cos
> and cos*sin) at http://195.221.122.126/samples/proba.jpg

I am not sure what you measure in that graph but when i talk about 'cosine
theta distribution' i mean the density of the samples (i.e. the inverse of
the mean distance between samples).  Of course there are very few samples
at small theta because the region of the hemisphere with small theta is
small - none the less the density is high.

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: Mael
Subject: Re: Sampling in pov3.5
Date: 6 Jan 2003 08:22:34
Message: <3e19831a@news.povray.org>
> I am not sure what you measure in that graph

This graph shows the probability to have a ray for a given theta (theta =
deviation / normal)

M


Post a reply to this message

From: Mael
Subject: Re: Sampling in pov3.5
Date: 6 Jan 2003 08:26:11
Message: <3e1983f3@news.povray.org>
And the same for the halton sequence :
http://195.221.122.126/samples/proba2.jpg

M


Post a reply to this message

From: Mael
Subject: Re: Sampling in pov3.5
Date: 6 Jan 2003 08:31:59
Message: <3e19854f@news.povray.org>
> I am not sure what you measure in that graph but when i talk about 'cosine
> theta distribution' i mean the density of the samples (i.e. the inverse of
> the mean distance between samples).  Of course there are very few samples
> at small theta because the region of the hemisphere with small theta is
> small - none the less the density is high.

ok, i understand, if I divide by the area for a theta, I will get the
cos(theta) distribution
this is more clear now :)

M


Post a reply to this message

From: Christoph Hormann
Subject: Re: Sampling in pov3.5
Date: 6 Jan 2003 08:33:39
Message: <3E1985B2.AEED713C@gmx.de>
Mael wrote:
> 
> > I am not sure what you measure in that graph
> 
> This graph shows the probability to have a ray for a given theta (theta =
> deviation / normal)

This is of course something different.  I think the sin(theta) factor is
logical then.

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: Mael
Subject: Re: Sampling in pov3.5
Date: 6 Jan 2003 09:08:40
Message: <3e198de8$1@news.povray.org>
I was thinking about computing the discrepancy (for different numbers of
samples), to see what are the best values for count with the current samples
data in pov
I found a description to compute the star discrepancy, but only for uniform
distribution in a unit square
http://mathworld.wolfram.com/StarDiscrepancy.html
http://ina.eivd.ch/Collaborateurs/etr/research.html

As i don't know how to adapt it for a disc, I decided to map the disc to a
square
(x,y) the sample in the disc gives nx=x*x+y*y and ny=atan2(y,x)/(2*pi)+.5 in
the square unit

But when applying this transformation to povray samples I get those bad
looking results (at least for small N)
http://195.221.122.126/samples/rad_square010.jpg
http://195.221.122.126/samples/rad_square020.jpg
http://195.221.122.126/samples/rad_square050.jpg
http://195.221.122.126/samples/rad_square100.jpg

So I wonder if it's a good way to measure the discrepancy
Or is the povray distribution not that good ?

M


Post a reply to this message

From: Anders K 
Subject: Re: Sampling in pov3.5
Date: 6 Jan 2003 13:53:42
Message: <3e19d0b6$1@news.povray.org>
Mael wrote:
> As i don't know how to adapt it for a disc, I decided to map the disc to a
> square

That would distort the disc in all sorts of ways, so the bad results aren't
surprising.

Anders

--
#macro E(D)(#if(D<2)D#else#declare I=I+1;mod(pow(.5mod(I 6))*asc(substr(
"X0(1X([\\&Q@TV'YDGU`3F(-V[6Y4aL4XFUTD#N#F8\\A+F1BFO4`#bJN61EM8PFSbFA?C"
I/6 1))2)<1#end)#end#macro R(D,I,T,X,Y)#if(E(D))R(D-1I,T,Y/2X)R(D-1I,T+Y
/2Y/2X)#else box{T T+X+Y pigment{rgb E(2)*9}}#end#end R(10,5z*3-1v*2u*2)


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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