AvailVidMem()
Blitz3D Forums/Blitz3D Programming/AvailVidMem()
| ||
I am running a car on a long road which is getting generated as the car travels. The road is made up of child models which i am hiding and showing to enable culling in blitz. I have noticed that available video memory keeps on going down as i move ahead and generated tracks. What could be reason? Need help For i=1 To CountChildren(road) If EntityDistance(mycar,GetChild(road,i))<100 ShowEntity GetChild(road,i) Else HideEntity GetChild(road,i) End If Next |
| ||
Hiding an entity doesn't free up the memory that the entity uses, or the vram assigned to any textures applied to it. |
| ||
Is there any solution to avoid this memory loss? |
| ||
if you've constructed each section of your road from separate textures then you're going to run out of memory pretty quickly. Way around it is to use fewer textures, using the same texture repeatedly where possible. |
| ||
I do the same thing in my game. If you show all the meshes at the same time and check the memory, that should show approximately how much vid memory the level will take. It shouldn't be a problem. If you are generating a new mesh each time you come to a new section then that might be a problem. |