Why does my fadeIn animation flicker?

Here is a playground Example to show the issue.

We use a very simple animation that changes alpha from 0 to 1.
This works, but when the animation ends, we see some flicker: i.e. the mesh is not shown for a short period of time (maybe alpha is 0 for whatever reason?).

When we change the alphaEnd to 0.9999 there is no flicker.

Any idea why this is happening?

Hmmm this is probably related to the blending modes, @Evgeni_Popov will certainly know what’s going on

Flicker occurs because a new effect is recompiled when alpha reaches 1: the shader is different when there’s alpha blending (alpha < 1) and when there isn’t (alpha=1), because alpha testing is enabled for the background material.

I’m not sure why the background material forces alpha testing, the simplest solution is to disable alpha testing:

3 Likes