![]() ![]() ![]() The fact that desktop drivers do allow for automatic mipmap generation and runtime recompression of DXTC textures is outside of the spec. There's no interaction between the two extensions in their spec, nor any comments about the later allowing for runtime compression to those formats. GL_EXT_texture_compression_s3tc is explicitly only for loading and decompressing DXTC format textures of the types DXT1, DXT3, and DXT5. GL_SGIS_generate_mipmaps is explicitly only for handling uncompressed textures. Is it going to be faster than what you can generate in Unity? Probably. For Direct3D the spec actually defines what formats can be used, and any compressed textures are supposed to fail silently(!?), though I suspect it'll work there too for DXT1 & DXT5, at least for non-mobile Direct3D.īut yes, this is happening fully on the CPU, not the GPU. On Desktop, AMD & Nvidia will certainly accept DXT1/5 textures. I've heard some Mali devices will accept ETC1 textures, but that's a fairly simply format so it's plausible to do real time compression of those on a mobile device (but it's still going to be pretty slow). Something like ASTC takes a beefy desktop PC several seconds to minutes(!) to compress, so there's no way a mobile GPU can do it. Textures that are imported by Unity in the editor, or when calling tex.Compress() will generate the mipmaps on the CPU as part of the import and compression rather than on the GPU to ensure the CPU side has access to those mipmaps for storage & optional script level access.ĪFAIK if you try to upload a compressed texture and ask for automatic mipmap generation on a mobile device you'll either get an error, black mipmaps, or an uncompressed texture. Plus you really don't want to be generating mips from the compressed image, only from the uncompressed source, otherwise any compression artifacts will be amplified. GPUs hardware cannot generate mipmaps for compressed textures since GPUs don't have built in acceleration for re-compressing those textures and all mips must be using the same format as the top mip. Texture2DArray, Texture3D, and CubeMap all have similar setups.įor a RenderTexture, this is set by if mipmaps and auto generation are both enabled.Ĭompressed textures are different though. If you want to convert a PNG that has no transparency to a dds file with the best quality you should do this:Ĭonvert input.png -define dds:compression=dxt1 -define dds:cluster-fit=true output.Automatic, hardware generated mipmaps is enabled by default for all dynamically created uncompressed textures.įor a Texture2D, if the texture has mipmaps enabled (controlled by the Texture2D constructor), calling tex.Apply() on them to upload the texture to the GPU automatically generates the mipmaps on the hardware.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |