How to reduce size of texture in build?

i have started porting this monster gemnerator for Defold.
154 * 30 kB images (png optimized for web) has after build 158 * 10623 kB ( generated****.texturec )
How i can reduce texture file size in build?

If you put all of the images in an atlas or generate a tilesource file you will be able to apply texture compression on it:

problem is in build where png images are compiled to texture, all this job ( generate atlas and tilesources put property line in go.fabric)i have writed in python
it look as low level work,

create map<string,mem>
load all png images to mem buffer
decode when is needed to dds
use multitexture quad

job for stl
i flused this project out of work

The easiest way to create an atlas is described in the documentation:

thank you for suport, bat i have 128 x spritesheets 700x300 pixel x rgba with 30kB mem size in png.
in build is compiled to ziped VRAM texture? hardware compesion? so size is 4mega

look at images
https://www.bing.com/search?q=Universal-LPC-Spritesheet-Character-Generator

The images you put into an atlas will be converted into a texture resource in your game. The texture will be compressed if you are using texture compression. How much it will be compressed depends on how you have configured the texture compression (see previous link to the manual on texture compression). We use Basis Universal as the intermediate texture format and at runtime it will be converted to a platform specific compression format.

1 Like

thanks
i had incorrect question.
so it is posible in build export png file( no texture)
and in runtime create texture ?
from gideros:

local bmp = Bitmap.new(Texture.new("ball.png", true))
bmp:setPosition(100, 100)
stage:addChild(bmp)

from start
i wont build roqu3like rpg with generated content - maze, srory, quests , npc, enemy. exac5ly i dont know in build time what wil used. i had more then 100 spritesheets wih 30 kb size after build i will have 100 textures with 4mb. add all preeteshet to atlas dont solve problem becse texture size is limited( spriteshets has 700 x 300 pixels) . and BTW texture compile with compresiontime is terrible.
you see difference 30kb100 vs 4mb100?

soory i write on mobile and english is c3 level

and plese dont spawn own forum wiIth BFU RTFM, you can have question to.

I have no idea what you are saying here, sorry.

Defold is not designed for this kind of scenario. In Defold we prefer to know about the data used in the game up-front. It is much more performant to create textures at build time than at run-time.

Yes, there is obviously a limit to have many images you can keep in memory at once. This is not something unique to Defold. You need to manage memory usage somehow. You can’t load 100’s of individual spritesheets either. You need to decide what to load and when. In Defold you can have many atlases or tilesources too, but not necessarily have them loaded all at once. For factory components there is an option to lazy load the resource using factory.load(). This will help you manage resource use if you have more resources than you can have in memory all at once.

1 Like