Kelemen-style MLT small mutation range question

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

Kelemen-style MLT small mutation range question

Postby zsolnai » Sun Apr 15, 2012 6:30 pm

Hello there everyone,

I believe LuxRender and SLG2 (pathgpu2) uses the Kelemen-Szirmay style Metropolis light transport algorithm.

In samplers/metrosampler.cpp line 94
and luxrays\samples\smallluxgpu2\pathocl\kernels\pathocl_kernel_samplers.cpp (around) line 193 I have found this:

Code: Select all
const float dx = s1 / (s1 / s2 + fabsf(2.f * randomValue - 1.f)) - s1 / (s1 / s2 + 1.f);


Two questions:
- is this formula a linear approximation for the s2*exp(-log(...)...) term in the Kelemen paper? [1]
- using the term fabsf(...) instead of randomValue itself is a convolution for the randomValue to alter the distribution?

Also, may I ask how far this implementation is (generally) from the original Kelemen paper?

[1] http://www.iit.bme.hu/~szirmay/paper50_electronic.pdf
zsolnai
Developer
 
Posts: 256
Joined: Sun May 22, 2011 6:17 pm

Re: Kelemen-style MLT small mutation range question

Postby Dade » Mon Apr 16, 2012 2:23 am

zsolnai wrote:I believe LuxRender and SLG2 (pathgpu2) uses the Kelemen-Szirmay style Metropolis light transport algorithm.


Yes, however LuxRender has lazy evaluation and QMC for image coordinates sampling (SLG doesn't).

zsolnai wrote:In samplers/metrosampler.cpp line 94
and luxrays\samples\smallluxgpu2\pathocl\kernels\pathocl_kernel_samplers.cpp (around) line 193 I have found this:

Code: Select all
const float dx = s1 / (s1 / s2 + fabsf(2.f * randomValue - 1.f)) - s1 / (s1 / s2 + 1.f);


Two questions:
- is this formula a linear approximation for the s2*exp(-log(...)...) term in the Kelemen paper? [1]


Yes and it is a lot faster to compute than exp/log.

zsolnai wrote:- using the term fabsf(...) instead of randomValue itself is a convolution for the randomValue to alter the distribution?


It is the same of "if (random() < 0.5) { ...}" pesudo-code at page 7 on Kelemen-Szirmay's paper.

zsolnai wrote:May I ask how far this implementation is (generally) from the original Kelemen paper?


For what I know, LuxRender has a complete implementation of Kelemen's paper plus QMC image sampling. SLG is about the same code but without lazy evaluation (I think it something really inefficient to run a GPU) and QMC.
User avatar
Dade
Developer
 
Posts: 4852
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: Kelemen-style MLT small mutation range question

Postby Lord Crc » Mon Apr 16, 2012 10:46 am

Dade wrote:
zsolnai wrote:- using the term fabsf(...) instead of randomValue itself is a convolution for the randomValue to alter the distribution?


It is the same of "if (random() < 0.5) { ...}" pesudo-code at page 7 on Kelemen-Szirmay's paper.


But you still have the < 0.5 bit there, so why the abs? What am I missing?
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4518
Joined: Sat Nov 17, 2007 2:10 pm


Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 0 guests