Real lens flares are optical artifacts of light traveling through lenses, mostly seen with
In the digital domain of games and films they are often added artificially.
Lens flares are used...
- for
- to
- to make cut scenes more
The choice is an artistic one and depends on the style of a the game.
Complex and bright lens flares should not be used on every light or lamp, since this will visually overload the scene.
With a lot of layers the performance can become a problem, when the flares are used for many objects.
The Rokojori Action Library contains a couple of built-in presets in: FlareVFXPresets.
Since lens flares depend heavily on the background, they are shown with bright and dark background.
The Edit Mode ensures all layers are created as children to FlareVFX and have their
materials assigned. To update it via code use:
Make sure to duplicate a preset, if you don't overwrite it.
A
The main first properties are related to the color of the flare.
The core are the layers, which contain
Below are settings (
A
The first three settings:
There are:
-
-
-
-
This is just the red orange classic with all its layers (which is a lot). You can copy single layers, add them as unique to yours and tweak them,
that's easier than creating everything from scratch. They are also mostly color neutral and will
adapt to the main color.
Use a backdrop gradient to enhance the contrast for bright or busy backgrounds. Often darker/colder than the main color and using
a non-additive blend mode like mix or multiply. Can be done with
The brightest spot in the flare, usually mainly white and roundish.
Can be done with
A line of ghosts, typically with geometric shapes like circles, pentagons or hexagons.
Whether it's sharp or smoothed, it can be perfectly done with
Create a lot of random streaks around the core with a
Either as one big or as multiple small ones:
This full screen covering glow makes every flare pop.
A rainbow radial fill and a random conic mask give great results with a
You can create a custom flare type by extending
A custom FlareType needs to return a
It also needs to apply the settings to a material the
Use the
Besides implementing the LayerType, the returned Shaders and ShaderMaterials are expected to
support the properties of
The built in types use "includes" to automatically do most of the shader, so that only
a UV generate function needs to be implemented. Check also here the implementation
of the
shader for TextureFlareType







