Skip to content

Custom RectMask2D, that allow to disable Culling / Softness for better performance

License

Notifications You must be signed in to change notification settings

mitay-walle/Unity3d-RectMask2DCulling

Repository files navigation

RectMask2DCulling

Unity3d | uGUI custom RectMask2D script, that allow to disable Culling / Softness for better performance

Problem

Built-in RectMask2D has overhead, that grow linearly with count of active Child UI.Graphic, main reason for this - Culling. When all this UI.Graphic is always visible (Pooled ScrollRectList or Optimized ScrollView Adapter used, for example) - Culling is useless

And you can't disable it

Solution

Inherite from RectMask2D and add flags to disable Culling

Performance

  • Profiled at Honor 10X Lite

  • 50 child TextMeshPro

  • 400 child other various UI.Graphic (UI.Image, UI.RawImage, UI.Text)

  • RectMask2D

  • RectMask2DCulling , Culling and Softness disabled

  • RectMask2DCulling use reflection to get private properties of parent RectMask2D class, and it add performance overhead

About

Custom RectMask2D, that allow to disable Culling / Softness for better performance

Topics

Resources

License

Stars

Watchers

Forks

Languages