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

When building with Vulkan and Landscape Orientation, SoftMask does not work on the device. #171

Closed
Yunday-dev opened this issue Jul 19, 2024 · 8 comments
Assignees
Labels
bug Something isn't working released

Comments

@Yunday-dev
Copy link

Yunday-dev commented Jul 19, 2024

NOTE: Your issue may already be reported! Please search on the issue tracker before creating one.

Describe the bug
When building with Vulkan and OpenGLES3 in that order as Graphics APIs and Landscape orientation, SoftMask does not work.
However, It works correctly in the Editor and on the device in Portrait orientation.

[It works correctly on the Editor]
image

[It works correctly in Device with Portrait orientation]
Protrait

[It does not works in Device with Landscape orientation]
Landscape

However, SoftMask works correctly when building with OpenGLES3 and Vulkan in that order.
ProtraitCorrectly

To Reproduce
I build with Vulkan and OpenGLES3 in that order, as shown in the image below.
image

And I set the Orientation to Landscape.
image

I build.

Expected behavior
SoftMask should work correctly on the device even when building with Vulkan and setting the Orientation to Landscape.

Screenshots
It works correctly in Portrait orientation but does not work correctly in Landscape orientation.
trainsition_portrait_to_landscape

Environment (please complete the following information):

  • Version: 2.0.0
  • Platform: Editor(Windows), Android
  • Unity version: 2022.3.21f1
  • Build options: Vulkan, IL2CPP, .Net Standard 2.1, URP
@Yunday-dev Yunday-dev added the bug Something isn't working label Jul 19, 2024
@mob-sakai
Copy link
Owner

Thank you for your reporting!

@mob-sakai
Copy link
Owner

I would like to know more about this issue.
Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?

repos

@mob-sakai mob-sakai added the need more info Need more information to help label Jul 19, 2024
@mob-sakai
Copy link
Owner

mob-sakai commented Jul 19, 2024

The issue is reproduced when building with the following settings:

  • Unity 2022.3.18f1, Android
  • For Graphics APIs, prioritize Valkan
  • Enable Valkan Settings > Apply display rotation during rendering

@Yunday-dev
If Valkan Settings > Apply display rotation during rendering is disabled, does it fix the problem?

@mob-sakai mob-sakai removed the need more info Need more information to help label Jul 19, 2024
@mob-sakai
Copy link
Owner

I have found the page I need.
https://docs.unity3d.com/Manual/vulkan-swapchain-pre-rotation.html

@Yunday-dev
Copy link
Author

The issue is reproduced when building with the following settings:

  • Unity 2022.3.18f1, Android
  • For Graphics APIs, prioritize Valkan
  • Enable Valkan Settings > Apply display rotation during rendering

@Yunday-dev If Valkan Settings > Apply display rotation during rendering is disabled, does it fix the problem?

Disabling 'Vulkan Settings > Apply display rotation during rendering' prevents the issue.

@Yunday-dev
Copy link
Author

I have found the page I need. https://docs.unity3d.com/Manual/vulkan-swapchain-pre-rotation.html

It works! Thank you very much.

github-actions bot pushed a commit that referenced this issue Jul 23, 2024
# [2.1.0](v2.0.0...v2.1.0) (2024-07-23)

### Bug Fixes

