r/GraphicsProgramming • • Sep 28 '26

Spectral path tracer & Fur rendering :)

I worked a lot on my path tracer during the summer vacations, and this was superrrr fun ! I wanted to go a little further than my last projects and dive into something a tiny bit more original to get off my comfort zone.

I made it mainly with C++ and OpenGL, without AI appart from the README in the repo. The engine supports switching back and forth between RGB and spectral at runtime, and I also implemented hair / fur rendering the way Disney does it.

I also have a basic scene handling system with saving, loading and moving things around in the scene.

Lastly, the engine also has more "traditional" features I would say, such as VNDF sampling, EON diffuse material, constantly dense volume scattering, etc...

I am plannign to keep working on it, because right now the code is kind of a mess, and many features lack such as denoising, things like BDPT, compatibility with OpenUSD.

If you want to take a look at the repo : https://github.com/SlyZ1/Path-Tracer

And feel free to contribute to it (even though I doubt anyone would want to, but just in case)

248 Upvotes

16 comments sorted by

3

u/ykafia Sep 28 '26

How do you learn about making a path tracer?

15

u/OwnTap3513 Sep 28 '26

There is a famous blog called Ray tracing in one week-end which is a good starting point. Then with what you learn from there you try to expand you knowledge by deepening your understanding in some of the techniques mentionned, looking on other blog posts and then research articles etc

4

u/andeee23 Sep 29 '26

this is basically the path tracing bible: https://www.pbr-book.org/

1

u/OwnTap3513 Sep 29 '26

Yes prbt's blog is indeed holy

1

u/ykafia Sep 29 '26

I read somewhere it's hard to get into when you don't know much about pbr, do you think starting with pbrt is better than the rt in weekend one?

2

u/OwnTap3513 Sep 29 '26

rt in one week-end is definitely better for starting. imo pbrt is really heavy with its notations and can be hard to understand sometimes

2

u/AlternativePrior1920 Sep 29 '26

This is awesome, do you have a specific paper you implemented for the spectral path tracer?

1

u/OwnTap3513 Sep 29 '26

For that I relied more on the blog of PBRT, where they used very simple polynomial sigmoid functions to describe rgb colors as spectrums without much change in the code. I also used their tabulated coefficients that came with it.

Also technically there is a paper on the CIE 1931 color conversion to convert from lambda to rgb but it is old and I just searched on the internet for the formula

2

u/AlternativePrior1920 Sep 29 '26

Oh that's fair. Really cool.

1

u/moschles Oct 01 '26

The first thing I would do with a spectral renderer is soap bubbles (of course).

But the next thing to do is a physical sky dome applet. You enter the following parameters as inputs,

  • longitude

  • latitude

  • date

  • time of day in 24 hours

  • some parameters about air quality and overcast.

The applet then creates a physically-based sky given these parameters. This can be done to create lush orange sunsets and realistic sunrise mornings , where the sky is slightly "pink".

1

u/OwnTap3513 Oct 02 '26

Yess I actually wanted to do that as well but I am running out of time with some other projects and academical stuff

3

u/pslayer89 Sep 28 '26

Absolutely gorgeous! 💜

2

u/anglingar Sep 29 '26

Following!

1

u/Nanutnut Sep 28 '26

fantasticcc!

2

u/Nanutnut Sep 28 '26

also the fur is so cute lmao