Skip to content

Dispersion / Rainbow Effect

Chromatic aberration is an optical effect that occurs because light of different wavelengths (colors) does not travel through glass in exactly the same way. When light enters a lens, each color bends by a slightly different amount, causing the colors to separate spatially.

This phenomenon is known as dispersion, and it is one of the primary reasons lens flares and ghosts can exhibit rainbow-like color patterns.


In a real optical system, glass does not refract all colors equally:

  • Short wavelengths (blue) bend more
  • Long wavelengths (red) bend less

As light passes through multiple lens elements, these small differences accumulate, resulting in visible color separation especially in internal reflections that produce lens ghosts.

In Flares OFX, this behavior is simulated at the lens surface level, allowing you to control how much dispersion each surface contributes.


To achieve rainbow-like ghost coloration, dispersion must be introduced on the individual lens surfaces.

When using Simple Glass mode:

  • Each lens surface exposes a Dispersion Coefficient
  • Adjusting the Dispersion parameter controls how strongly that surface separates colors

Increasing dispersion on a surface causes light passing through it to split more strongly into its spectral components, which becomes especially visible in ghost artifacts.


Optical systems are complex, and the final dispersion effect is the result of many surfaces interacting together. There is no single “correct” surface to adjust.

A practical approach is to:

  1. Enable dispersion on one or more lens surfaces
  2. Adjust the Dispersion parameter incrementally
  3. Observe how ghost colors evolve
  4. Move to another surface if the effect is too subtle or too strong

Applying dispersion to different lens elements can produce very different results, even with the same parameter values.


For quick and effective results:

  • Start with low dispersion values
  • Apply dispersion to single surface rather than multiple and observe the change

Because ghost paths involve multiple internal reflections, small dispersion changes can have a large visual impact. You will also notice that two lenses can cancel out dispersion.


  • Chromatic aberration is caused by dispersion of light in glass
  • Dispersion separates colors as light passes through lens surfaces
  • Rainbow-like ghost effects require surface-level dispersion
  • The Dispersion Coefficient in Simple Glass mode controls this behavior
  • Experimenting across different surfaces is the fastest way to achieve pleasing results

This approach combines physically inspired behavior with intuitive artistic control, making it easy to dial in convincing chromatic effects.

Strong dispersion can produce striking rainbow-like ghost effects, but in some cases the color separation may appear harsh or stepped. This typically happens when the dispersion is strong but not enough spectral information is available to smoothly interpolate the colors.

Flares OFX provides two main ways to make dispersion appear smoother and more natural.


Dispersion is evaluated by sampling light at multiple wavelengths. By increasing the Wavelength Count, more spectral samples are used to represent the color spread.

Effects of increasing wavelength count:

  • Smoother color transitions in dispersed ghosts
  • Reduced color banding and stepping
  • More physically convincing rainbow gradients

Trade-offs:

  • Increased memory usage
  • Higher render cost

Higher wavelength counts are best used selectively, especially in scenes where dispersion plays a major visual role.


Another way to smooth dispersion is by enabling Blur, which softens the dispersed ghost images.

Blur works by:

  • Slightly blurring ghosts with strong dispersion
  • Reducing sharp color boundaries
  • Making dispersion feel more cohesive and organic

This approach is generally cheaper than increasing wavelength count and can be used to hide banding while maintaining performance.


The best results are often achieved by using a combination of both methods:

  • Use a moderate wavelength count to establish clean spectral separation
  • Add a small amount of blur to soften transitions and remove artifacts

This hybrid approach balances visual quality with performance and provides fine control over the final look.


If performance becomes an issue:

  • Start by enabling blur
  • Increase wavelength count only if banding remains visible

This workflow allows you to achieve smooth, pleasing dispersion without unnecessary render cost.