Im working on a system that creates a large 8192*8192 texture atlas of all the textures that are loaded into my game, Ive currently got it working using GetPixels and SetPixels but this takes upwards of 15 seconds to generate the texture atlas as it seems to be doing it 1 pixel at a time.
Is there any faster ways of doing it, like blitting or memcpy.
I looked at Graphocs.blit which i thought would be what I needed but you can only use that to blit to the entire texture, and as I’m creating an atlas I need to be able to blit to just small sections of the texture.
I have also tried setting up an orthographic camera to render to just small sections of the rendertexture, which worked but I couldn’t find a way to use the camera to just render a texture into that space.
If you can render everything into a large render texture, then it’s only a question of setting up proper orthographic projection (GL.LoadPixelMatrix might help here) and drawing some quads with the textures you need, at coordinates you need.
Thanks ive got that rendering using GL and the LoadPixelMatric, but the textures just come out as black, so i assume that my material setup is wrong, could you suggest what it might need to be.
Here is the code ive got, which at the moment is just to test rendering a 200 *200 quad.
Figured out that id forgot to put the tex coords in which has now made the texture appear like a mask, but i think thats prolly because of my unlitAlpha shader, i tried using the diffuse shader that comes with Unity but that just came out black.