The V-Ray Frame Buffer’s bloom and glare Lens Effects are the unsung heroes of great renders. Expert Ricardo Ortiz explains how they work and how to use them.
The Lens Effects tool in the V-Ray Frame Buffer (VFB) can be the difference between a good render and a great one. After many years of research, and observation and analysis of the real world, these effects take into account the design of a camera lens to perfectly simulate bloom and glare, the naturally occurring aberrations that surround light sources. In this article, I’ll guide you through what the lens effects do and how you can tweak them to your liking.
Why do we need Lens Effects?
Light sources in V-Ray scenes can often appear blown-out, as very white areas and bright pixels. When we look at these renders, we may not notice the light source — and this is where bloom and glare effects come in.
In case you're wondering, bloom refers to the soft glow around light sources that can affect the overall image, whereas glare refers to the star-like rays that extend from a light source. By adding these effects, we can subtly draw attention to light sources and add photorealism to our renders.
The main factor in bloom and glare is diffraction, which refers to the way light waves are split apart when they pass through an aperture, such as a lens or even the pupil of an eye.
These effects are never calculated during the ray tracing process by the render engine. Instead, they are evaluated in a separate process that allows us to have more artistic control over factors that determine the final appearance of the effect; physical characteristics such as diffraction, environmental circumstances, camera lens aberrations, and distortion.
Diffraction and imperfections
Nothing is perfect. Every digital artist strives to add imperfections to models, materials, and textures to create a realistic render.
Likewise, when we use a camera to capture an object, person, or scene, the lens is not completely flawless. It has distortions and scratches from use, as well as dirt. In addition, the environment is not clean, with impurities such as dust or smog in the air. Rather than avoiding these factors, they can help define a precise moment in time and space.
How do I use Lens Effects in the V-Ray Frame Buffer?
As I have mentioned, light sources represented by white dots in our render are pixels with a very high-intensity value. If we examine the pixel information in the VFB, we notice that certain white areas have intensity values greater than 1; sometimes they can be very high. Because the VFB stores information about our rendered image in RAW format, this data can be used to create accurate Lens Effects based on the brightness of the light source.
Once Lens Effects are on, we can make adjustments. Almost all the time we need to change at least one for more realistic results.
If you want to know more about what factors determine all kinds of glare effects, don’t miss Asen Atanasov’s amazing presentation.
Asen's work also allowed us to redesign the Lens Effects user interface in the VFB. It now contains procedural and customizable settings options, allowing users to create more and better results.
Lens effect examples
Let's take a look at some of the effects that are possible in the VFB. In each of these examples, the top shows the simulated pattern of distortion on the lens, and the bottom shows the result in the render.
Procedural scratches
Some diffraction effects found in the real world.
Procedural dust
Random points on grid and procedural.
Peripheral grating, occlusion, or obstacle image
These effects occur in the human eye due to elongated cells.
Hardware-accelerated
Generating lens effects are relatively demanding and can consume a lot of memory if the resolution of the rendered images is too large.
By default, Lens Effects are GPU accelerated, with support for both Nvidia and AMD GPUs. If the memory consumption exceeds the VRAM capacity of our GPU, then the process is evaluated by the CPU. You may notice decreased performance, but it will work correctly.
Conclusion
Now you should have a better understanding of what lens effects are, the science behind them, and how to use them. They really can add a touch of realism to your scene, and tweaking them can change the atmosphere and mood. And, because the Lens Effects are part of the VFB, you can use them without leaving your favorite renderer.