* fix null exception ([15d6917](15d6917))
* fix upgrading asset system (v1 to v2) ([e6d0c60](e6d0c60))
* support 'Apply display rotation during rendering' for Vulkan (experimental) ([f5c9b41](f5c9b41)), closes [#171](#171)

### Features

* add 'Hide Generated Components' option in project settings ([053e92b](053e92b))
* add a help box to the auto-generated object inspector ([f2d2115](f2d2115)), closes [#175](#175)
* revive `SoftMask.alpha` ([8080cb2](8080cb2)), closes [#172](#172)
* softmask buffers are now baked considering `Graphic.color.a` ([2eaaad6](2eaaad6))
Copy link

🎉 This issue has been resolved in version 2.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Jul 23, 2024
github-actions bot pushed a commit that referenced this issue Jul 23, 2024
# [2.1.0](v2.0.0...v2.1.0) (2024-07-23)

### Bug Fixes

* fix null exception ([15d6917](15d6917))
* fix upgrading asset system (v1 to v2) ([e6d0c60](e6d0c60))
* support 'Apply display rotation during rendering' for Vulkan (experimental) ([f5c9b41](f5c9b41)), closes [#171](#171)

### Features

* add 'Hide Generated Components' option in project settings ([053e92b](053e92b))
* add a help box to the auto-generated object inspector ([f2d2115](f2d2115)), closes [#175](#175)
* revive `SoftMask.alpha` ([8080cb2](8080cb2)), closes [#172](#172)
* softmask buffers are now baked considering `Graphic.color.a` ([2eaaad6](2eaaad6))
github-actions bot pushed a commit that referenced this issue Sep 5, 2024
# [3.0.0](v2.3.0...v3.0.0) (2024-09-05)

### Bug Fixes

* `MaskingShape.maskingMethod = Subtract` is not working correctly ([cc77830](cc77830))
* `Stereo Enabled` option in preferences does not work ([388a73f](388a73f))
* fix a major performance regression where if you had a lot of softmaskable components (even if the parent canvas was in-active) it would eat over 20ms doing a certain editor-only function ([2d793c4](2d793c4))
* fix broken anchor on README.md ([1e53068](1e53068))
* fix null exception ([23b0b2c](23b0b2c))
* fix soft-maskable shaders for TextMeshPro v2.0/v2.1/v2.2/v3.0 ([83eacec](83eacec))
* fix upgrading asset system (v1 to v2) ([3cdcc86](3cdcc86))
* flashing when SoftnessRange is changed in inspector ([12f81cf](12f81cf))
* if no `Canvas` in the parents of the `SoftMask`, error occurred ([710d2cf](710d2cf)), closes [#182](#182)
* in linear color mode, `TextMeshProUGUI` appeared darker ([780beb1](780beb1)), closes [#187](#187)
* nested `MaskingShape` is not working correctly ([560f6a3](560f6a3)), closes [#189](#189)
* placing a SoftMaskable object outside of a SoftMask makes the object invisible ([096aa69](096aa69)), closes [#180](#180)
* ShaderGraph support is not included ([7df8b2b](7df8b2b))
* shaders for SoftMask are not automatically included ([0c22da7](0c22da7)), closes [#177](#177) [#178](#178)
* soft mask buffer is fliped on UNITY_UV_STARTS_AT_TOP devices ([b44edc3](b44edc3)), closes [#179](#179)
* soft mask is upside down on some devices ([e16a161](e16a161)), closes [#185](#185)
* soft mask is upside down on some devices (refactor) ([c9db361](c9db361))
* soft masked image flickers or disappears when resizing canvas in editor ([767bb5b](767bb5b)), closes [#184](#184)
* softmask-buffer is cleared when TMPSubMeshUI is activated via EditorGUI ([5d86379](5d86379)), closes [#180](#180)
* stencil masking does not working correctly when `SoftMask` component is placed under `Mask` component ([b66fe86](b66fe86)), closes [#183](#183)
* support 'Apply display rotation during rendering' for Vulkan (experimental) ([fe586dc](fe586dc)), closes [#171](#171)
* when `UseStencilOutsideScreen = true`, objects inside `SoftMask` are not batched in the editor ([8b93959](8b93959)), closes [#188](#188)
* when changing resolution, display, or screen orientation, soft-masking do not work properly ([dee7271](dee7271))

### Features

* 'SoftMask.partOfParent' is now obsolete. Please use 'MaskingShape' component instead. ([380cd32](380cd32))
* (editor) use stencil outside screen in scene view for development ([611d92f](611d92f))
* add 'AntiAliasing' masking mode. This mode suppresses stencil-derived mask aliasing without using RenderTexture. ([fe532c6](fe532c6))
* add 'Hide Generated Components' option in project settings ([0fc9aeb](0fc9aeb))
* add 'SoftMask.softMaskingRange' option ([1acb954](1acb954))
* add a help box to the auto-generated object inspector ([5560355](5560355)), closes [#175](#175)
* add asset modify system to migrate from v1 to v2 ([d0e9194](d0e9194))
* add explicit dependencies ([403e834](403e834))
* add project settings for SoftMask ([50e9e0e](50e9e0e))
* add soft-maskable shaders for TextMeshPro v3.2/v4.0 ([679acc4](679acc4))
* add stereo mode to shader ([48b2be1](48b2be1))
* exclude unused shader variants from the build (option) ([0630a3c](0630a3c))
* revive `SoftMask.alpha` ([b062edf](b062edf)), closes [#172](#172)
* ShaderGraph support ([f21f2ff](f21f2ff)), closes [#190](#190)
* softmask buffers are now baked considering `Graphic.color.a` ([484adaa](484adaa))
* support for shaders with `(SoftMaskable)` in the name except at the end ([cd25357](cd25357))
* support uGUI 2.0.0 ([c480cef](c480cef))

### BREAKING CHANGES

* The implementation way of the 'SoftMaskable' shader has been changed. Please refer to the "Migrating from v1 to v2" section in the Readme for details.
Copy link

github-actions bot commented Sep 5, 2024

🎉 This issue has been resolved in version 3.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Sep 5, 2024
# [3.0.0](v2.3.0...v3.0.0) (2024-09-05)

### Bug Fixes

* `MaskingShape.maskingMethod = Subtract` is not working correctly ([cc77830](cc77830))
* `Stereo Enabled` option in preferences does not work ([388a73f](388a73f))
* fix a major performance regression where if you had a lot of softmaskable components (even if the parent canvas was in-active) it would eat over 20ms doing a certain editor-only function ([2d793c4](2d793c4))
* fix broken anchor on README.md ([1e53068](1e53068))
* fix null exception ([23b0b2c](23b0b2c))
* fix soft-maskable shaders for TextMeshPro v2.0/v2.1/v2.2/v3.0 ([83eacec](83eacec))
* fix upgrading asset system (v1 to v2) ([3cdcc86](3cdcc86))
* flashing when SoftnessRange is changed in inspector ([12f81cf](12f81cf))
* if no `Canvas` in the parents of the `SoftMask`, error occurred ([710d2cf](710d2cf)), closes [#182](#182)
* in linear color mode, `TextMeshProUGUI` appeared darker ([780beb1](780beb1)), closes [#187](#187)
* nested `MaskingShape` is not working correctly ([560f6a3](560f6a3)), closes [#189](#189)
* placing a SoftMaskable object outside of a SoftMask makes the object invisible ([096aa69](096aa69)), closes [#180](#180)
* ShaderGraph support is not included ([7df8b2b](7df8b2b))
* shaders for SoftMask are not automatically included ([0c22da7](0c22da7)), closes [#177](#177) [#178](#178)
* soft mask buffer is fliped on UNITY_UV_STARTS_AT_TOP devices ([b44edc3](b44edc3)), closes [#179](#179)
* soft mask is upside down on some devices ([e16a161](e16a161)), closes [#185](#185)
* soft mask is upside down on some devices (refactor) ([c9db361](c9db361))
* soft masked image flickers or disappears when resizing canvas in editor ([767bb5b](767bb5b)), closes [#184](#184)
* softmask-buffer is cleared when TMPSubMeshUI is activated via EditorGUI ([5d86379](5d86379)), closes [#180](#180)
* stencil masking does not working correctly when `SoftMask` component is placed under `Mask` component ([b66fe86](b66fe86)), closes [#183](#183)
* support 'Apply display rotation during rendering' for Vulkan (experimental) ([fe586dc](fe586dc)), closes [#171](#171)
* when `UseStencilOutsideScreen = true`, objects inside `SoftMask` are not batched in the editor ([8b93959](8b93959)), closes [#188](#188)
* when changing resolution, display, or screen orientation, soft-masking do not work properly ([dee7271](dee7271))

### Features

* 'SoftMask.partOfParent' is now obsolete. Please use 'MaskingShape' component instead. ([380cd32](380cd32))
* (editor) use stencil outside screen in scene view for development ([611d92f](611d92f))
* add 'AntiAliasing' masking mode. This mode suppresses stencil-derived mask aliasing without using RenderTexture. ([fe532c6](fe532c6))
* add 'Hide Generated Components' option in project settings ([0fc9aeb](0fc9aeb))
* add 'SoftMask.softMaskingRange' option ([1acb954](1acb954))
* add a help box to the auto-generated object inspector ([5560355](5560355)), closes [#175](#175)
* add asset modify system to migrate from v1 to v2 ([d0e9194](d0e9194))
* add explicit dependencies ([403e834](403e834))
* add project settings for SoftMask ([50e9e0e](50e9e0e))
* add soft-maskable shaders for TextMeshPro v3.2/v4.0 ([679acc4](679acc4))
* add stereo mode to shader ([48b2be1](48b2be1))
* exclude unused shader variants from the build (option) ([0630a3c](0630a3c))
* revive `SoftMask.alpha` ([b062edf](b062edf)), closes [#172](#172)
* ShaderGraph support ([f21f2ff](f21f2ff)), closes [#190](#190)
* softmask buffers are now baked considering `Graphic.color.a` ([484adaa](484adaa))
* support for shaders with `(SoftMaskable)` in the name except at the end ([cd25357](cd25357))
* support uGUI 2.0.0 ([c480cef](c480cef))

### BREAKING CHANGES

* The implementation way of the 'SoftMaskable' shader has been changed. Please refer to the "Migrating from v1 to v2" section in the Readme for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

2 participants