Depth Sorted Ray Marching PostProccess

Thanks to a little help from @Evgeni_Popov with my math and depth calculations, we were able to create a depth sorted post effect that will allow raymarched scenes to be rendered with your normal scene.

https://playground.babylonjs.com/#6Z7SIZ#16

Lots of work to go into it still, but here eventually I plan on passing all of BJS standard material stuff to the ray marched surfaces and you will be able to hopefully not tell the difference for general purposes.

-TODO:
Volumetric Absorption
Reflections
subsurface Scattering
AO
Cubic/Spherical Texture mapping on SDF functions with the correct boolean methods to blend their “UV” space.

4 Likes