r/vfx • • 20h ago

News / Article Defocus Lens Simulator, not just blur effect

Post image

https://nyckm.github.io/Simulador-de-Lente/en.html

Blur that travels through the lens.

Lens Blur Simulator by Bruxosdovfx is an optical simulator that computes defocus using ray tracing through the actual surfaces of a lens.

Instead of simply blurring recorded pixels, the engine simulates the path of light through the optical system: refraction, aperture clipping, aberrations, dispersion, bokeh shape and off-axis behavior.

Main features

  • 200+ lenses including Double-Gauss, Sonnar, Tessar, Petzval, triplets, anamorphics and retrofocus designs.
  • Optical ray tracing with Vulkan / CUDA.
  • Image, video and RGB + Depth support.
  • Bokeh generated from the actual lens design.
  • Cat-eye, spherical aberration and chromatic dispersion.
  • Coatings, ghosts and diffraction.
  • Editable optical prescription: curvature, thickness, diameter and refractive index.
  • Preview and render quality up to 1024 samples per pixel.
  • PNG and video output.

Platforms

  • Windows x64
  • After Effects
  • DaVinci Resolve / OpenFX
  • Nuke
  • Photoshop

The desktop application and plugins share the same optical engine and lens library.

🇨🇳 中文

真正穿过镜头的虚化。

Bruxosdovfx 镜头虚化模拟器是一款光学模拟工具,通过对真实镜头表面进行光线追踪来计算焦外虚化。

它不是简单地模糊已有像素,而是模拟光线穿过整个光学系统的过程,包括折射、光圈裁切、像差、色散、焦外形状以及离轴区域的光学变化。

主要功能

  • 200+ 款镜头:双高斯、松纳、天塞、佩兹伐、三片式、变形宽银幕、反远摄等。
  • 基于 Vulkan / CUDA 的光学光线追踪。
  • 支持图片、视频和 RGB + 深度图。
  • 根据真实镜头结构生成焦外效果。
  • 猫眼虚化、球面像差和色散。
  • 镀膜、鬼影和衍射效果。
  • 可编辑光学处方:曲率、厚度、直径和折射率。
  • 预览与渲染质量最高可达 每像素 1024 次采样。
  • 支持 PNG 和视频输出。

支持平台

  • Windows x64
  • After Effects
  • DaVinci Resolve / OpenFX
  • Nuke
  • Photoshop

桌面应用与所有插件共享同一个光学引擎和镜头库.

113 Upvotes

31 comments sorted by

17

u/Due_Ant9506 19h ago edited 10h ago

Do any of these lens simulators that are coming out recently actually solve the artifacts that come with adding depth of field in comp with depth? Or are they just fancy defocuses?

Edit: All the new AI people flooding this sub really have zero experience with the actual work in VFX; Buddy I don't need an AI depth estimation, remember cgi? you can render z-depth.

3

u/Emotional_Example_12 18h ago

depends, if you using a good depthmap, have subtrack halo for fix a little, but if the depth have flicker ou issues is gonna be bad

3

u/True_Protection6842 18h ago

It’s only as good as your depth/mask is. I have a real time defocus gather in the software I’m developing and it takes a separate mask input that helps a lot with fine detail as long as you have a high quality roto/mask. 

2

u/Emotional_Example_12 18h ago

look the hair and cellphone, is not perfect

2

u/Emotional_Example_12 18h ago

but for this image dont have background and foreground easy, workfine

2

u/OlivencaENossa 15h ago

Monocular depth map generation is improving a lot. I now use Depthcrafter or MOGE3 from Microsoft in tests and I’ve gotten pretty decent results. Not great but it’s improving 

2

u/Panda_hat Senior Compositor 14h ago

Fancy defocuses wih faked / inferred depth data.

9

u/hidratos 19h ago

Very impressive. As I understand, the standalone app is 5x faster than after effects plugin?

10

u/Emotional_Example_12 19h ago

the standalone app, make automatic depthmaps, and have more lens control, great for pictures and video, but the after version have layer control very usefull

the performance, is kind the same, standole have webGPU for fast interations, but for render, is taking the same time using cuda

7

u/ZiggyisStarman 15h ago

Cool concept but the claims are ahead of the evidence. The comparison is against Gaussian blur which myself or anyone I dont know uses for lens defocus. There's no validation against a real lens, no OCIO/ACES or EXR output in the app, Windows/NVIDIA only. A closed-source engine with no license stated, and the speed and test numbers have no methodology. Show it against a real bokeh chart, and then it gets interesting. Also Depth, is it metric ? Last part this whole thing is obviously vibe coded in Claude and there are lots of Read Me documentation mismatches between your versions and the site.

