POV-Ray : Newsgroups : povray.general : random-generator-bug ? speckled photon-mapping Server Time
5 Nov 2024 07:15:23 EST (-0500)
  random-generator-bug ? speckled photon-mapping (Message 1 to 4 of 4)  
From: chefboss
Subject: random-generator-bug ? speckled photon-mapping
Date: 18 Aug 2007 14:25:00
Message: <web.46c7386b86ebcca6f43f7c30@news.povray.org>
When rendering a test-scene,
http://www.manganese-blue.com/povrandombug/test.pov ,
containing a sphere with refraction-index so that the focal point is near
the surface, the transmitted light appears speckled, no matter how many
photons I use.
The ready-rendered pics and the testfiles (since I may not upload anything
here)
are under
    http://manganese-blue.com/index.php?main_page=page_2

To me it seems like the random-generator were not so random, the effect
beeing amplified by the close-to-the-surface focal-point of the sphere.

I have examined the source, and it seems that the standard-c
"rand()"-function is used; unfortunately on my debian/etch the source does
not compile right (see 2 or 3 threads below), and I'm not a c-guru either.
So I did _not_ succeed in compiling-in other random-generators for testing
....

But I played around with the rand()-function, and it really seems to be not
equally distributed in some ways, but I'm still experimenting on that right
now.

So: How about the effect from above ?


Post a reply to this message

From: Christian Froeschlin
Subject: Re: random-generator-bug ? speckled photon-mapping
Date: 18 Aug 2007 17:04:53
Message: <46c75ef5$1@news.povray.org>
chefboss wrote:

> To me it seems like the random-generator were not so random, the effect
> beeing amplified by the close-to-the-surface focal-point of the sphere.

I don't think it's random, the photons will be shot in spirals at the
target object. With the extreme ior, it is probable that this may cause
a distinct pattern in areas where the photons are spread thinly. To get
rid of this would require to really crank up the number of photons.

Looks ok with 2.000.000 photons here (but slow). The behavior is
actually rather strange, even 1.000.000 photons render instantly
and the result is crap, 1.500.000 photons take ages and look ok.
It's not the memory usage. I wonder what happens internally.


Post a reply to this message

From: Tim Attwood
Subject: Re: random-generator-bug ? speckled photon-mapping
Date: 18 Aug 2007 19:23:03
Message: <46c77f57$1@news.povray.org>
> When rendering a test-scene,
> http://www.manganese-blue.com/povrandombug/test.pov ,
> containing a sphere with refraction-index so that the focal point is near
> the surface, the transmitted light appears speckled, no matter how many
> photons I use.
> The ready-rendered pics and the testfiles (since I may not upload anything
> here)
> are under
>    http://manganese-blue.com/index.php?main_page=page_2

In your scene with the 1.7 ior sphere, the area covered by photon
caustics is large, therefore you need many many more photons.
Calculating photons is processor intensive, it may take several
hours to properly render something like this to look right. That is
the reason for the photon settings, you can get an idea of what
your scene will look like before you do a final high quallity render
with a large count, or with a small spacing.

I also noticed that you used several identical light sources to
have increased brightness. You can accomplish this by
having a multiplier after your light color.
light_source {< 32, 11, -20> color LightGray*5}
Extra lights take extra rendering time, and more importantly in this
instance, the number of photons cast per light is lower because
of the ratio of total photon count to the number of lights.

> To me it seems like the random-generator were not so random, the effect
> beeing amplified by the close-to-the-surface focal-point of the sphere.
>
> I have examined the source, and it seems that the standard-c
> "rand()"-function is used; unfortunately on my debian/etch the source does
> not compile right (see 2 or 3 threads below), and I'm not a c-guru either.
> So I did _not_ succeed in compiling-in other random-generators for testing
> ....
>
> But I played around with the rand()-function, and it really seems to be 
> not
> equally distributed in some ways, but I'm still experimenting on that 
> right
> now.

It's my understanding that photons are cast in a spiral from a light source
in the direction of a target, not randomly. Identical lights are casting
photons which group in the same locations, making the caustics "spot"
a bit more than they would anyway. Fix the lights and use something like
spacing 0.001 and you'll probably have it look great after several hours.


Post a reply to this message

From: Alain
Subject: Re: random-generator-bug ? speckled photon-mapping
Date: 18 Aug 2007 22:51:33
Message: <46c7b035$1@news.povray.org>
chefboss nous apporta ses lumieres en ce 2007/08/18 14:20:
> When rendering a test-scene,
> http://www.manganese-blue.com/povrandombug/test.pov ,
> containing a sphere with refraction-index so that the focal point is near
> the surface, the transmitted light appears speckled, no matter how many
> photons I use.
> The ready-rendered pics and the testfiles (since I may not upload anything
> here)
> are under
>     http://manganese-blue.com/index.php?main_page=page_2
> 
> To me it seems like the random-generator were not so random, the effect
> beeing amplified by the close-to-the-surface focal-point of the sphere.
> 
> I have examined the source, and it seems that the standard-c
> "rand()"-function is used; unfortunately on my debian/etch the source does
> not compile right (see 2 or 3 threads below), and I'm not a c-guru either.
> So I did _not_ succeed in compiling-in other random-generators for testing
> ....
> 
> But I played around with the rand()-function, and it really seems to be not
> equally distributed in some ways, but I'm still experimenting on that right
> now.
> 
> So: How about the effect from above ?
> 
> 
> 
> 
The basic distribution of photons is NOT RANDOM AT ALL! It follows a spiraling 
path starting in the center of the bounding box of the target object.

You set jitter 0 = zero jittering = zero randomness in the photons distribution. 
So, the random number generator is never used!

You use several coincident lights, uselessly increasing the render time and 
giving no benefit at all. Also, all 5 will place there photons in the same 
locations. 5 coinsident light + one slightly offset one = 6 lights.
200 000 / 6 = 33 3333 photons shoot by each light. 5 are at the same location: 
so, you get 5 photons at the exact same location. This will obviously increase 
the speckeling.
If you want a more intense light, just use an RGB value larger than 1. There is 
NO maximum. Light_Gray is about 66%. You use 5 such lights. Beter to use 1 light 
with rgb 0.658824*5 or Light_Gray*5 or rgb 3.29412.
When using count, it's easy to get overimpressed/intimidated/frighten by how 
large the value have to be set. You often need count 2000000 or more to get good 
results.
Alternatively, you can use spacing. It sets the aproximate separation between 2 
photons in units. In your case, a spacing of about 0.05 coulb a good start. 
Decrease that if needed.
Remove jitter 0 from the photons block if you want to have some randomness in 
the distribution.

Solution:
Change
light_source {< 31, 12, -20> color White}//total 1
light_source {< 32, 11, -20> color LightGray}
light_source {< 32, 11, -20> color LightGray}
light_source {< 32, 11, -20> color LightGray}
light_source {< 32, 11, -20> color LightGray}
light_source {< 32, 11, -20> color LightGray}//total 3.29412

to

light_source{<32, 11, -20> color LightGray*5}

Side note: if you set reflection 0, it's beter just to not put reflection.

-- 
Alain
-------------------------------------------------
Drive A: not responding.. .Formating C: instead


Post a reply to this message

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