Doubts about Color Tracking example code
Wed, 06/13/2012 - 04:46
Hi Brad Larson,
Your example application was very useful to me. But I have a problem, I'm pretty new on this and I want to change the white color to red. The white color I'm referring is the one you used on the threshold method to exchange with the color selected. How can I change this to red? Thanks in advance.
Regards
In the ColorObjectTracking example, look at the Threshold.fsh fragment shader, which is what does the color replacement in this case. The simplest way to modify this shader to do what you want is to replace the vec4(1.0) vector in the last ternary operator within the maskPixel() function with a vec4 containing your target color. For red, that would be vec4(1.0, 0.0, 0.0, 1.0).