ServerSide ray tracing for threejs scenes?

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

Using

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