ServerSide ray tracing for threejs scenes?

Hi,

Ray-Tracing as we all know is very compute intensive. I found two ray-tracing projects for threejs in the public domain.

These two projects run in the browser. I would imagine that running the same on a “server” (e.g via nodejs) would be faster since we could leverage huge servers / cloud.

Any efforts in that direction ?.

Regards
/rk

Client side
https://devine.pub/raytrace/example/

Using

Otherwise you could use a headless version of Blender on the server and utilise Cycles.

There are certainly efforts (see: Google Stadia) but so far these are big commercial projects. Most commodity servers don’t have GPUs at all, so I expect you would need specialized and rather expensive server hardware to do better in realtime than WebGL in a browser.

I’m a bit more optimistic about WebGPU here, which may eventually make realtime raytracing more practical on the web. See: Real-Time Ray-Tracing in WebGPU

Don,

Google Stadia appears to be a “portal” for games. I was looking into some kind of “Cloud Based Rendering” (ray-tracing, path-tracing etc) for threejs scenes.

The two projects that I mentioned in my original post perform this “rendering” in the browser. What prevents us sending this scene to a “nodejs” based server ?. Any work in that direction ?

All, I am looking for is a photo-realistic render of my threejs scene, which consists of specific lighting, rich materials etc.

/rk

The two projects that I mentioned in my original post perform this “rendering” in the browser. What prevents us sending this scene to a “nodejs” based server ?. Any work in that direction ?

Sure, there’s no reason you can’t do that, using something like headless-gl to replace WebGL. I wouldn’t expect to stream raytraced scenes in realtime to many clients with that, but it should work for individual renders. Some polyfills and patches may be necessary since three.js is mostly designed to run in a web browser.