Our lens simulator is actually an extension of the previous project. This time, we programmatically station a lens in-between the screen and the world and refract rays through it as an intermediate step. The simulator includes support for contrast-based autofocus, which enables us to automatically focus on user-selected regions of the image.
Using this simulator, we can render photographic effects such as depth of field and distortion. Our images become even more photorealistic, because with our virtual camera system it’s as if we’re actually taking photographs…!