NDI In alpha misbehaving

Hey everyone,

I’m trying to get NDI output from a couple of sources (Unity and openFrameworks mainly) into TD, and noticed what I believe to be a bug in the NDI In TOP. As you can see in the pictures below, even though the alpha channel in the NDI sources is set to 0, it still shows the other channels, only semi-transparent. I don’t believe it to be an NDI bug, because when I send the receive the same source into an openFrameworks app it doesn’t show any background at all.

unity_clear_color.png


The smaller image is coming via NDI from Unity.

The only way I can get the alpha completely transparent is setting it as a full black with alpha.

Did anybody experience something like that? Is there something I’m missing here?

Thanks!

TouchDesigner assumes premultiplied alpha. That means that the alpha value can never be less than the values of any of the R G or B components. You can use the Math TOP to multiply RGB by Alpha to get premultiplied alpha.

For our viewers we use an Over operation, which is defined as:
A + B * (1.0 - A.a)

So that’s why the top layer still gets shown even if it’s alpha is 0.

Hey Malcom, thanks for you answer.

In that case, I don’t have layers, it’s the signal straight from the NDI. Does that still apply in the same manner? I have to take it to another operator to get the clear alpha anyway?

Thanks

Right but you are just looking at the visualization in the viewer, which is A (your image) and B (a checkerboard background), so there are two layers. You can change your preferences for TOPs to show black for the background instead of the checkerboard if that works better for you.

Your data is being maintained though, so if you are sending (255, 0, 0, 0), that is what your images are in the NDI In TOP. You can use a TOP To CHOP to inspect the values.

Got it. I followed your idea of using the Math TOP and it worked nicely, thanks!