Path traced Ogre using HlmsPbs working prototype

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 263
Joined: Thu Oct 14, 2010 12:30 pm
x 69

Path traced Ogre using HlmsPbs working prototype

Post 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.

Lax
Orc Shaman
Posts: 711
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 75

Re: Path traced Ogre using HlmsPbs working prototype

Post 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

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 263
Joined: Thu Oct 14, 2010 12:30 pm
x 69

Re: Path traced Ogre using HlmsPbs working prototype

Post 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.

Hotshot5000
OGRE Contributor
OGRE Contributor
Posts: 263
Joined: Thu Oct 14, 2010 12:30 pm
x 69

Re: Path traced Ogre using HlmsPbs working prototype

Post by Hotshot5000 »

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