Hi, im trying to merge textures in an atlass to bring the number of draw calls back. This works fine. However, for a big scene if i bring the max allowed atlass size above 512 it runs out of memory.
I am certain their is by far enough memory available on the video card so that is not the problem. However, to make the textures atlas they need to have the Read/Write flag set which forces them to be stored in host memory. Is there a way to get rid of unused textures in between the creation of the texture atlas or to suppress unused memory all together. I am using Javascript, switching to C# so that i can use the garbage collector is no option for now.
What i have tried is the following.
- Resources.UnloadUnusedAssets() => (this wont work since i have to yield on it so i lose my calling order which is quite important).
- Collect all meshes that will result in the same atlas as they are built up from the same group of materials. Then create an atlas for only the selected groups. Still goes out of memory.
- Destroy( unusedTexture ) => wont work get unity error: invalid bbla risking data loss…
- Texture.Apply( ) so that it becomes unreadable afterwards meaning that it is released from host memory according to docs…
Note, i have taken into account that mipmapping is applied to the texture atlasses and that if it contains alpha, DXT5 is used or if uncompressed RGBA textures are supplied the atlass will not DXT compress. I am certain there is enough device memory available.
Regards, bk