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

[Editor] Visual bug with ScreenSpaceCamera canvas and rotating the camera around #78

Closed maskedmouse closed 4 years ago

maskedmouse commented 4 years ago

Describe the bug In Editor when rotating the camera the softmask is kind of following around. as if it is not updated every frame but is behind a few frames.

To Reproduce Steps to reproduce the behavior:

  1. Create a canvas with ScreenSpaceCamera
  2. Create a GameObject with a circle image and a SoftMask
  3. Create a child with an image, set color to red and add SoftMaskable
  4. Go into playmode
  5. Rotate the camera
  6. Observe the red color folowing around instead of being steady

Environment (please complete the following information):

Additional context Unity-2019 3 11f1-SoftMask-Bug

I used an online mp4 to gif so the quality is bad but you can still see the effect I'm having in the editor. I've got a script attached to the camera so that whenever I'm dragging around it will rotate. The camera itself stays on position 0,0,0. It just rotates around. Not a 100% sure if this also happens in a build but it seems to be more steady in a webgl build. It's not super noticeable as in the Editor.

mob-sakai commented 4 years ago

@maskedmouse Thank you for the report! Could you please attach a minimal project that reproduces this issue?

maskedmouse commented 4 years ago

Here's a zip containing a minimal project. https://maskedmous.stackstorage.com/s/rutdEowxbi3gWi5

Go into play mode and use left mouse button to rotate the camera around

mob-sakai commented 4 years ago

Thank you, it is reproduced. Honestly, I don't know how to solve it... X(

It seems to be stable when you operate the camera with inspector view.

maskedmouse commented 4 years ago

Well in a build it doesn't really seem to happen. So it is not a critical issue. But it does make me wonder, if the code under #if UNITY_EDITOR is causing the problem. I haven't gone through the script thoroughly to understand its behaviour. But since it runs well outside of the editor then there's a likely chance that there is a problem in the editor only code.

mob-sakai commented 4 years ago

@maskedmouse You're right. Perhaps there is a problem with the code for the editor.

mob-sakai commented 4 years ago

WIP: I've solved it.

github-actions[bot] commented 4 years ago

:tada: This issue has been resolved in version 0.10.0-preview.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: