In one of the recent twitch streams @<a href=“https://forums.unrealengine.com/member.php?u=606” target="_blank">Luos</a> asked about a blend mode called called BlendAdd that was shown in a talk by Julian Love but no valuable answer came back so we started chatting about it and how it could be integrated into the engine. The topic also came up in the RealTimeVFX Facebook group with Julian itself helping out.
So after starting and investigating on what BlendAdd actually was I realized that the good old AlphaComposite blend was exactly the same thing. As stated in the UE3 documentation AlphaComposite:
In terms of a Blend Mode the result of the final color is expressed as
res.rgb = src.rgb + (dst.rgb * (1.0 - src.a)) res.a = src.a + (dst.a * (1.0 - src.a))
So what does this actually means is that the alpha part is already within the color of the material, this way you can control your opacity and highlight better. Long story short it fixes the issues with additive going to white and details vanishing on bright backgrounds. The next screenshots will give you a sent on what I mean by it (both has been overdrawn 3 times).
(The texture I used has been provided by my pal Douglas Kerr @ Phoenix Labs)
As you can see the right side tends to go to white with more and more overdraws while the left side still holds the details of the original texture.
This is what a typical graph looks like using AlphaComposite, note that I actually feed the opacity not directly in the opacity pin, I pre-multiply it with the actual color part to control the final opacity there.
Once I prepared a test build, @<a href=“https://forums.unrealengine.com/member.php?u=606” target="_blank">Luos</a> started to play with it which resulted in the following videos (he will record new ones with better examples ^^), his art skills are way better than my humble programming art :rolleyes:.
(You can fade the opacity by just multiplying it with into the color itself, the new videos will show that part a bit better)
The blend mode has already been pushed as a PullRequest to Epic that you can integrate yourself (or use the attached AlphaCompositePatch.txt file for version 4.10, just change the file ending to .diff or .patch).
So I guess that’s all for now try it out yourself and post your awesome effects!