core
core copied to clipboard
Performance issues with background-image property
Currently the background-image
property has some performance issues that drop fps significantly when used abundantly.
There are two main reasons:
-
NotifyStencilStateChanged
is called needlessly. Discord link - Background image draw calls are not batched because of non-sharing materials. Discord link
Additionally, performance can be improved for box-shadow with this technique
Looks like all of these issues will be solved once I implement mesh-based background/border/shadow instead of shader-based.
This is being worked on the branch https://github.com/ReactUnity/core/tree/mesh-based-bg-shapes
Implemented all border
, border-image
, background
and similar features using meshes now, instead of shaders. This will improve performance a lot, as well as allow anti-aliasing.