Automatic Texture Pack Generation at Build Time.

Hello All,

I’m wanting to automatically generate lower resolution textures at build time for each texture for an FBX model. Essentially generating the texture packs at compile time in a custom pipeline.

I’ve been playing around with the pipeline extensions but have been having trouble finding a way to shrink a texture during the TextureProcessor call and then saving this modified texture separately. If MipMaps are generated, is there a way to save each one separately?

Thanks in advance.

I think Mipmaps are stored within the original file and used by the rasterized when needed/specified by a shader. If they could be accessible each as single file would require more 'load" calls in loadcontent and be wastefull…


Thanks for your response @Alkher.

Yes, it would mean more Load calls, but the idea is to split the texture automatically into different sizes at build time. This is so that at runtime a user could choose different Texture size for a model. i.e. On a less powerful machine a player could load a ‘Low Quality’ texture pack of 64x64 px textures, where as someone with a higher end machine can choose a ‘High Quality’ at 512x512 px textures.

I think the only thing I still need to do is figure out how to call BuildAsset multiple times using the texture data during the Process() call.

I think it is the best way to save memory and bandwidth. But nowadays having 8Go of RAM or more is common.
If you target mobiles it sure can help these devices.

I assume it is something not far from what I did to generate normals from textures automatically. (better than not having one with deferred)

it talks about powerof2 resize, but it is I think a good start.


You could also set the mipmap level to be mapped to the quality the user chooses, and use this value.
But I suddenly have a doubt, I’m not sure if the mipmap is accessible with shaders in monogame, I remember having read about that somewhere here…

The mipmaps are saved individually in the XNB. Maybe you can make an custom Importer and a contentLoader to load your textures starting from any mip level.

There’s a discussion on this at