Camera Transitions - Unity Asset Store - Nephasto

A large collection of cinematic and realtime transitions between cameras in a scene.

πŸ•ΉοΈ Demo  πŸ›’ Store

Editor

The first thing you should do is create an instance of β€˜TransitionManagerβ€˜, the object in charge of handling transitions. Create an empty GameObject and add the β€˜TransitionManagerβ€˜ component. There should only be one β€˜TransitionManagerβ€˜ at a time.

 

From this component you can configure the general operation of all transitions. The first option is ‘Progress’ (1), and with it you can change how transitions are updated: automatically (by default) and manually. If you choose the last option, you will have to update the progress yourself using ‘Transition.Progress’.

If you disable ‘Use scaled time’ (2), the timing of transitions will not be affected by Time.timeScale.

Usually all cameras have their own AudioListener. During transitions, there are two cameras activated, which means you will have two active AudioListeners. To avoid this activate ‘Handle AudioListener’ (3).

To prevent the object where ‘Transition Manager’ is from being destroyed when unloading the scene, set ‘Dont destroy on Load’ (4).

The following options affect the quality of transitions and their performance. Every time a transition occurs, a RenderTexture is created, if you want to take care of this select ‘Manual’ in ‘Mode’ (5).

Normally the cameras are updated every new frame, if you want only the first frame of the transition to be updated select ‘First frame only’ in ‘Update’ (6). You can also decrease the size of the render, increasing the performance at the cost of deteriorating the quality, in ‘Size’ (7). Finally, in ‘doc’ (8) you can access the online documentation.

Code

All code are inside the namespace β€˜Nephasto.CameraTransitionsAssetβ€˜, so you have first to include the namespace:

1
 using Nephasto.CameraTransitionsAsset;

Β 

Then you will be able to access β€˜TransitionManagerβ€˜ through its singleton β€˜TransitionManager.Instanceβ€˜.

Now, if β€˜cameraAβ€˜ and β€˜cameraBβ€˜ are two cameras in your scene, you can make your first transition like this:

1
 TransitionFadeToGrayscale.Start(cameraA, cameraB, 1.0f);

Β 

This will execute a gray fade between β€˜cameraAβ€˜ and β€˜cameraBβ€˜ that will last a second.

In the folder β€˜Nephasto/CameraTransitions/Runtime/Transitionsβ€˜ you have all the transitions available. All have a static β€˜Startβ€˜ method to execute their transition. Check the comments in the code to know the different parameters. You are also interested in checking the comments of the class β€˜Nephasto/CameraTransitions/Runtime/Transition.csβ€˜ since all transitions inherit from it.

Some points to consider:

  1. Transitions are always between cameras of loaded scenes. β€˜Camera Transitionsβ€˜ does not load new scenes.
  2. At the end of the transition the GameObject of the initial camera will be deactivated, so it is better that it only contains the components related to the camera.
  3. The origin and destination cameras must be different.

You might want things to happen in your game when the transition begins and when it ends. To do this you just have to use the β€˜StartEventβ€˜, β€˜ProgressEventβ€˜ and β€˜EndEventβ€˜ events of β€˜Transition Managerβ€˜.

Transitions

Next you can find a list of all available transitions and how to execute them.

Cross Zoom

 

Zoom and a radial blur. The parameters to customize are:

  1. Strength (float, default 0.4): The strength of effect [0 – 1].
  2. Quality (float, default 20): Quality effect. [0 – 40].
1
 TransitionCrossZoom.Start(cameraA, cameraB, 1.0f, 0.4f, 20.0f);

Β 

Cube

 

Modern and elegant, Steve Jobs choice. The parameters to customize are:

  1. Perspective (float, default 0.7): Acuteness of the perspective angle [0 – 1].
  2. Zoom (float, default 0.3): How it moves away [0 – 100].
  3. Reflection (float, default 0.4): The strength of the reflection [0 – 1].
  4. Elevantion (float, default 3.0): How it rises from the floor [0 – 100].
1
 TransitionCube.Start(cameraA, cameraB, 1.0f, 0.5f, 0.4f, 0.3f, 2.0f);

Β 

Doom

 

Doom is back! and also his transition effect. The parameters to customize are:

  1. Bar width (int, default 10): The bar width [ 0 – …].
  2. Amplitude (float, default 2.0): Height difference between bars [ 0.0 – 25.0].
  3. Noise (float, default 0.1): Height noise [0.0 – 1.0].
  4. Frequency (float, default 1.0): Wave frequency [0.0 – 100.0].
1
 TransitionDoom.Start(cameraA, cameraB, 1.0f, 25, 2.0f, 0.25f, 2.0f);

