Applying Stealth Effect

How does it work?

The effect works by creating a copy of your object that should be able to change to stealth mode. All materials of the copy should have the Stealth Shader assigned. The Stealth Controller script handles the activation and deactivation of the stealth mode. The normal object and the stealth object should be on the same level and have the same size and position:

In this image you can see an example of how the structure looks like. The Ship Test holds the stealth controller. The original object and the stealth object are childs of the Ship Test object. The stealth object should be assigned to the stealth object property of the stealth controller.

StealthController

In this section we already can configure some properties of the actual shader. For more information about those properties, please go to the Shaders section under Shader: SF Stealth and check the detailed documentation for the shader properties.

The controller is responsible for handling activation and deactivation of the stealth mode. For the controller to be able to work, you need to specify some properties:

Stealth Object

As described in the previous section, you need to create a copy of the original object that has only Stealth Shader materials assigned.

The controller will handle the configuration of all assigned stealth shader materials. This works also multiple MeshRenderers and for multiple materials per MeshRenderer

Activation Direction

Starting direction of the stealth effect. For more info check out the Shader section of this documentation

Size Offset

Depending on how we configure the activation direction and how the object is shaped, it can happen that the calculated object size is just a little bit too small, which can lead to a small portion of the object not being in stealth mode. This can happen if you specify multiple axes for the activation direction. To prevent this behaviour we can specify a small value which will be added to the objectSize property of the shader.

For more info check out the Shader section of this documentation, in particular the ObjectSize property.

Activation duration

Duration in seconds for your object to fully transition into stealth mode

Deactivation duration

Duration in seconds for your object to transition from full stealth mode into normal mode

Last updated