DungeonDame Posted July 3, 2020 Share Posted July 3, 2020 For my desktop-only web game, I'm loading textures into the GPU before they are needed so that it runs smoothly. I also cycle through all the textures in a hidden layer so that the automatic garbage collection doesn't unload them. Does anyone know what a reasonable maximum total filesize is for textures I have loaded at any given time? For example, what If I have 100mb of textures always loaded into the GPU, would you expect it to work for almost all users (on desktop)? I was hoping to find something like this that shows the maximum texture dimensions. If you're wondering why I want to load so many textures for a web game, it's a large-scale game and I implemented a streaming system so the files are downloaded before they're needed to cut loading time. I'm loading them into the GPU like this (pixi 5.2.4): app.renderer.texture.bind(myTexture) Thanks! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 3, 2020 Share Posted July 3, 2020 How do you count those 100MB? Quote Link to comment Share on other sites More sharing options...
DungeonDame Posted July 3, 2020 Author Share Posted July 3, 2020 (edited) 44 minutes ago, ivan.popelyshev said: How do you count those 100MB? It could be 200 spritesheets that are 500kb each for example. Some of the characters are real people on filmed on green screens, and I want the resolution to be as high as possible. And just one of these characters could be a couple dozen spritesheets. Edited July 3, 2020 by DungeonDame Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 3, 2020 Share Posted July 3, 2020 In videomemory, each pixel of RGBA costs 32 bits (4 bytes). Its not tied to the size of png file, its tied to dimensions of image Quote Link to comment Share on other sites More sharing options...
DungeonDame Posted July 3, 2020 Author Share Posted July 3, 2020 (edited) I was hoping to handle something like 100-200 spritesheets that are 2700x2700 each. Edited July 3, 2020 by DungeonDame Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 3, 2020 Share Posted July 3, 2020 (edited) That's 2.9GB . OK, you can use compressed textures (DDS, PVR, Basis, all that stuff), that's 8 bit per pixel. >700MB anyway Edited July 3, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
DungeonDame Posted July 3, 2020 Author Share Posted July 3, 2020 17 minutes ago, ivan.popelyshev said: That's 2.9GB . OK, you can use compressed textures (DDS, PVR, Basis, all that stuff), that's 8 bit per pixel. >700MB anyway Do you think ~3gb would be too much for some users? It would be helpful if I knew a reasonable maximum size to aim for in order to accommodate almost all users. Also, I suppose now I'll cut out as much blank transparent space as possible. If by doing this, the overall dimensions are half in size, does that mean it takes up half as much memory? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 3, 2020 Share Posted July 3, 2020 (edited) > Do you think ~3gb would be too much for some users Definitely. 700MB is big amount on its own. Yes, if you make 2x less area, it will take 2x less space. Think if you can actually use compressed textures too - but it depends on the type of your alpha. 1. try pack an atlas to DDS (dxt5) and see the difference 2. for DDS-ed atlas, make sure texture packer uses x4 coord divisor , because if an animation frames have different offset modulo 4 - artifacts will be animated . Its 16 bytes per 4x4 pixels, that's why. Edited July 3, 2020 by ivan.popelyshev DungeonDame 1 Quote Link to comment Share on other sites More sharing options...
DungeonDame Posted July 3, 2020 Author Share Posted July 3, 2020 That's very helpful, thanks a lot. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.