Β 

Fade to color

 

The good ol’ fade using a color. The parameters to customize are:

  1. Strength (float, default 0.3): If 0 color has little influence on the effect, if 1, the color color influences and lasts more [0 – 1].
  2. Color (Color, default Color.black): The color.
1
 TransitionFadeToColor.Start(cameraA, cameraB, 1.0f, 0.5f, Color.white);

Β 

Fade to grayscale

 

The same effect as previous but with a mix in black and white. Highly hipster. The parameters to customize are:

  1. Strength (float, default 0.3): If 0, the image directly turn grayscale, if 1, the grayscale transition phase is very important [0 – 1].
1
 TransitionFadeToGrayscale.Start(cameraA, cameraB, 1.0f, 0.5f);

Β 

Flash

 

A transition with a flash and burned colors. The parameters to customize are:

  1. Strength (float, default 0.3): The importance of the flash in effect [0 – 1].
  2. Intensity (float, default 3.0): The intensity of the flash [0 – 5].
  3. Zoom (float, default 0.5): If 0, there is no zoom effect, if 1 the zoom effect is intense [0 – 1].
  4. Velocity (float, default 3.0): The speed of the effect [0.1 – 10].
  5. Color (Color, default (1.0, 0.8, 0.3)): The flash color.
1
 TransitionFlash.Start(cameraA, cameraB, 1.0f, 0.4f, 4.0f, 0.6f, 4.0f, Color.red);

Β 

Flip

 

Merciless compressed cameras. The parameters to customize are:

  1. Mode (Horizontal / Vertical, default Vertical).
1
 TransitionFlip.Start(cameraA, cameraB, 1.0f, TransitionAxis.Horizontal);

Β 

Fold

 

Like you fold the previous camera. The parameters to customize are:

  1. Mode (Horizontal / Vertical, default Vertical).
1
 TransitionFold.Start(cameraA, cameraB, 1.0f, TransitionAxis.Horizontal);

Β 

Gate

 

Knocking on game’s door ;). The parameters to customize are:

  1. Perspective (float, default 0.4): Perspective [0.0 – 1.0].
  2. Depth (float, default 3.0): Transition depth [0.0 – 100.0].
  3. Reflection (float, default 0.4): Reflection [0.0 – 1.0].
1
 TransitionGate.Start(cameraA, cameraB, 1.0f, 0.3f, 5.0f, 0.3f);

Β 

Glitch

 

Displacements of the RGB channels, it happens when they change something in Matrix. The parameters to customize are:

  1. Strength (float, default 0.4): The strength of displacements [0 – 10].
1
 TransitionGlitch.Start(cameraA, cameraB, 1.0f, 1.0f);

Β 

Gradient

This transition is based on the use of gradients. A gradient is nothing more than a grayscale texture. The transition will go from black to white.

For example if we use a gradient like this:

 

The resulting transition will be:

 

The parameters to customize are:

  1. Gradient (Texture): The gradient texture.
  2. Border size (float, default 0).
  3. Border color (Color).
1
 TransitionGradient.Start(cameraA, cameraB, 1.0f, gradient, 0.1f, Color.cyan);

Β 

I also include a β€˜Gradient Bankβ€˜, an asset in which you can add references to the gradients you want to use and so you won’t have to add them to the Resources folder. To create one one you just have to right click on the β€˜Projectβ€˜ window and then on the menu β€˜Create > Nephasto > Camera Transitions > Gradient Bankβ€˜.

In the folder β€˜Nephasto/CameraTransitions/Gradients/Texturesβ€˜ you can find more than 250 gradient textures. You can delete this folder if you are not going to use it. All are referenced in β€˜Nephasto/CameraTransitions/Gradiends/AllGradients.assetβ€˜.

1
 TransitionGradient.Start(cameraA, cameraB, 1.0f, gradientBank.textures[Random.Range(0, gradientBank.textures.Count)]);

Β 

Linear blur

 

Transition with a linear blur effect. The parameters to customize are:

  1. Intensity (float, default 0.1): Blur intensity [0 – 1].
  2. Passes (int, default 8): Blur quality [1 – 8].
1
 TransitionLinearBlur.Start(cameraA, cameraB, 1.0f, 0.5f, 6);

Β 

Mosaic

 

Random mosaic effect. The parameters to customize are:

  1. Steps (Vector2, default (1, 1)): Cell to jump to [-10 – 10]. Avoid jump to the same cell (0 – 0).
  2. Rotate (bool, default false): Random rotate cells? [true – false].