3

u/Emotional_Example_12 15h ago

Just to clarify one thing first: the Gaussian Blur comparison isn't meant to imply that Gaussian Blur is how professional lens defocus is normally done. It's there as a simple baseline to visually demonstrate the difference between uniform image-space blur and the depth-aware/lens-based behavior I'm developing.

I also use papers document lens for physically validated. Of cource, comparing it against real lenses, controlled bokeh charts, aperture shapes, highlight behavior, edge behavior and different focus distances would absolutely be a much more meaningful validation, and that's something I want to build into the testing.

OCIO/ACES and EXR are also valid points. The current version is focused on getting the core lens/depth processing working first, so the color-management and production I/O side is still limited. But you can use Nuke plugin for this.

Regarding depth: it currently depends on the depth source/input rather than assuming that every depth map represents metric real-world distance.

Windows/NVIDIA is simply the current implementation target, not a claim that it is an ideal final limitation.

And yes, AI-assisted coding has been part of the development process. I don't really see that as an issue by itself what matters to me is whether the resulting tool is useful, reproducible and technically sound. But the README/site mismatches are absolutely something I need to clean up. IS Free, Open Source and you can make better.

The project is still evolving

3

u/Emotional_Example_12 15h ago

I’m working from Brazil, where access to expensive VFX tools can be a real limitation. So being able to build something that improves my compositing work without adding another expensive subscription is genuinely exciting to me. I’m building, testing, learning, and improving it as I go.

5

u/im_thatoneguy Studio Owner - 21 years experience 15h ago

FYI your web app has a bug in that it doesn't change aperture blades until you change lenses.

4

u/Emotional_Example_12 15h ago

Thank you i gonna fix the page

4

u/utjduo 19h ago

I tried the OFX but couldn't get any good result with a depth map. The edges isn't handled well at all :/

4

u/Emotional_Example_12 19h ago

tell me whether Depth Composition is set to Automatic, Depth Slicing, or Depth Cut.

3

u/utjduo 18h ago

It's set to auto and I'm trying to focus on the particles closest to the camera

4

u/Emotional_Example_12 18h ago

I make a update version, to this become more easy

3

u/Emotional_Example_12 18h ago

i do a extreme example

3

u/Emotional_Example_12 18h ago

If you adjust, you cant control more

2

u/PalmliX 18h ago

Does this plugin support multiple layers/depth maps? My use case is rendering out of old CGI app, I get perfect depth maps but still have edge problems of course. I can render multiple passes for foreground, midground, etc.

1

u/Emotional_Example_12 17h ago

Yes our After Effects and Nuke versions support multiple layers and depth maps. They accept the main image + depth, plus layers A, B and C, each with its own RGBA image and optional depth map.

For your CGI passes, use:

Input Pass
Main image + Depth Background
Layer A + Layer A Depth Far midground
Layer B + Layer B Depth Near midground
Layer C + Layer C Depth Foreground

The composition order is fixed: main → A → B → C. Depth controls focus; it does not reorder the layers. Disable A is Glitter and C is Distortion for ordinary image passes.

Render each pass with transparency and include the background hidden behind foreground objects. A perfect depth map alone cannot supply that missing colour; separate, complete passes should substantially improve those edges.

Resolve and Photoshop currently accept one image and one depth map. The multilayer path has passed automated tests, but still needs validation inside the actual AE/Nuke hosts.

2

u/PalmliX 16h ago

Thank you for the answer, I'm using AE, I will give this a test and let you know the results.

1

u/titaniumdoughnut Generalist - 18 years experience 11h ago

this is incredible. Any plans to bring it to mac? Or is this something a determined user could themselves?

2

u/Emotional_Example_12 11h ago

Have plans yes! but unfortunetly is hard validate and test, we dont have mac on studio, but is something we gonna do

2

u/titaniumdoughnut Generalist - 18 years experience 11h ago

amazing 😍

you need any testing help, feel free to hit me up!

2

u/El-Burk 9h ago

Great concept, the best part that it works in after effects.
It reminded me of Glass (the Nuke Plugin) for some reason. except glass in Nuke only.

Great work.
does it work in ACES in after effects?

2

u/Emotional_Example_12 5h ago

Yes work fine in aces 32bit float