PDA

View Full Version : dynamic color key wityh RC ?



dorinm
01-01-2003, 07:07 AM
hello to all and a Happy New Year !

it's just came up to me... is it possible to do dynamic color keying just using register combiners? any clues?

zeckensack
01-02-2003, 05:33 AM
Use DOT3 and alpha test.

SPARE0=Incoming color - Key color
SPARE1=SPARE0 DOT3 SPARE0

Then use mux to do a conditional assignment to the alpha channel of output. If the result of the dot product is zero, the incoming color is exactly the color key. You'd assign zero then (or anything else that fails the alpha test). Otherwise assign full alpha (or whatever you need).

You can extend to ranged chroma keying by adding some threshold to the result of the dot product before muxing but it will consume yet another general combiner.

Good luck.

dorinm
01-03-2003, 07:11 AM
thanks, I just tried out...
it's kinda tricky using pure API (opengl), but it works...
thanks http://www.opengl.org/discussion_boards/ubb/biggrin.gif