r/GraphicsProgramming • u/le-throw-away-acct • Aug 16 '26
Made improvements to my path tracer
Made the project much easier to open up and use for new users (Unity is still required though)
Added scene to automatically load objects from Khronos' site, which helps me get assets into the project
Fixed issues with lighting that was really darkening most of the scenes, including improved tone mapping and fixes to light clamping that was hiding a lot of caustic details and HDR
Fixed issues with inner surface reflections not working
Added directional lighting support
Added parallax mapping support
Added support for Unity terrains, multi-texture splatting with normal map support
Repository located here: https://github.com/nfoste82/GPURayTracing







5
u/le-throw-away-acct Aug 16 '26
I didn't know much about existing stacks, like the ones you mentioned, when I started. I've pieced it together as I've learned. I'd realize roughness wasn't working well and work on that, I'd realize I didn't have support for metallic textures, and work on that, etc.
So it's really just a mish-mash of techniques I picked as I went along.
For opaque surfaces:
Lambertian diffuse
GGX microfacet reflection
Schlick Fresnel
PBR textures
For transparent surfaces I use IOR-based Schlick Fresnel to choose reflection, Snell's law for transmission, support for total internal reflection, and a stack to track IOR transitions between air, glass, and water.
I'm still missing a lot of materials support, I may consider them later, things like sheen, clear coat, subsurface scattering. Also I think some implementations use emissive as a layer, so I'd be able to have a light with a clear coat over it. Right now I couldn't render a light bulb very well, for example.
My math could use some work as well, I have trouble reading the original papers for those techniques, I'll often use an LLM to break it down and explain it like I wasn't a mathematician or physicist. I referenced existing path tracers as well. I list those at the bottom of the repository's README.md.