ASFAIK we have SetPixels to completely overwrite a spoecific rect, but no way to “blit” some texturedata from one texture to another, using some binary operator like “AND” and most important, using hardware-blitting if possible. “AND” for example would be great to implement a eraser-brush with soft falloff…
The only way we can do this ATM is reading the complete block in question via GetPixels(), modifiy the resulting Color-array, and bring it back to the texture with SetPixels(). At least this is the way it’s done int the UnityPainter example on the wiki.
Are those operations speedy enough /hardware-accelerated ? (SetPixels/GetPixels ) ?
I have the iphone in mind here for all my queries…
copying things from texture to texture is done in shaders / combiners
setpixel / getpixel are cpu operations and result in a reupload of the texture
On the iPhone, no, uploading changed textures in realtime is too slow when using decent-sized textures. 3D is not like 2D and has different considerations. The speed of Set/GetPixels is somewhat irrelevant, because it’s Apply() that causes the big speed hit.
–Eric
thx for the replies…
actually i did implement a test where i erased a random block via SetPixels() and updated via apply about 2 * per second - even then the FPS hit on iphone was large enough to think about alternatives…
I have a little knowledge about shaders - but could give someone give me a quick kickstart how i would do the following:
- have a large (screensize) texture
- have 5 small “brush” textures
- “stamp” a specific brush into the large one (specific UV coordinates), by calling a specific script-function
is the above even possible ?
would’nt i have to do the stamping each and every frame in the shader
any hints and links would be welcome 
thx
That will not work
the iphone has 2 texture units only so you could only have 2 textures per pass.
on the iphone you won’t be getting anything like thta until render textures are present and potentially a function to draw a texture into another texture
thanks again for clearing that up for me…
man you are fast 
last question - i promise
would even only a eraser-brush be implementable than via shader ?