I'm having problems implementing this shader. I basically need to make a green screen. There will be two textures. One has many colors in it, but large areas of green. The second is the source texture. The shader needs to look at the first texture and replace any part that is green with the corresponding pixels from the second texture. I will need to change the color on it as well so I can set it up as a blue screen if needed. Anyone know how i can do that?
with a simple fragment program which generates the outcomming texture basing on 2 incomming textures. The first is the one that can have green, the second one would be the alternative then you would read the green pixel color component and if it meets your requirement, use the alternative textures pixel instead of the primary ones.
After reading through the shader documentation, I think I need to use ColorMask for this? Thats all I can figure out though. Anyone have a little more detail on what to use here? I can't figure out how to use the mask to pick which pixels will be replaced in the final texture.
Are you sure you aren't just looking for two cameras with one overlaid on the other? http://www.google.com/search?hl=en&...rum.unity3d.com+camera+depth+only&btnG=Search