The new SetPixels32 block override in Unity 5

Ok so… been waiting for ages for a faster way to upload parts of an existing texture. I see Unity 5 now adds an override to SetPixels32 which lets you set just a rectangular block of pixels. Sounds helpful… not to have to set all the pixels in the entire texture.

What I’d like to know is, once you call Apply(). … will it ONLY upload the blocks of pixels that were modified (e.g. like with glTexSubImage2D()) OR will it actually still upload the entire array of pixels/the whole texture over the graphics bus?

I guess I could sort of test this with an experiment, but I’d like the official verdict.

If not, then as a feature request, I’d like to see like ApplyRect() as a new command… like Apply(), which accepts a rectangle, describing which portion of the texture actually gets applied/uploaded… so the whole thing doesn’t have to go over the bus every time. That would be really helpful.

Logically, Apply has no way of knowing what you did with SetPixels32, so the only possibility is that Apply uploads the entire texture as always. But yes a ApplyRect function would be nice.

–Eric

Understood… but I know what rect I want updated… so if I were to do

a) SetPixels32() - modify a rect using known coords
b) ApplyRect32() - upload only that known rect using same coords

then Unity doesn’t have to keep track of where the rects are. Although… maybe it’d be nice for it to keep a log of calls to SetPixels32() rect version, so that those rects are then uploaded as multiple partial uploads automatically?

:smiley: