-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce VRAM usage #274
Comments
Disabling texture padding reduced VRAM usage by 50%: ddea2fd Godot documentation says:
|
Tried out prerendering the background here: This reduced VRAM usage: 0.75MB->0.4MB Note that I had to restore foreground map which made VRAM usage go up to 650MB again. WIll need to dedicate more time to removing unused tiles from foreground tileset. Breakdown of current VRAM usage (using prerendered background):
Also note that tower sprites are dynamically loaded while the game is played and will consume VRAM. |
Had to disable VRAM compression for creep atlases - there are problems on Web export. I also looked into using "Basis Universal" type of compression. It causes console to print these messages (not errors):
There is some discussion online but nothing conclusive. Decided not to proceed with this compression type because I don't understand the issue. |
Closing this because the biggest sources of VRAM usage were fixed and the game is back to VRAM usage levels from 0.7. |
VRAM usage has went up a lot since version 0.7, because of new tilesets. It was 0.8GB in version 0.7 and now it's 1.4GB in version 0.8. Should work on reducing it where possible.
For example, high VRAM usage causes crashes for some players: #273
Texture compression
None of the compression options are of any help.
Online tools like TinyPNG is same thing as Lossy compression - only reduces size on disk, doesn't reduce VRAM usage.
Empty space in tilesheets
We currently have a lot of unused space in tilesheets.
The first thing we should do is remove equal amounts of space above all tile, using a script. This way, the tilesizes will still be equal to each other and setting up tilesets will still be easy.
Later we can look into packing tilesheets tightly - but that will make setting up tilesets more complicated.
Also some tilesheets have empty tiles - should remove them.
Packing tilesheets
Decoration tilesheets can be packed like creep spritesheets:
Use PackSpriteSheet.gd script for that. Note that you need to fix the tileset after doing this.
Tileset duplication
We have two tilemap nodes - "Map" and "Decorations". We need two separate tilemaps because "Map" has tile size set to 256x128 and "Decorations" has tile size set to 64x32. This is so that tiles can be placed on the grid in "Map" but you can also do more flexible positioning of decoration tiles in "Decorations" tilemap.
When two different tilesets reference the same png, the png will be stored in VRAM twice.
For example, the "Floor.png" has two tilesets and it's memory usage is doubled.
Should avoid situations like this where possible.
The text was updated successfully, but these errors were encountered: