Supersampled UI auto-swap gives every UI Graphic that is inactive at world load its own material (breaks UI batching)
Zevya
Another form of https://feedback.vrchat.com/udon/p/toggling-vertex-color-always-in-gamma-color-space-causes-inconsistent-ui-brightn
The lost
_Tint
in that report is the same runtime swap. Here it also costs a draw call per UI element.- At world load, every non-TMP Graphic(Image, RawImage) whose GameObject is inactive in the uploaded scene has itsmaterialreplaced with a new material namedVRChat/Mobile/Worlds/Supersampled UI. That's one new material per Graphic.
- It happens even when the Graphic already uses VRCSuperSampledUIMaterial.
- Graphics that are active at load keep the shared material. Toggling objects off and on later never triggers it.
- The swap happens at load: the material is already replaced while the object is still inactive.
- Udon isn't involved. A script-free copy of the UI reproduces it.
Every affected element has a unique material, so the canvas can't batch it. One of our menu pages draws 92 batches instead of 12. Any world that keeps pages, menus or row templates disabled until needed pays this on every hidden element. In our world that's about 2,100 UI graphics.
- Make a world-space canvas with a few Images using VRCSuperSampledUIMaterial, then duplicate it.
- Set the duplicate's root inactive, then Build & Test.
- In the client, enable the inactive copy.
- Log material.nameandmaterial.GetInstanceID()for each Image (from Udon). The always-active copy shares the asset material. The late copy has a separate runtime material per Image, all namedVRChat/Mobile/Worlds/Supersampled UI.
Expected:
The auto-swap only touches
UI/Default
(as the 2023.4.2 notes describe). Where it does swap, Graphics share one material instead of getting one each.Workaround:
Reassigning the original material from Udon after load (
graphic.material = sharedMaterial
) restores batching, and it sticks through later toggles.Log In