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
2k stars 262 forks source link

Doesn't work with Screen-Space Overlay #41

Closed itsagam closed 5 years ago

itsagam commented 5 years ago

Doesn't work in "Screen Space - Overlay" (shows correctly in the Editor but does not work in-game).

Steps to reproduce the behavior:

  1. Play the included demo.
  2. Scroll to bottom and switch to "Overlay".
  3. Scroll up and notice.

    • Platform: Windows/Editor
    • Unity: 2018.3.8
    • SoftMaskForUGUI: v0.7.1

Capture Capture1

mob-sakai commented 5 years ago

Hi @itsagam Thsnk you for reporting!

Hmm, It does not work correctly on game view in editor, right?

itsagam commented 5 years ago

Indeed, I saw there were previous issues with Overlay but they were closed. Not sure what’s hapenning. Thank you for making your work available though.

mob-sakai commented 5 years ago

Okay, I'll fix it as soon as possible. Thank you again!

mob-sakai commented 5 years ago

Please try v0.7.2

itsagam commented 5 years ago

Okay, I tested it. It works in Screen-Space Overlay mode now, but the code changes introduced a regression where it doesn't work as intended in Screen-Space Camera and World Space. The masked image is offset by viewing position (see screenshots).

This is just to report. I bought an package from Asset Store that got the job done. Thanks!

Capture1 Capture

mob-sakai commented 5 years ago

Thank you for testing. :) For the time being, we have discontinued the v0.7.2 release. I will continue to fix.

mob-sakai commented 5 years ago

Hi @itsagam Can you test this? fixed.unitypackage.zip

If there is no bug, I will release v0.7.2. :)

itsagam commented 5 years ago

Sure, sure. Okay, so, the asset works now in all three modes (Screen-Space Overlay, Screen-Space Camera, World Space), but while testing it thoroughly, I encountered two more bugs:

1) If you maximize Game View (either with "Game -> Right-click -> Maximize" or "Maximize on Play"), the masked images all disappear. image

2) Intermittently, get "Attempting to ReadPixels outside of RenderTexture bounds! Reading .... from ...." errors. image

I had the package from v0.7.1, so I installed it again to see whether these were a regression, but they happen there as well and seem to be unrelated to the changes you made. I wish I could help you diagnose any of it, but shader programming is not my forte. Do let me know, however, if you ever need some help with editor scripting side of things.

Best.

itsagam commented 5 years ago

Reading the exception now, maybe it is an off-by-one error? Trying to read pixel 289 from size 288? Just a thought, I'm a noob with shaders.

mob-sakai commented 5 years ago

Many thanks! And, 3. the masked image disappears when the game view is resized.

Actually, the bugs are independent. I created new issues for the bugs and fixed them!

42, #43, #44

mob-sakai commented 5 years ago

Please try this fixed_2.unitypackage.zip

itsagam commented 5 years ago

Works good.

mob-sakai commented 5 years ago

Thank you for your cooperation! :+1: I'll release it.