I am working on a 2D game project using the Orthello plugin, and my current idea would benefit greatly from the ability to unload certain meshes and their sprites based on their distance from the player. My hope is the that engine does this automatically, but probably not, so how could this be done through script?
Oh, while on the subject, is it possible to view the current VRAM in use in realtime?
Any help is greatly appreciated, thank you.
There’s no direct control over VRAM. What you’d probably do is re-use the current meshes, and update them with new information as necessary.
–Eric
Unity did mention they had something going for mobile at 60fps which did this - with hinting - but I haven’t heard of it since. It’s a very useful thing to have though.
Thank you very much for the replies. It is unfortunate to hear that there is no direct control over VRAM, but is there any sort of indirect control–perhaps a way to unload an object entirely which would trigger a VRAM release? Reusing the current meshes gives me an idea though. What if I made a single 2X2 texture that would replace the real texture when offscreen? At that point the engine should unload the real texture from VRAM as it is not visible… right?
@hippocoder: I am not sure exactly what you mean by hinting? I am indeed targeting mobile devices in addition to desktops and such, and this VRAM optimization is mainly for mobile. I am not too worried about FPS since it is a simple 2D game, but rather the memory usage since my design is very texture heavy.
EDIT: Er, the engine may do this automatically. I turned on the stats and it appears that UsedTextures properly decrements when offscreen. This is great news if it is what I think.