My little path tracer

Show-off, reference material & tools.
dawelter
Posts: 40
Joined: Sun Oct 29, 2017 3:15 pm
Location: Germany

Re: My little path tracer

Post by dawelter » Fri Mar 16, 2018 8:34 am

I think I squashed the worst bugs. This is fun stuff.
parabolic_reflector_volumetric.jpg
parabolic_reflector_volumetric.jpg (477.89 KiB) Viewed 4828 times
A perfectly parallel beam send through a scattering medium. The sphere is made of a much denser medium. It is sub surface scattering with brute force BDPT.
boxy_laser.jpg
boxy_laser.jpg (428.54 KiB) Viewed 4828 times

dawelter
Posts: 40
Joined: Sun Oct 29, 2017 3:15 pm
Location: Germany

Re: My little path tracer

Post by dawelter » Sat Mar 24, 2018 8:38 am

I threw a "real world" scene at it. Thinking about how else I could exploit volume caustics in lack of refractive materials, I figure it would be cool to build a solar thermal power plant model. :-D

Modelled in Stud.io and Cinema 4D.
677761 Triangles, most of them occluded due to the bricks being stuck in each other.
8700 SPP in 34 h :?

The scene is contained in a box with a scattering medium, obviously. Fireflys due to SDS paths? I'm not sure, but I suppose there can be paths from camera to mirror to volume scattering to mirror to sun. The sun spans a small solid angle, so there is a non-zero chance to hit it with a "forward path" like that and it would be the only technique in Veach's sense to generate the path. Makes sense?

There is also some sort of "light leak" on the first mirror.
solarlego.jpg
solarlego.jpg (358.62 KiB) Viewed 4716 times
EDIT: Hm .. after some testing the strange "leak" appears to be no bug after all. I'll write it off as caustic cast by the mirror behind the one with the "leak".

Here is another shot. Moved the rear mirror a bit to see more of the caustics. Tuned down brightness. Converges and looks like normal illumination.
solarlego_bug2.jpg
solarlego_bug2.jpg (8.34 KiB) Viewed 4674 times

beason
Posts: 52
Joined: Sat Dec 10, 2011 1:58 am
Location: Los Angeles, CA

Re: My little path tracer

Post by beason » Wed Apr 18, 2018 1:07 am

Your explanation makes sense. Looks very nice! I like the planar laser beam. :D

dawelter
Posts: 40
Joined: Sun Oct 29, 2017 3:15 pm
Location: Germany

Re: My little path tracer

Post by dawelter » Fri Apr 20, 2018 7:44 am

Thank you beason!

Actually there was a bug. I wrongly assumed that pdfs for BSDF sampling are symmetric which they are clearly not. p(wi,wo) = p(wo,wi)? No! no! Ah well, how does one say, assumptions are the mother of all f'ups. I finally realized my mistake when ...

I implemented statistical tests (chi-sqr and t-test) for my scatter functions in the style of PBRT and Nori. I found it quite tricky. Because the chance to have at least one false alarm grows quickly with the number of tests. On the other hand, if the threshold for the p-value is made too low one runs the risk of false negatives. My solution is to change the RNG seed rather than lowering the p-value. :lol:

Still have trouble with the microfacet BSDF. I get bad number of samples at the edge of a bin where incidentally wi*h = wo*h = 0. At that place the pdf also seems to diverge because of a 1/|wi*h| term. I'm unsure if bug or not. Probably not. The material looks okay ... ;)

dawelter
Posts: 40
Joined: Sun Oct 29, 2017 3:15 pm
Location: Germany

Re: My little path tracer

Post by dawelter » Tue Apr 24, 2018 8:49 pm

I haven't had implemented a refractive material till now. That needed to be rectified badly.
RefractiveCaustics.jpg
RefractiveCaustics.jpg (244.13 KiB) Viewed 4239 times
Not too shabby, I suppose.

(Although, since SDS paths are not rendered, parts are missing. I.e. in lower row, areas behind the glass. And top right, the beam behind the glass.)

dawelter
Posts: 40
Joined: Sun Oct 29, 2017 3:15 pm
Location: Germany

Re: My little path tracer

Post by dawelter » Tue Jul 10, 2018 7:49 am

Meanwhile I switched to Embree. Now the renderer feels quite a bit faster. I didn't measure because my data structures had to go out of principle because they were so bad. :lol: Still have something to do about the mess I made with mixed double and float calculations that I now have ... But things seem to work again.
The new pic also shows smooth shading which wasn't implemented for BDPT when I made the first version of that pic.
solarlego_embree.jpg
solarlego_embree.jpg (188.04 KiB) Viewed 3569 times

dawelter
Posts: 40
Joined: Sun Oct 29, 2017 3:15 pm
Location: Germany

Re: My little path tracer

Post by dawelter » Sun Jul 15, 2018 6:38 pm

Went for a pretty low hanging fruit: Importance sampled hdr skydomes! :)
hdrskydome.jpg
hdrskydome.jpg (250.73 KiB) Viewed 3469 times

dawelter
Posts: 40
Joined: Sun Oct 29, 2017 3:15 pm
Location: Germany

Re: My little path tracer

Post by dawelter » Tue Jan 08, 2019 8:02 pm

Hello guys,

I continued working on my renderer for a bit. I added support for emissive media to my path tracing algorithms.

At the moment it can only render that particular demo medium shown in the image below. The issue is that I'm missing a general volume representation which would allow for sampling of light path start points within it. At the moment the spherical geometry is hard coded in the demo medium.

Apart from that I want to integrate OpenVDB eventually. With that I'd get a very powerful grid representation and a data loader practically for free :-)

Here is the image. The medium emits Black-body radiation aka. the Planck spectrum at the given temperature. I also varied the density.
emissive_lights_collage.jpg
emissive_lights_collage.jpg (354.59 KiB) Viewed 1200 times

dawelter
Posts: 40
Joined: Sun Oct 29, 2017 3:15 pm
Location: Germany

Re: My little path tracer

Post by dawelter » Sat Mar 02, 2019 10:57 am

Here are some new results from my renderer. I've been messing with photon mapping ...

Check if physics are working as intended. The beam is supposed to be focused like that. I let the construction of the scene be guided by the so called Lensmaker's equation https://en.wikipedia.org/wiki/Lens_(opt ... s_equation.
lensescene.jpg
lensescene.jpg (172.91 KiB) Viewed 590 times
More or less brute-force monte-carlo SSS.:-)
buddha.jpg
buddha.jpg (168.99 KiB) Viewed 590 times
Spectral rendering! The spectral representation of light was there all the time. But I only really took advantage of it in the atmosphere model. Not any more! This is probably the best rendering out of ToyTrace so far :-)
prism.jpg
prism.jpg (130.48 KiB) Viewed 590 times

andersll
Posts: 22
Joined: Thu Mar 21, 2013 4:34 pm

Re: My little path tracer

Post by andersll » Tue Mar 12, 2019 7:13 am

Very cool! I love the volumetric caustics in the lens image.

Post Reply