core icon indicating copy to clipboard operation
core copied to clipboard

Performance issues with background-image property

Open KurtGokhan opened this issue 2 years ago • 1 comments

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

KurtGokhan avatar Sep 15 '22 13:09 KurtGokhan

Looks like all of these issues will be solved once I implement mesh-based background/border/shadow instead of shader-based.

KurtGokhan avatar Oct 12 '22 10:10 KurtGokhan

This is being worked on the branch https://github.com/ReactUnity/core/tree/mesh-based-bg-shapes

KurtGokhan avatar Oct 19 '22 19:10 KurtGokhan

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.

KurtGokhan avatar Jan 16 '23 08:01 KurtGokhan