Blender Studio
  • Films
  • Projects
  • Training
  • Assets
  • Blog
  • Community
  • Join
  • BLENDER.ORG

    • Download

      Get the latest Blender, older versions, or experimental builds.

    • What's New

      Stay up-to-date with the new features in the latest Blender releases.

    LEARNING & RESOURCES

    • Blender Studio

      Access production assets and knowledge from the open movies.

    • Manual

      Documentation on the usage and features in Blender.

    DEVELOPMENT

    • Developers Blog

      Latest development updates, by Blender developers.

    • Documentation

      Guidelines, release notes and development docs.

    • Benchmark

      A platform to collect and share results of the Blender Benchmark.

    • Blender Conference

      The yearly event that brings the community together.

    DONATE

    • Development Fund

      Support core development with a monthly contribution.

    • One-time Donations

      Perform a single donation with more payment options available.

Training Highlights
Facial Rigging
Blender Fundamentals 4.5 LTS
3D Printing with Blender
Video Log #6: Promo video

Training types
Course Documentation Production Lesson Worskhop

Training categories
Animation Geometry Nodes Lighting Rendering Rigging Shading
Film Highlights
Singularity
2025
Wing It!
2023
Spring
2019
Hero
2018
Project Highlights
Impulse Purchase
Showcase
Project Storm
Showcase
DogWalk
Showcase
Project Gold
Showcase
Assets Highlights
Characters
Models & rigs
Assets
All production files
Libraries
Curated sets

Simulating Physical Camera Lenses with Caustics

Andy explains how he simulated a physical camera lens using caustics rendering in Cycles.
  • Update
  • 3 Feb 2023
  • 3 min read
Andy Goralczyk
Andy Goralczyk Author
Report Problem

It all started with me wanting to learn more about how physical camera lenses work. I browsed for some diagrams online to see how to construct a simple lens. Next, I started modeling some lens elements and minutes later I found myself in a rather strange rabbit hole.

A first test with a moving camera and shifting focus. It shows very interesting flaring and light leaking.

After some initial noodling around with the render settings in cycles, I had a working setup. I enclosed my "physically based" lens in a camera body and added a translucent plane as a sensor to focus the rays. This in turn gets rendered by an upside-down orthographic blender camera to capture the final image. A circular opening in the middle of the lens (with a shape-key to vary its size) serves as aperture.

The idea itself is nothing new, and quite a few people managed to get mind-blowing results. But the recent improvements to Cycles left me wondering if this is feasible for rendering animations.

The lenses are enclosed in a black box to only let in rays pass through the lens onto the sensor plane

The lenses are enclosed in a black box to only let in rays pass through the lens onto the sensor plane

This setup only works when refractive caustics are enabled in rendering, and it needs around 20 transmission bounces to work correctly. You need quite a lot of samples to render a clear image, 3000 - 8000. But even then, I was extremely excited to see lens flaring, light leaking and other physical imperfections show up in the renders!

Since I'm not that knowledgeable in optics and mathematics, this is all very unscientific. I am sure the lenses are a little out of proportion. I picked the values that seemed right, which sometimes made me feel like a caveman holding shards of volcanic glass into the sun and burning myself in the process!

There are quite some limitations of this crude camera: For example, the lens has a fixed angle of view. The focus range isn't that great, either. In an earlier test I tried to simulate chromatic aberration by combining the R, G and B channels of different glass materials with diverging indices of refraction together, but it was a little bit cumbersome to get it physically correct (ie. Sergey certified!). All in all, this is not entirely practical for use in production. But I learnt a lot about optics and most importantly it shows how far the development has come in cycles to make this remotely possible!

A tour of the camera controls in the example file. This file uses the Asset Demo by Simon and Julien.

I bundled up my explorations in a single file. The camera is rigged and ready to play around with: There is a bone for focus control and the main root bone has two properties to control lens aperture and sensor gain. You'll need Blender 3.5 Alpha

Download the file here:

caustics_lens_example.blend

Blender File - 22.0 MB - CC-BYcaustics_lens_example.blend

 Download File

Enjoy!

Join to leave a comment.

Films Projects Training Blog
Characters
  • Storm
  • Mikassa
  • Whale
  • Ballan Wrasse
Studio
  • Terms & Conditions
  • Privacy Policy
  • Contact
  • Remixing Music
  • blender.org
Blender Studio

The creators who share.

Artistic freedom starts with Blender powered by CG Global Entertainment Ltd.
粤ICP备2024327355号-3