Path-tracing in BabylonJS

Actually, I found it very interesting to really understand how you get from a very noisy image to a very pixel-perfect one! Thanks for the lesson really :wink: Not a raytracing expert yet but slowly starting to understand the mechanism.

@Evgeni_Popov I want to thank you also for the support.
BTW this effect is so cool

It seems to have been very crucial to make it work.
And what a result @erichlof, the first raytracing scene ever made with BabylonJS! So damn cool!

No never did that. The best solution I found and use at Naker in order to have the best rendering quality is to push every scene parameters (hardwarescaling, shadow map size, antialiasing samples, etc) and render one frame with scissor enabled to prevent the browser from freezing when rendering the frame (see: Slow down rendering of one frame - #3 by PichouPichou)

Indeed I think it will be easy to set up. But the hard part with offscreen canvas is that you have to re-implement every interaction like camera drag and drop for instance as everything works in the worker. I have some code I will be happy to share which manage that if you want.

Haha I donā€™t, I know this issue with shader code. I think it is a shame we canā€™t have shaders in glsl file to make it way more readable by the way.

Why not using Typescript and do simples import of separated files using specific shaders?
It will make the code more readable and it will allow us to use ES6 BabylonJS modules in order to import only what we need instead of the entire BabylonJS Library: https://doc.babylonjs.com/divingDeeper/developWithBjs/treeShaking

I will be happy to manage this part if you want :wink:

Pichou

2 Likes