Large textures, mipmaps and SystemInfo.maxTextureSize

Suppose my game uses 4k-sq textures in many places. These are loaded from an assetbundle, where they have mipmaps.

Suppose further that the user is on a (probably Android) device that only supports 2k-sq textures (of which there seem to be plenty, even though they claim to support OpenGL ES3 and have bonkers high res displays…)

(1) When I load the 4k-sq Texture2D asset on these devices, will it just fail, or will it return me a 2k-sq texture based on the next mipmap?
(2) Is there any way to force devices to load from the next-mipmap down when loading a Texture2D, e.g. for the (many) Androd devices that only have 1.5Gb of memory but think they’re OpenGL ES3 and capable of 4k textures…

Obviously I can achieve the above by having multiple assets in the bundle, or variants of bundles, but that’s a load of complexity I’d really rather not manage when the data is already there anyway (because the second mipmap basically contains what I want.)

I should add that I know about QualitySettings.masterTextureLimit, and we used it in the past by setting it in a bootstrap scene (so 1 for crap devices and 0 for normal devices), then made sure the UI had no mipmaps so it stayed crisp. But in this case we’d really rather explicitly load using one mipmap down, and I think changing that setting at runtime will evict mipmaps, correct?

Hi!
(1) If the device doesn’t support 4K textures and you try to load one, it will fail.
(2) QualitySettings.masterTextureLimit is really what you want. It skips loading the higher mipmap levels.

1 Like

OK cool, we’ll go back to our old style with a Bootstrap scene to set masterTextureLimit, and making sure that the UI has no mipmaps.