Ray Tracing at City Scale#
Important
This tutorial is still TODO, but you can find premise of it below.
The default path tracing solver, SBRPathTracer
(solver="sbr"), discovers path candidates with a bounded population of
shooting-and-bouncing rays instead of enumerating them, so its cost does not grow
combinatorially with the reflection order or the number of primitives in the scene.
This makes it possible to simulate higher-order reflections on city-scale scenes,
like the one below, where an exhaustive search would be far too slow.
import differt.plotting as dplt
import jax.numpy as jnp
from differt.geometry import Mesh, Scene
Warp CUDA warning: Could not find or load the NVIDIA CUDA driver. GPU execution will not be available.
%%time
mesh_file = "bruxelles.obj"
mesh = Mesh.load_obj(mesh_file)
dplt.set_backend("plotly") # Let's use the Plotly backend
tx = jnp.array([-40.0, 75, 30.0])
rx = jnp.array([+20.0, 108.034, 1.50])
scene = Scene(transmitters=tx, receivers=rx, mesh=mesh)
with dplt.reuse() as fig:
scene.plot()
paths = scene.trace_paths(order=range(6), solver="sbr")
paths.plot()
fig
CPU times: user 9.17 s, sys: 448 ms, total: 9.61 s
Wall time: 7.52 s