I have done few 2D games. I have a solid understand of most of the techniques that are used in 2D games. But I haven't worked with 3D yet. I'm wondering, How do game engines deal with loading so many textures without running out of VRAM?
So lets say you have a 100 models. each model have a 4k texture. Now each texture size is roughly around 67MB (4096x4096x32). So if we render all 100 models with 4K textures that would have a size of 6.3GB (100 x 67MB). Most video cards have 1-2GB of VRAM. So how do engines deal with that amount of data?
I understand that engines use Occlusion Culling to only draw models that face the camera. Is that how they also deal textures? Load only textures that are visible to the camera? Do they load it at runtime? That might be slow. Do they use some kind of Level Of Details algorithm to only load the 4K textures when you're close to it? i don't know.
How is this done exactly?
Correct me if I'm wrong, but you also have to factor in texture compression. A 4x4k texture is 16MB compressed last I checked. Add mipmapping and it's 21MB.
At the same time, more is stored on video cards than textures. You also have to factor in that the average player will probably want at least 4x AA and 1920x1080 resolution, leading up to 50-100MB framebuffer being used.
But the best way of figuring it is, few games have 100 unique humans in the world at once. And if they do, the textures of each human probably don't exceed 1x1k. Either that or they have a major engine and have completely figured a way around this problem.