Skip to content

Assets & budgets

Open Markdown

Viewpoint keeps assets in memory pools. Each pool has a maximum size. Viewpoint counts your assets in the pools for your package. The card shows your part. If a pool is full, Viewpoint refuses your next asset. It never removes the assets of a different package to make space.

AssetPoolDefault size
Modelsmemory.packMiB (video memory)768 MiB
Texturesmemory.packMiB (video memory)768 MiB, together with models
Soundsmemory.soundMiB128 MiB
Data files (16 MiB maximum each)memory.addonDataMiB (memory)64 MiB
Shader snippets, Lua exports and the text of Shaderpacksmemory.addonDataMiB (memory), together with data files64 MiB
Buffers and textures that you make with Gpudraw.gpuMiB (video memory), for each addon64 MiB by default; you set the amount, more than 128 MiB with the permission vram
Tile texturesmemory.texturePackMiB (video memory), and memory.texturePackDiskMiB on disk256 MiB, 1024 MiB

The player can change the pool sizes in Viewpoint’s settings, on the World, Memory page.

Tile textures are different. If the tile packs that the player selects need more, Viewpoint increases their pools, and memory.floorMiB and memory.wallMiB, so that the tiles keep all their detail. See Tiles.

If there is no space for your icon, the card shows a tile with a letter.

The Performance tab shows an estimate before the package loads. Viewpoint calculates it from the file headers when the tab opens.

WhatEstimate
Video memory, textureswidth × height × 4 bytes × 4/3 (with mipmaps)
Video memory, modelsvertices × the vertex size + indices × 4 bytes
Memory, datathe file size
Memory, soundssample rate × channels × 2 bytes × duration
Memory, classesapproximately 3 × the class bytes in the jar
Video memory, targets of a Shaderpackthe targets that the pack declares × the size of the output × the size of the format
Main-thread time, for each hookcalls each frame × the measured cost of one call, or unknown until measured
Graphics-card timemeasured only

A texture of 2048 × 2048 pixels uses approximately 21 MiB with mipmaps. A texture of 4096 × 4096 pixels uses 85 MiB.

The video memory of the Gpu objects works in a different way. Your addon asks for an amount in draw.gpuMiB, and Viewpoint gives it when the addon starts:

  • Viewpoint sets no limit on the amount. The graphics card of the player is the limit. The card of your addon shows the amount to the player, and more than 128 MiB needs the permission vram.

  • When your addon asks for a buffer or a texture past its own amount, the call fails, and the message names draw.gpuMiB.

  • Viewpoint frees all your Gpu objects when the addon goes off.

  • The load of that asset fails.

  • The error names the pool. The card shows the same error.

  • Your other assets stay loaded.

To correct this, release an asset that you do not use. Or ask the player to make the pool larger.

Viewpoint decodes your assets on a different thread. It counts that time for your package. Viewpoint sends the assets to the graphics card a little each frame. Viewpoint reads and parses a Shaderpack on this thread also.

  • Load an asset when you need it. Release it when you do not need it.
  • Use one texture for many models.
  • Use one texture of 1024 × 1024 pixels in place of four textures of 512 × 512 pixels that you always use together.
  • Use ogg for long sounds.