Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projection Matrix check always true when using world space canvas #67

Closed
AndreasMLarsen opened this issue Jan 7, 2020 · 3 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@AndreasMLarsen
Copy link

When using a World Space camera that is not moving, nowVP and previousVP is never the same causing sm.hasChanged to be set to true. This in turn causes the mask to be drawn every frame.

Steps to reproduce the behavior:

  1. Add a orthographic world space camera and set the culling mask to UI
  2. Add a World Space Canvas and set the layer to UI
  3. Add a Image with the SoftMask script and a child image with the SoftMaskable script
  • Platform: Tested on windows editor and IOS
  • Unity: 2019.2.6f1
  • SoftMaskForUGUI: v0.9.0

I've added a project with a lite version of the setup we are currently running.
SoftMaskTest.zip
SoftMask

@mob-sakai mob-sakai self-assigned this Jan 7, 2020
@mob-sakai mob-sakai added the bug Something isn't working label Jan 7, 2020
@mob-sakai
Copy link
Owner

Hi @AndreasMLarsen ,

Thank you for your reporting!

@mob-sakai mob-sakai added this to the v0.9.1 milestone Jan 28, 2020
@AndreasMLarsen
Copy link
Author

AndreasMLarsen commented Jan 28, 2020

Hi @mob-sakai,
I've look through the changes and it doesn't seem to be fixed, however changing line 484-491 from:

#if !UNITY_2018_1_OR_NEWER
s_previousViewProjectionMatrices.Clear ();
foreach (int id in s_previousViewProjectionMatrices.Keys)
{
	s_previousViewProjectionMatrices [id] = s_nowViewProjectionMatrices [id];
}
s_nowViewProjectionMatrices.Clear ();
#endif

to:

s_previousViewProjectionMatrices.Clear ();
foreach (int id in s_nowViewProjectionMatrices.Keys)
{
	s_previousViewProjectionMatrices [id] = s_nowViewProjectionMatrices [id];
}
s_nowViewProjectionMatrices.Clear ();

Seems to work

@mob-sakai
Copy link
Owner

@AndreasMLarsen

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants