Key Node

Q and A about functionality and how to solve a special task for your application.

Key Node

Postby Joe Styles » 08 Oct 2014, 09:24

Hi guys,

Just wondering if anyone can help me with a mental block I am having.. I have used a a "key" node previously to make sure that things did not write to the key channel in broadcast. Basically I have a flare which is working via an additive blend but I don't want it to write to the key as it doesn't have a key.

I have a vague recollection that the key node was removed out of the toolbox but I think there was a new way to do it but I can't remember how. Any ideas?

Thanks!
Joe
Joe Styles
Kinetic Pixel
User avatar
Joe Styles
 
Posts: 73
Joined: 19 Jan 2012, 12:10
Location: UK

Re: Key Node

Postby Christian Krix Schmidt » 08 Oct 2014, 10:13

Hi Joe!

I ran into a similar issue a few months ago when I need to work with the Key node. You can still use it. Simlpy open an old scene that includes the node and copy/import it into your new scene. Then you hav the same funcionality. Otherwise the new way is to use the AlphaBlending node. In essence the Key node is nothing more than the AlphaBlending node with set parameters. Ventuz sent me a very detailed explanation about the whole thing. Here goes:


---------------------------------


We removed the KEY Node in Ventuz 3+ because it was not easy to explain which option (Key/Fill) result is which visual effect. The mathematical background of alpha and color blending is way too complex for being reduced down to just two Booleans… If you liked that node you can still use it. The node is just hidden in the Toolbox but still functional. You could create a repository with Ventuz 2008 and store the Key node inside. In Ventuz 3 or 4 load that repository and simply drag it into your scenes.

The key node does nothing else than modifying the Alpha Blending what can be achieved with the normal alpha blending node as well. The node has two booleans that affects the alpha blending as shown in this table:

Fill Key SepAlphaBlend ColorSrc ColorDest ColorOp AlphaSrc AlphaDest AlphaOp
---------------------------------------------------------------------------------------------------------
OFF OFF = No SrcAlpha InvSrcAlpha Add SrcAlpha InvSrcAlpha Add
OFF ON = Yes One Zero Add Zero One Add
ON OFF = Yes SrcAlpha InvSrcAlpha Add One One Add
ON ON = Yes One Zero Add One One Add

You can use these value directly in the alpha blending node to receive the same visual and technical results as the former key-node did.

I’ll try to answer you blending questions below in some words:

Overlapping or layered transparencies are only possible in additive blending resp. additive key mode if external key is used. Multiplicative (linear) key does not work to achieve the required visual effect.
When creating additive key signals it is important to understand what actually happens in the external keyer:
- The background gets “reduced” accordingly to the received alpha value/key signal.
- The fill (the graphics) is simply “added” to the “reduced” background
- The pre-multiplication ensures that the resulting color never exceeds its technical maximum when added (clipping)
The challenge is to create a proper key signal that exactly reflects the amount of background-reduction.
Imagine two glass panels that are 50% transparent. If you look through both you will see the background reduced by 75%. Because the second pane (src) reduces the rest light passed through the first panel (dest): 50% + (100%-50%) * 50%

This is the correct blending formula for combined transparencies when using external additive keying:

Color Blending: ResultRGB = SourceRGB * SourceA + DestRGB * (1-SourceA)
Alpha Blending: ResultA = SourceA * 1 + DestA * (1-SourceA)

You can use this values directly in the alpha blending node and store it in your personal repository. As you can see, this (correct) formula doesn’t appear in the table above – another reason why the key-node has been deprecated…
To disable drawing into the RGB or A planes, please use the Render Options node and uncheck the corresponding color channels.

Another important thing to know is that pixels with a zero value for alpha are not draw. This is a feature to improve the fill rates of the rasterizer – also known as Alpha Function. The default alpha function in Ventuz is “greater zero”. You can use the alpha function node to change this behavior or disable it in general.

------------------

Hope it helps. All the best!
Chris
Christian Krix Schmidt
 
Posts: 270
Joined: 18 Jan 2012, 11:36
Location: Dubai, United Arab Emirates

Re: Key Node

Postby Joe Styles » 08 Oct 2014, 10:28

Hi Chris!

That is very helpful thanks.. it is a great description of keying and additive blending! Useful to know that the key node live on but is just a bit hidden in the "Render Options" node.

All the best,
Joe
Joe Styles
Kinetic Pixel
User avatar
Joe Styles
 
Posts: 73
Joined: 19 Jan 2012, 12:10
Location: UK


Return to How to...

cron