Crea sito

[UPDATE 2] Outline effect Unity 3D – Color Transition Package


Outline effect Unity 3D – Color Transition Package

We finally got it!
Our outline is an image effect designed to be extremely cheap and mobile friendly.
It uses just two simple shaders and 2 blit operations!

We are very proud of the result!
In the last screenshot we were showing an early working result, but we’ve soon discovered an hateful bug occurring for moving objects: the render texture was looking corrupted, and an odd trail was shown along the trajectories of the moving objects.

outline wrong result - Outline effect Unity 3D – Color Transition Package

The wrong result for moving objects – the static objects (cubes and spheres) look right, but the butterfly is leaving an unwanted trail – Outline effect Unity 3D – Color Transition Package

We couldn’t explain why it was not working correctly.
We supposed that for any reason, a render texture was corrupted when blit was done…
After MANY tests, we finally figured it!
It was NOT a render texture issue… it was just about blending!

In the first shader we use to draw the colored outline, we have set – WITH ABSOLUTELY NO REASON – the blending mode to

Blend SrcAlpha OneMinusSrcAlpha

the tipical blending mode used for additive effects, like particle systems.

Now we have just switched it to

Blend Off 

and magically everything works fine.

Here it’s the good result :)

outline-right-result - Outline effect Unity 3D – Color Transition Package

outline-right-result – Outline effect Unity 3D – Color Transition Package

The right result we have obtained!

Next step before our new release is the integration of the outline in our Highlighter and make it work with VR applications too..

Here it is the link to Unity work in progress page

Stay tuned! 😉