How is geometry stored in vram?
How is geometry stored in vram?
How is geometry stored in irrlicht? For example, if I load hundreds of models into ram, but don't render them, will they never be uploaded to vram? And if I render them all, do they stay permanently in vram until I manually clear them? Or does it only access ram every time it renders and then it no longer remains in vram? I'm not sure about this
Irrlicht is love, Irrlicht is life, long live to Irrlicht
Re: How is geometry stored in vram?
If you don't render they won't be uploaded. IMesh/IMeshBuffer have a function setHardwareMappingHint. When using EHM_NEVER it will send the data over the bus each frame. Which can make sense for animated meshes which are changed each frame on CPU or very small meshes. Which seems to be even default.. which is generally a bad idea. As nearly always you want EHM_STATIC - then it just stays on GPU. There's also dynamic and stream - but those are all really just hints for the hardware and it depends on the driver if it cares about those in any way.
Things always stay on GPU memory until it needs more memory and then decides what it kicks out (that's where those hints probably come into effect - but that's just me guessing).
So... generally - overload the default Irrlicht hint after loading static mesh. And yeah, I'm a bit surprised this is still default... now wondering if I should change that.
Things always stay on GPU memory until it needs more memory and then decides what it kicks out (that's where those hints probably come into effect - but that's just me guessing).
So... generally - overload the default Irrlicht hint after loading static mesh. And yeah, I'm a bit surprised this is still default... now wondering if I should change that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: How is geometry stored in vram?
Thanks for the information, I intend to use static geometries to simulate the shadows, I'm just worried that the vram will overload or something, it's an isometric game with loading screens, and from what you said, now I intend to clean the vram when moving from one city to another or something like that.
Since it is an isometric game, I can simulate the shadow gaining transparency as the pointlight approaches...
Since it is an isometric game, I can simulate the shadow gaining transparency as the pointlight approaches...
Irrlicht is love, Irrlicht is life, long live to Irrlicht