mob-sakai / SoftMaskForUGUI

Enhance Unity UI (uGUI) with advanced soft-masking features to create more visually appealing effects!
https://github.com/mob-sakai/SoftMaskForUGUI
MIT License
1.97k stars 261 forks source link

[v1] Big performance hit (CPU + GC Alloc) coming from SoftMaskable.UpdateMaterialForSceneView #115

Closed oxysoft closed 1 month ago

oxysoft commented 3 years ago

image

This is for ~300 SoftMaskables. All of the allocation comes from accessing mat.shader.name, and then there's the "Set view and projection matrices" part as well which takes a decent amount of time. I am aware that function runs only in editor, but this performance hit is still pretty harsh for productivity.

Perhaps you could restrict this function to running only when the SceneView is visible in the editor? Currently, it will run whether the SceneView is visible or not.

mob-sakai commented 3 years ago

@oxysoft Thank you for your reporting!

oxysoft commented 3 years ago

Any update on this?

mob-sakai commented 1 month ago

Please try v2: https://github.com/mob-sakai/SoftMaskForUGUI/releases/tag/v2.0.0