Download

Fade meshes, but also control transparency

Hi! There is some trick I am trying to pull off for a long time, but can’t figure out how.

Basically. 2 static meshes. 1 fades in, other fades out. Those are sprites, same position. All works well, looks like a transition.
But.

At some point, in a middle of the fade, I can totally see what is behind the sprites (translucent materials, forward rendering).
And I want to get rid of that effect. I need the area, where sprites overlap, never go below 1. So that it should never get transparent.

Maybe there is some trick, where I can write directly from material into some global translucency channel, to make sure that certain pixel never gets transparent or something like that?

Hmmm, maybe I can add 3rd sprite, and render it to some custom depth channel only. But then how its material should look like?