Need help with Bidirectional path tracing back
Board: Board index ‹ Ray tracing ‹ !Real time ‹ Off-line
(L) [2011/09/13] [codeboycjy] [Need help with Bidirectional path tracing] Wayback!hi everyone:
i've been working on an open-source offline renderer for a while ( in my spare time )
I'm stuck with BDPT.....
Need some help with that.
i can't fully understand veach's paper.
PBRT doesn't have a BDPT algorithm implemented.
there is a guy named MLJack who finished a BDPT algorithm in PBRT . Bad news is the code is not available anymore.....
He also finish the BDPT algorithm in luxrender , but it's too long for me to fully understand without documentation.( 1500 lines of code )
is there any simple and clean open-source BDPT implementation ?
thanks!
(L) [2011/09/13] [zsolnai] [Need help with Bidirectional path tracing] Wayback!Hello there!
How about the one in 212 lines?  [SMILEY :D]
I have also decided to write a bidirectional path tracer integrator for pbrt. It's not quite done yet, one important problem is to be fixed (EDSSL path contributions are zero), but it is probably very easy to understand.
So, there's an algorithmically okay, but not quite complete code you can play with.
You can find the code, instructions, the problem description, test renders and a test scene here: [LINK http://cg.iit.bme.hu/~zsolnai/gfx/bdpt.zip]
There is a disaster at work, so as much as I'd like, I can't really put time in fixing it in the near future. Maybe if someone has time and interest to do so, it would be highly appreciated!
zsolnai
(L) [2011/09/14] [Dade] [Need help with Bidirectional path tracing] Wayback!>> codeboycjy wrote:PBRT doesn't have a BDPT algorithm implemented.
PBRT2 has a MTL+BDPT Renderer, check the latest version of the book/code.
(L) [2011/09/14] [codeboycjy] [Need help with Bidirectional path tracing] Wayback!thanks for replying!!
And thanks for the code!!!
i've tried to import ur code into my renderer, it seems something is wrong with my renderer.
It's a cornell box rendered using BDPT, there are lots of bright pixels in the corner of the box ( because of the SquaredDistance factor is small ..... )
And i've also tried to run ur code in pbrt , there is no such a problem , so i guess there is some thing wrong in my renderer.
i have little experience in BDPT , i can't tell which part is wrong with my code.....
i would be greatful if anyone could offer me some tips.
Thanks
(L) [2011/09/14] [codeboycjy] [Need help with Bidirectional path tracing] Wayback!BTW, path tracing and direct light integrator works fine in my renderer , i don't know where the bug is and what's worse , i've no idea about how to locate the bug even if with ur code.
(L) [2011/09/14] [ingenious] [Need help with Bidirectional path tracing] Wayback!Looks quite correct to me - you've just discovered how utterly useless BDPT is without multiple importance sampling [SMILEY :)] And that's why one of the Erics rules more than the other one  [SMILEY 8)]
(L) [2011/09/14] [friedlinguini] [Need help with Bidirectional path tracing] Wayback!The image is not necessarily wrong, per se. It's more likely just high variance. Fireflies can be a problem when short explicit path connections are involved. Do you have MIS implemented? Those short paths are more probable from implicit connections, and the higher probability might mitigate the large inverse square.
(L) [2011/09/14] [codeboycjy] [Need help with Bidirectional path tracing] Wayback!Correct ? That's kind of good news for me .
But there is a question:
my method is similar to zsolnai's implementation and BDPT in PBRT ( in Metropolis rendering ) , there is no noise in zsolnai's method , does pbrt do something else to reduce the noise in the corner ?
Actually the weight factor for each path evaluation is quite simple , w = 1.0f / ( light_path_size + eye_path_size ) ......
i don't know where it comes from , in Veach's paper , weight is much more complex than it, but i think there must be a reason for that weight factor.
i don't know if it could be called MIS , because the weighting factor is too simple comparing with Veach's method , if i weight the paths in a more complex way in Veach's paper , will it solve the problem ???
thanks for replying me !!!
(L) [2011/09/14] [ingenious] [Need help with Bidirectional path tracing] Wayback!>> codeboycjy wrote:Actually the weight factor for each path evaluation is quite simple , w = 1.0f / ( light_path_size + eye_path_size ) ......
i don't know where it comes from , in Veach's paper , weight is much more complex than it, but i think there must be a reason for that weight factor.
i don't know if it could be called MIS , because the weighting factor is too simple comparing with Veach's method , if i weight the paths in a more complex way in Veach's paper , will it solve the problem ???
Yes, that's the reason. And it can in fact be called MIS - it's the power heuristic with exponent 0  [SMILEY :D] Now you "only" need to change the exponent to 1 or 2, and the magic will happen  [SMILEY 8)] Requires some head-scratching and implementation though...
(L) [2011/09/15] [codeboycjy] [Need help with Bidirectional path tracing] Wayback!thanks for the advice , i'll have a try.
It seems that u're correct! Some one has encountered the same problem with me.
[LINK http://graphics.ucsd.edu/~iman/BDPT/]
Before doing it , there is something i don't understand , pls help me , thanks
In veach's paper , there is :
[IMG #1 dw_to_da.png]
dw to da
While in PBRT , there is something like: ( page 765 )
Pa = Pw * abs( cos( theta ) ) / ( P[i] - P[i+1] )
which one is right???
[IMG #1]:Not scraped:
/web/20111021152203im_/http://ompf.org/forum/download/file.php?id=782
(L) [2011/09/15] [Dade] [Need help with Bidirectional path tracing] Wayback!>> codeboycjy wrote:Actually the weight factor for each path evaluation is quite simple , w = 1.0f / ( light_path_size + eye_path_size ) ......
But "path size" should not count specular bounces  [SMILEY :idea:]
(L) [2011/09/16] [jeanphi] [Need help with Bidirectional path tracing] Wayback!I did the LuxRender BDPT implementation, and it is an implementation of Veach algorithm. Dade did the Hybrid GPU/CPU version. Most of the code is used to compute the path weighting which is actually quite tricky to get right, especially when taking into account specular bounces and next event estimation. It is however a huge win for noise reduction.
Jeanphi
(L) [2011/09/16] [codeboycjy] [Need help with Bidirectional path tracing] Wayback!I've finally found my home for learning computer graphics......
thanks for everyone here for helping me .
It seems i did have trouble of evaluate the pdf of a specific path ( even if without specular counces )
i'll try to read more to see if i can manage the algorithm myself.
Is ur BDPT implementation for PBRT available ?? (Jeanphi or MLJack)
Is this ur blog?? If it is urs , could u send me a copy of ur PBRT implementation , i want to see how u evaluate the pdf of a specific path.
my email is [LINK mailto:codeboycjy@hotmail.com codeboycjy@hotmail.com] , thanks very much!!!
(L) [2011/09/17] [jeanphi] [Need help with Bidirectional path tracing] Wayback!My implementation is only for LuxRender, but it shouldn't be that different for PBRT. The pdf computation is really tricky when you throw special cases like specular bounces and next event estimation in the mix.
(L) [2011/09/19] [codeboycjy] [Need help with Bidirectional path tracing] Wayback!thank for all the help , thank u !!
(L) [2011/09/19] [ingenious] [Need help with Bidirectional path tracing] Wayback!>> jeanphi wrote:My implementation is only for LuxRender, but it shouldn't be that different for PBRT. The pdf computation is really tricky when you throw special cases like specular bounces and next event estimation in the mix.
But you should also know best how well PBRT is prepared for bidirectional path tracing. There's a bunch of infrastructure and features (including adjoint BSDFs, PDF computation, etc.) that are a prerequisite for BDPT. And I also understand Matt Pharr for opting out of BDPT, as it would complicate the book/code even more.
Unfortunately, since LuxRender is much more advanced than PBRT, its BDPT implementation is probably not the best starting point for a BDPT newbie.
(L) [2011/10/01] [zsolnai] [Need help with Bidirectional path tracing] Wayback!Hello there everyone,
 [SMILEY :!:]
I still would like to emphasize:
You can find the code, instructions, the problem description, test renders and a test scene here: [LINK http://cg.iit.bme.hu/~zsolnai/gfx/bdpt.zip]
So if anyone has enough time (and interest!) on his/her hands, everything is in the readme file(s), I would appreciate any kind of solution for the problem (regardless of how dirty it is).
back