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

Raycast coordinates are incorrect #52

Closed CHFreezer closed 4 years ago

CHFreezer commented 5 years ago

Masked button can't be clicked.

I tried to modify https://github.com/mob-sakai/SoftMaskForUGUI/blob/bffaed3d78257edcb0f50562eae3fb6933e98010/Assets/Coffee/UIExtensions/SoftMaskForUGUI/Scripts/SoftMask.cs#L243 to: int y = (int)((softMaskBuffer.height - 1) * (1 - Mathf.Clamp01(sp.y / Screen.height))); after it worked for me. But I want to know why, thanks!

mob-sakai commented 5 years ago

Hi @CHFreezer Thank you for reporting!

mob-sakai commented 5 years ago

I think UNITY_UV_STARTS_AT_TOP is related.

vekstr commented 5 years ago

@CHFreezer 's fix also worked for me

Matata-lol commented 5 years ago

I think UNITY_UV_STARTS_AT_TOP is related.

Yes, it is. OpenGL works fine, but DX11 has this problem.

mob-sakai commented 4 years ago

I am sorry for not fixing this problem for a long time. I will fix it with SystemInfo.graphicsUVStartsAtTop API.

https://docs.unity3d.com/2017.4/Documentation/ScriptReference/SystemInfo-graphicsUVStartsAtTop.html