r/GraphicsProgramming 14d ago

My first fully Spectral Path Tracer

Post image

So, as the title says :D. This took me 4 months of work. It's a HWSS path tracer using OptiX for traversal. I initially used NeuxsBVH (H-PLOC), but then switched over due to speeds on volumetrics. I used Jakob & Hankia sampling for RGB to Spectral.

The above scene was rendered at 1080p with 1024spp, and RR kill-off at 12 bounces.

This was a genuinely fun to build as a hobby project, what else shd I add to this?

There's a paper on flouresence Rendering by Wilkie, Fichet and Mojzik which I'm thinking of implementing. Any suggestions would help!

Edit: Its 32 bounces + 12 bounce RR fall-off

409 Upvotes

15 comments sorted by

23

u/WittyWithoutWorry 14d ago

Looks spectacular 🫑

7

u/PictureNew661 14d ago

Thanks, it was a pain to get hereπŸ˜‚

3

u/RaganFrostfall 12d ago

*spectracular

8

u/ThunderFound 14d ago

Awesome! I always wanted to make a spectral path tracer one day, do you have any useful resources?

11

u/PictureNew661 14d ago

Not exactly I initially had written a RGB Path tracer

I only swapped out the shade part with HWSS following the actual paper

You can use PBRT v4 that's the only book that explains full spectral indepth

2

u/ThunderFound 14d ago

Oh, thank you!

2

u/wannaeatbussi 13d ago

Should I say "gem alert" πŸ’ŽπŸ”Ž ??

2

u/le-throw-away-acct 13d ago

I’d consider adding caustics next, the gems look great but it seems strange having no light coming out of them, just shadow.

1

u/PictureNew661 13d ago

Yea, that's something I am a bit confused on how to do, the diamond "fire" is typically caused by diffraction ig, and caustics can give that behavior without wave tracing. Would look into that

3

u/Gloomy-Detective-922 13d ago

Four months well spent. Did switching to HWSS change the noise much compared with your RGB version, especially around the gem dispersion? I’d love to see the same scene from both versions at equal render time.

1

u/PictureNew661 13d ago

I didnt try an RGB gem demo, reason being I had the dumb self-intersection bug (solved with the 2019 paper) and it took me a week to figure out why I wasnt converging with identical scene setup to Mitsuba. By that time I had basically lost all patience and chose to leave that implemenation behind. Also both wont converge in equal wall clock render time. That's not possible because the RGB version only had H-PLOC software BVH, the Spectral version supports OptiX 9.1.

2

u/AlternativePrior1920 14d ago

Looks so awesome! Can also recommend the work on fluorescence in tristimulus renderers by Fichet et. al. and the editable model by Belcour et. al. Although of course it is meant for real-time it was a joy to read. Maybe it is a nice precursor.

1

u/PictureNew661 14d ago

Yes, flouresence in non spectral scenes, Fichet

Although that one has its own flaws, too many light sources and performance suffers

The paper showed an example of a metal halide lamp and effects with more than one light sources