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.91k stars 257 forks source link

[v1] Soft Mask breaks with render scale different than 1 on Android & iOS devices #168

Closed ofaura closed 15 hours ago

ofaura commented 3 weeks ago

Describe the bug The soft mask doesn't work on Android & iOS devices if the Render Scale of the URP Asset is different than one, and the canvas is set with Render Mode: screen Space - Camera. On the unity Editor everything looks fine, but on device build everything inside the soft mask is not visible.

To Reproduce Steps to reproduce the behavior: 1.- Set the Render Scale of the URP Asset to a value smaller than 1 (ex. 0.8) 2.- Add a Camera (main Camera) with Projection type set to Perspective, unselect the UI layer from Culling Mask 3.- Add a new Camera (UI Camera), and add it as a Stack of the Main Camera 4.- Create a UI canvas with Render Mode: Screen Space - Camera. Set the canvas layer to UI 5.- Have an Image with a circle as Sprite and add the Soft mask component, set the layer to UI 6.- Add any other image as a child and add the Soft Maskable Component , set the layer to UI 7.- Create the build and test it on Android or iOS device

Expected behavior Soft Mask works fine regardless of the Render Scale

Environment (please complete the following information):

mob-sakai commented 15 hours ago

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