How to apply a bool[] to a texture?

For my fog of war system, I have an array of booleans that determines what color each pixel of the texture is How can I set the texture based on this array of booleans? Do I have to iterate through every bool to set the individual pixels of the texture?

Yes, you’ll have to iterate through the texture and bool array to determine result.

http://docs.unity3d.com/ScriptReference/Texture2D.SetPixel.html


For per pixel coloring, you need a fragment shader. I’m not sure if it is possible to pass in arrays, but you could transform your bool array to s texture 2D and pass that in.

Oh and you could do a postprocess effect