1
 TransitionMosaic.Start(cameraA, cameraB, 1.0f, new Vector2(2.0, 3.0), true);

Β 

Page curl

 

Page turn effect. The parameters to customize are:

  1. Angle (float, default 45): Turn angle [0 – 180].
  2. Radius (float, default 0.1): Page radius [0 – 1].
  3. Front shadow (bool, default true): Page front shadows [true – false].
  4. Back transparency (float, default 0.25): Back page transparency [0 – 1].
  5. Back shadow (bool, default true): Back shadow [true – false].
  6. Inner shadow (bool, default true): Inner shadow [true – false].
1
 TransitionPageCurl.Start(cameraA, cameraB, 1.0f, 60.0f, 0.4f, true, 0.25f, true, true);

Β 

Pixelate

 

Retro pixelated effect. The parameters to customize are:

  1. Size (float, default 50.0): Size of the pixels [0 – …].
1
 TransitionPixelate.Start(cameraA, cameraB, 1.0f, 75.0f);

Β 

Radial

 

Nice radial curtain effect. The parameters to customize are:

  1. Clockwise (bool, default true): Clockwise?
1
 TransitionRadial.Start(cameraA, cameraB, 1.0f, false);

Β 

Random grid

 

Chop the screen with random rectangles. The parameters to customize are:

  1. Rows (int, default 10): Rows [0 – …].
  2. Columns (int, default 10): Columns [0 – …].
  3. Smoothness (float, default 0.5): Smoothness of the transition between rectangles [0 – 1].
1
 TransitionRandomGrid.Start(cameraA, cameraB, 1.0f, 20, 5, 0.25f);

Β 

Schwifty

 

It’s time to get schwifty. The parameters to customize are:

  1. Intensity (float, default 0.3): Wave intensity [0 – 1].
  2. Amplitude (float, default 10): Wave amplitude [0 – …].
1
 TransitionSchwifty.Start(cameraA, cameraB, 1.0f, 0.4f, 12);

Β 

Simple

 

Because sometimes less is more. This transition is a simple fade, so simple that it has no extra parameters.

1
 TransitionSimple(cameraA, cameraB, 1.0f);

Β 

Smooth circle

 

Very cartoon effect. The parameters to customize are:

  1. Smoothness (float, default 0.3): If 0 the edge of the circle is not smooth, if 1 is very smooth. [0 – 1].
  2. Invert (bool, default false): Opening or closing?
1
 TransitionSmoothCircle.Start(cameraA, cameraB, 1.0f, 0.1f, true);

Β 

Smooth line

 

A nice cinematic transition. The parameters to customize are:

  1. Angle (float, default 45.0): Line angle [0 – 360].
  2. Smoothness (float, default 0.5): If 0 color has little influence on the effect, if 1, the color color influences and lasts more. [0 – 1].
1
 TransitionSmoothLine.Start(cameraA, cameraB, 1.0f, 90.0f, 0.1f);

Β 

Swap

 

Elegant transition between cameras.. The parameters to customize are:

  1. Perspective (float, default 0.2): Perspective [0.0 – 1.0].
  2. Depth (float, default 3.0): Transition depth [0.0 – 100.0].
  3. Reflection (float, default 0.4): Reflection [0.0 – 1.0].
1
 TransitionSwap.Start(cameraA, cameraB, 1.0f, 0.3f, 5.0f, 0.3f);

Β 

Valentine

 

Nothing says more β€˜I love youβ€˜ than a heart across the screen. The parameters to customize are:

  1. Border width (float, default 25): The width of the border [0 – 100].
  2. Color (Color, default Color.red): The color.
1
 TransitionValentine.Start(cameraA, cameraB, 1.0f, 50.0f, Color.black);

Β 

Vortex

 

Makes a teleport with style. The parameters to customize are:

  1. Distortion (float, default 0.3): Vortex distortion [0 – 1].
1
 TransitionVortex.Start(cameraA, cameraB, 1.0f, 0.5f);

Β 

Warp wave

 

Gravitational waves across your scene. The parameters to customize are:

  1. Mode (Horizontal / Vertical, default Vertical).
  2. Curvature (float, default 0.5): Curvature of the wave [0.0 – 5.0].
1
 TransitionWarpWave.Start(cameraA, cameraB, 1.0f, TransitionAxis.Vertical, 1.0f);

Β 

Wipe

 

The new camera pushes the old one. The parameters to customize are:

  1. Mode (Horizontal / Vertical, default Horizontal).
1
 TransitionWipe.Start(cameraA, cameraB, 1.0f, TransitionAxis.Vertical);

Β 

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

hello@nephasto.com