The new Lens Flare Editor is integrated into CryENGINE 3. It uses the element based concept to build customizable flares instead of physically correct ones.
The instance of Flares is bound to light objects. When the Lens Flare item is assigned to a light entity, the proper material for rendering lens flare will be assigned to the light entity.
There are lots parameters for each type of flare element. Here some important concepts/functions will be explained.
Common / Position | The position relative to the light. For example, a value of (1,1) means always stick with the light. |
Common / Perspective Factor | This property controls how the flares react to perspective shortening. |
Common / Correct aspect ratio | When it's on, the object will always appear in its original shape regardless of the screen aspect ratio. |
ChromaticRing / Lock to light | This property tells the renderer to ignore the positioning factor, and let system to choose the appropriate position for the ring. |
Glow / Focus Factor | Similar to Photoshop brush's softness setting. |
CameraOrbs / Enable Lens Detail Shading | Usable only when Lens Texture is enabled. This only will allow renderer to render a bump-mapped dirt instead of a flat one. |
Multi Ghost / Scattering range, position factor, position offset | These params control how the sub ghosts should be placed. Scattering range tells the max possible start and end diagonal positions for every sub ghost. |
Root / Lateral chromatic abr | Enable this option and the normal chromatic aberration will become edge-effected. |
Root / Affected by light radius | Use light light radius as the flare falloff control, ignoring distance fading factor. |
All / Sensor image size variation factor | Physical optical effects vary their appearances with different light incident angles and positions. |
All / Sensor image brightness variation factor | Same as sensor image size variation factor, just to affect brightness other than size. |
Root / Custom sensor variation map | Sensor image xxxx variation factor uses this map as a soft mask to determine where the fade should happen. Bigger values mean higher fading strength. |
All / Occlusion interaction | Currently affects only ghost, multi-ghosts, camera orbs and iris shafts. With this option enabled, the flare elements will react to how the light source is occluded by its surroundings. |
If enabling an option gives no result, it's best to check if the parent containers also have this option checked. Parameters are chained in hierarchy structure in flare system.
The most common lens artifact in optical flare phenomenon's category. It's normally created by internal reflections between different lens glasses.
In CryENGINE, it's rendered as a textured quad. To save bandwidth, the quad's size is automatically adjusted according to the texture's dimensions.
A collection of Ghosts. You can control their static distribution behaviors via parameters like, scattering range, position range and offset range.
This is actually not a single physical phenomenon. In optical flare system, this can either form from light's scattering in participating media or lens' internal de-focusing.
In CryENGINE optical flare system, it's rendered as a circular polygon with optional gradient texture. It's static, not a screen space effect.
Quite visible with cheap cameras. This phenomenon is the combination of light reflection, refraction and diffraction. CryENGINE treats it as a hoop shaped aurora and corresponding set of spikes (more spike based features to be implemented).
You can specify a spectrum texture to mimic the chromatic aberration along the light's path.
The cause for this effect has some similarities as chromatic ring, both have diffraction involved. However, this phenomenon has more to do with the uneven lens surfaces and internal density variation.
CryENGINE renders this as an array of textured spikes.
This is not a lens flare effect in strict sense. Commonly seen in fog days, volumetric shafts is the result of light's air scattering.
This is approximated as a screen space effect. You cannot achieve off-screen volumetric shafts using this flare type.
This is a simple phenomenon from the bokeh of on-lens dirt or scratches. This effect can be heavy on graphics bandwidth due to potential overdraw areas.
Optionally, you can enable a dirt texture illuminated by near lights, which simulates dirt/scratches on visor or lens filters instead of lens glass itself.
Sample presets are provided (Libs\Flares\sample_presets.xml
). Each of them demonstrates different aspects of the parameter combinations. Playing with the presets is best way to get yourself familiarized with this system.
Sometimes the streaks appear very thick unlike the images shown below, that is because of the perspective factor settings. Try to move away from the light to a proper distance, the thickness should be normal.
Challenge yourself to achieve more funky creations!