Is it expensive to use SetPixels() every frame for a second or 2?

Hi,

I’m wondering if it is expensive to SetPixels() every frame? I have a GUI texture where I want to move a portion ( button of 100x100 pixels ) of it off screen while keeping the rest intact using SetPixels, but is this expensive?? I’m assuming that it is essentially storing the same amount of info as a texture of 100x100 pixels ( array of 10,000 colours, please correct me if I’m wrong ). And SetPixels, I assume, is iterating through the array of 10,000 colours whenever you use it.

Anyways, this idea stems from having one draw call for the whole GUI while still having the ability to move each individual GUI object (portion of the texture). Even though it would keep all GUI in one texture and one GameObject that never moves, will the SetPixels() and the memory that the array stores kill performance if used too much??? This is a save-on-draw-calls vs. is-it-causing-more-trouble-than-its-worth scenario…

Thanks in advance

My conclusion is this:

GetPixels can in fact do what I’m asking on mobile platforms and could be very useful in some situations, but the benefits do not out weigh the headache and overhead of storing blocks of pixels and writing them to the texture via CPU and transferring data to the GPU at runtime.

I have opted to take Supernat’s suggestion of creating a second camera and using a shared transparent material on quads assigned to a custom GUILayer and moving them via transform.

Thanks for all the suggestions