Page 1 of 1

Path traced Ogre using HlmsPbs working prototype

Posted: Sat May 23, 2026 6:53 pm
by Hotshot5000

After the relatively good results from yesterday's ray traced shadows implementation I thought to throw everything at the wall and see what sticks by implementing a full path traced pipeline based on HlmsPbsDatablock. Armed with about $100 of token credits I've managed to get something working for the PbsMaterials sample (now called Sample_PathTracer). Codex needed a bit of hand-holding as it was going into weird rabbit holes and investigating issues in the wrong place thus wasting time/money, but, in the end, I am pretty sure I couldn't have done this overnight all by myself.

You can find the git repo here

Caveat emptor:
This is just WIP with a lot of debugging scaffolding so play with this at your own risk.
The performance is terrible I get about 13fps on a MacBook Pro with M5 Apple Silicon.
The code needs to go through cleanup and restructuring as probably this HlmsPathTraced should be separate from HlmsPbs but it was just easier starting out to just reuse HlmsPbsDatablock and other things.
Many things are wrong as we've tried to get it running as fast as possible so some constants were altered without too much thought just to get the scene looking right-ish. It is a biased path tracer after all.

Now I need some sleep and start an in depth review with a fresh mind. But not before a couple of Lagers :))


Image

EDIT: The implementation is currently only for the Metal render system and has only been tested on MacOS.


Re: Path traced Ogre using HlmsPbs working prototype

Posted: Sun May 24, 2026 12:51 pm
by Lax

Hi,

nice results! This is a hot topic and the challenge is to get more performance.

"couple of Lagers"

Sounds good :D

Best Regards
Lax


Re: Path traced Ogre using HlmsPbs working prototype

Posted: Sun May 24, 2026 11:09 pm
by Hotshot5000

Thanks! Probably hybrid rendering would make more sense but this was easier to implement.

I've also added MetalFX denoising, upscaling and frame generation. Framegen of course helps but the initial fps is too low to make sense.

EDIT: If somebody here has a MacBook Pro with a Max chip like M4 Max or even better M5 Max (they made a big improvement in GPU and RT performance in M5 generation) can you please build this and run the path tracing sample on your machine? I am curious what FPS you are getting in the PathTracer sample. Of course, I will work on optimizing this but in the end you need a lot of computation for PT, there is no way around it.


Re: Path traced Ogre using HlmsPbs working prototype

Posted: Tue May 26, 2026 11:46 pm
by Hotshot5000

With a bit of upscaling now the path tracer runs at 60 fps on a base M5.