ADOF and lens tracing dont work the same way. Lens tracing is a single pass where rays are sent through a lens prescription. I compute a ray matrix for the prescription once on CPU side, from there the GPU finds where each ray lands on the sensor in one step, so it can run in real time.
If you want to see how it behaves in the editor, when r.LensTracer is set to 0, it renders through the default Unreal cine camera:
Here’s a benchmark. For the video I used the Petzval 85 mm, the other two are more classic designs.
To answer your question, it depends on the lens, and mostly on its field curvature, how much of the frame the lens leaves out of focus. The cost follows the blur, for now.
Even if the ms are still high, being able to run this kind of simulation in real time is already a big step, and I now have a few technical ideas to make it game ready for a wider range of lenses. So thank you for your comment!
@Rolf_of_the_Son Thank you! Performances are impacted, depending on which effects are enabled and the number of ray used. Im working on new optimizations for next updates
@BurneySbb Yes! Its a trace through the lens. I use real optical designs and compute how each ray travels through the lens to the sensor. For the video, this is the ue5 data asset of the lens (see screenshot). So bokeh, distortion, vignetting... are all physically based