The asset variant system is finally here! :D This thing was a beast, interrupted several times by other priorities, but now it's finally here and fully functional!
This is a major performance optimization,
significantly improving loading times to a fraction of what they were before, reducing memory and VRAM usage for textures by factor of 4 to 8 and improving rendering performance by reducing GPU memory bandwidth.
There are still some things to do on this, add support for more formats (e.g. BC6H for HDR, BC7 for high quality), bring this to Quest, add more asset types (e.g. cubemaps), but this should already offer major improvements and make adding more functionality on top of this system much faster and easier.
New Features:
- Added Asset Variant System, which allows loading of optimized variants of assets based on device properties and generating and storing metadata
-- This currently features textures. Majority of textures are now compressed using BC1 (no alpha) or BC3 (with alpha)
-- The stored textures are also crunch compressed, significantly reducing their download size and disk usage
-- This significantly speeds up texture loading times and reduces CPU usage when loading objects and worlds, often to a fraction of original time
-- This also significantly reduces memory usage (both system RAM and video memory), by factor of 8 for textures without alpha and 4 for textures with alpha
-- Additionally it has significant improvements for rendering performance by reducing the GPU memory bandwidth utilization, by keeping the textures compressed in VRAM
-- The new system downloads and loads textures progressively from smallest mipmap to largest, reducing the latency from starting of the load to first visible texture. The texture will progressively get sharper and shaper as it loads.
IMPORTANT: The system is currently running in hybrid mode. When you load a world or item that hasn't been processed yet or has lower quality processed textures, Neos will load those and queue processing on the cloud. It might take up to a few hours to generate variants for the textures (usually just a few minutes if the load is low) and get the full benefits of the asset variant system.
I recommend visiting common worlds and spawning items that you want to get processed in the system for normal use. If you notice any strange artifacts or corrupt textures please report it as soon as possible and include the URL of the corrupt texture.
CURRENT LIMITATIONS: Currently any locally imported/created assets are processed individually on each user's end, transmitting the original files. This will be changed later.
- StaticTexture2D now has PowerOfTwoAlignThreshold property
-- This will automatically align the requested size to nearest power of two if it's within a given percetange (default 5%) of pixels away from it
-- E.g. 4096x4080 will be auto-aligned to 4096x4096
- StaticTexture2D also has "Uncompressed" property (will be changed in the future for more fine-grained control)
-- Checking this will load the original uncompressed variant, but still using the asset variant system if possible, reducing some workload
Optimizations:
- Rewrote database querying to use System.Text.Json with new Cosmos Stream API for more efficient deserialization
- Optimized various parts of database querying
- Optimized entity sanitization on the cloud server to reduce CPU usage
- Headless Client/Server now doesn't load cloud 2D textures at all, only fetching metadata from the cloud, significantly reducing CPU and memory usage
- Deprecrated legacy headset and controller objects - they are now loaded from updated variants from the cloud
-- This allows variants to be generated and stored for them in the cloud
-- Also speeds up startup by avoiding parsing of the model objects synchronously
Tweaks:
- Zero-G locomotion preset now has three axis rotation by default (based on feedback by @Veer )
- Upgraded to Unity 2019.2.11 (from 2019.2.10)
- Removed TextureOptimizationTip
Bugfixes:
- Fixed continuous texture updates for all textures with different width and height due to variant comparison error
- Fixed race condition when updating texture properties, resuling in the texture getting stuck in its last updated state
- Fixed headless client/server not respecting overriden Data & Cache folders (reported by @Bom "Bitman" bomb (PolyLogiX) )
- Fixed synchronization context flow for async tasks started on background thread
- Fixed newly uploaded cloud assets not getting correctly MIME classified
- Fixed exceptions in Billinear bitmap sampling for textures with size 1 along any of the dimensions
- Fixed TGA and other image formats not getting properly classified in the cloud, preventing asset variants from being generated
- Added exception guard to fetching cloud sessions, to prevent lingering of sessions on the session joiner and get more diagnostic data (based on feedback by @H3BO3, @Hayden (PolyLogiX - ZyroDesign) and @Coffee )
- Fixed World Orbs not initializing automatically when first created (this fixes problem with saving worlds to inventory reported by @Medra )
- Fixed LogiX tooltip and nodes breaking when connecting new input to a node that causes it to swap to a different overload with different set of inputs and outputs
-- This fixes issue when plugging an enumeration to a ToString node reported by @Coffee
- Removed logging of certain failed gather jobs (thumbnails and not found) to avoid spamming the log and taking away some CPU usage
