Advanced Night Vision - Unity Asset Store - Nephasto

A highly configurable, AAA quality and easy to use night vision effect.

🕹️ Demo  🛒 Store

Editor

Once installed, select the camera for your scene and add the ‘Advanced Night Vision’ component.

 

And you will see something like this:

 

Since the effect has an on (2) and off (3) time, you must use the ‘On / Off’ field to enable or disable the effect. If you disable the component, the shutdown effect will not take effect.

In the Editor the ‘On / Off’ effect may not occur smoothly.

The effect has numerous parameters organized in various sections (4) that we will see below. By pressing ‘[doc]’ (5) you will be able to access the online documentation and in ‘Reset’ (6) all the parameters will return to their default values.

Quality

Here you can adjust the quality and performance of the effect.

 

Advanced Night Vision’ has two modes, one using multiple passes (better quality and more options, but slower) and another using a single pass (worse quality and less options, but faster). You can select it in ‘Passes’ (1).

You can also adjust the final resolution, with the default option ‘Normal’ being the same as the original resolution. The other options create smaller resolutions so performance will increase at the expense of image quality.

If the mode is ‘Multi Pass’, you can modify the number of passes of the Blur effect in ‘Blur’ (3) and the strength of the Glow (4).

Light Management

 

If the checkbox (1) is active, the effect will create a hidden spot light to simulate the night vision effect. It will be activated when the effect is activated and deactivated when it is turned off (with ‘On / Off'). You can configure its angle (3), intensity (4) and shadow type (5).

In addition, all the realtime lights in the scene will be turned off when activated and will be activated when the effect is turned off. If you want the effect to ignore some lights, add them to ‘Ignore lights’.

You can do more things by code by subscribing to the ‘OnSwitch’ event that will be called every time the event goes on and off.

Color

In this section you can adjust the color of the effect. Depending on the mode you use (1), you can adjust more to fewer parameters.

 

The final color is calculated with the resulting brightness and a color gradient is applied to it. In ‘Color gradient’ (2) you can select some presets, or create one (option ‘Custom'). If you select ‘Custom’ you will see the five colors with which the gradient is created.

 

To create a good gradient, order the colors by putting the least bright colors at the top and the brightest colors at the bottom. You can find good examples at color.adobe.com.

With ‘Luminance’ (3) you can adjust the color strength of the gradient and with ‘Exposure’ (4) the general brightness. If you select the ‘Advanced’ mode, you can adjust the brightness (5), contrast (6), saturation (7) and the levels of each color channel (8).

Edge detection

 

Turning (1) edge detection on will highlight the edges of objects. Adjust its color with ‘Tint’ (2) and its intensity with ‘Strength’ (3).

Glitches

Here you can configure some typical optical equipment defects: vignette, chromatic distortion, grain and scanlines.

 

Vignette is a dark frame that affects the edges of the screen, it can be of three types (1): screen, monocular or binocular.

Chromatic distortion (4) simulates the defects of some lenses by shifting the color channels at their edges. You can disable it, use the ‘Simple’ or ‘Advanced’ mode. The number of passes (5) will make the displacement of the color channels smoother at the cost of decreasing performance (only in ‘Advanced’ mode). With ‘Aberration’ (6) you can adjust the intensity of the effect and with ‘Barrel’ (7) you can simulate the deformation of the image suffered by some lenses (only in ‘Advanced’ mode).

Activating ‘Analog TV’ (8) will simulate the effects of noise or grain (9) and trace lines (10) that some analog displays suffer. With ‘Digital TV’ (11) you will activate the faults that usually occur in digital broadcasts (12).

UI

Activating ‘UI’ (1) will show some common interfaces on optical devices such as: cross, mesh and circles. You can all move them using ‘Center’ (2).

 

From ‘Cross’ you can adjust its width (3) and its color (4). The same with ‘Grid’. Finally you can configure the radius of up to three circles (7, 8 and 9) and their colors (10).

You can use the color’s alpha channel to regulate intensity.

Code

All the code is inside the namespaceNephasto.AdvancedNightVisionAsset’. The first thing you should do is import the namespace:

1
 using Nephasto.AdvancedNightVisionAsset;

 

If ‘myCamera’ is a valid camera and you want to add the effect to it, you can do something like this:

1
 AdvancedNightVision advancedNightVision = mycamera.gameObject.AddComponent<AdvancedNightVision>();

 

For more information, you can consult the code comments and the attached demo.

Any questions or suggestions you have, I will be happy to answer you in

hello@nephasto.com