How can I get the alpha channel from Lerp output to pipe to Opacity

So I have several FlipBook nodes in my material graph. The nodes are used to extract characters from a font atlas map. I use several half white/black images into the Alpha of my Lerps this is how I combine all the letters together to form a string. The very last Lerp goes to color, and also to Opacity. Everything works great if I use text that is any color besides white or black. I believe what I need to do is somehow get the alpha component of the final Lerp and link that to opacity. Currently it will clip out black, but I want to make my font white with a black outline. Currently only red text looks good at the moment. My font atlas has transparency, and the characters are all Monospaced.

I thought maybe there would be an easy way to do it, but I can’t seem to figure it out.

This image shows (Terribly I’m so sorry) how I connect the flipbook nodes to produce the final output. The super huge massively tangled mess of nodes has an identical copy which is how I form two lines of text.





I may have come up with 2 possible solutions. One would be to create a duplicate of my font texture with white text and stroke the text white. Then perform the same building technique as before but then use it as the opacity. This should create a white outline with the same letters witch is slightly bigger allowing the black stroke around my white text to be preserved. My other idea would be to use some nodes to create a mask that would achieve the same thing perhaps one-minis can do this for me. As a last resort perhaps I can fill my transparency in the texture with pink and use a chroma key node to remove it. I’m going to have to test all 3 and see if I can make something work.

I figured it out, and it was simple! So I changed my texture atlas background to pink, then with One-Minus and Component Mask was able to get the black stroke of the text to turn white, everything else black including the middle of the text (This basically just makes a black / white image with the text stroke being white at this point passing to opacity would make transparent text with a black outline). I then Lerp’ed between the pre-masked and masked which gives me solid white text and pink background which I then mask one more time giving solid white text and black background before finally passing to opacity.

1 Like

Now I just have to figure out how to fix the Frac artifacting without disabling MipMaps. Another rabbit hole, but I have some ideas. I read people use DDX and DDY but I don’t think I can here because I am using FlipBook. I also cant use a custom flipbook node as they are baked into UEFN and you cant edit them. Perhaps I could copy make the custom node in UE5 and import it.

Edit: Fixed by passing the UVs output from each flipbook into a texture sample and using DDX and DDY with that node.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.