Is it preferred/more efficient to use RED or RGBA for WebGL texture storage when dealing with non-texture data. More specifically, when talking about "non-texture data" I mean data that isn't meant to just be rendered, but rather read from the GPU as information to use for something else. For instance a 1D texture could be used to store an array of the lights in a room. I was wondering whether or not it's preferred/more efficient to use RED or the whole RGBA texture when using textures for this purpose. (Please note that the data is stored within multiple units themselves, which are larger than the value used by the texture whether it be int, byte, or float, so I'll have to do multiple queries and some bitshifts to get things in place.)
Texture queries are rather expensive compared to other shader calculations. It's faster to fetch one RGBA sample rather than four individual RED samples. The equation would change if you needed only a single float number -- then fetching from RED would be faster than fetching RGBA and extracting the intended value. From the sound of it you're interested in the 1st case (1 RGBA vs 4 REDs).