4 ms·
Both this project (and optical design in general) and rendering engines (like video games or any 3D rendering) implement ray tracing, and so are related. But th
by fouronnes3 2y ago
Both this project (and optical design in general) and rendering engines (like video games or any 3D rendering) implement ray tracing, and so are related. But the application is different and therefore they are not really competing. The underlying math is similar, but implementations will be quite different.
Ray tracing for rendering typically needs to figure out which surface a ray is hitting as part of collision detection. This is typically done with something called Bouding Volume Hierachies. Optical design (at least in sequential mode) side steps that issue completely because the order of surface collisions is known in advance.
Another big difference is that ray tracing for optical design needs to be differentiable. This is why I made this project in PyTorch, so that the entire collision detection code and physics implementation (refraction, reflection) can be differentiated with respect to parameters that describe the shape of surfaces. Then you can gradient descent the entire optical system to find optimal parameters.
Finally, rendering raytracing typically implements a lot of realism functions like diffuse or partial reflection which makes the code acutally more complex in some ways. But optical design will care more precisely about things like precise modeling of dispersion, which is not a huge focus for rendering. And there can be real-time performance constraints if you're doing a video game also. Here the implementation really doesn't care about any real time stuff.