We have found the cause of the clipping rendering failure in Unity 2021, 2022 (Alpha).
This is a problem that occurred as the Shader Graph was updated, and the Shader Graphs for URP provided previously did not work as we thought.
We completely misunderstood this problem, and it took a long time. Sorry.
Modifying the Shader Graph in the way below will solve the rendering problem.
The file causing the problem is included in the URP Presets.
(1) Select "apShaderGraph_URP_Common_AlphaMask" in the "Assets > AnyPortrait > Assets > Shaders > Advanced > URP Common" folder.
(2) If you open this file in the Shader Graph editor and check it, you can see that it is set to "Unlit / Transparent".
In earlier versions of Unity, this setting worked fine.
However, starting from Unity 2021, clipping is not possible because the normal "Unlit" Shader behaves differently.
We don't even know why.
Anyway, now that we know this is the problem, let's change the settings in the Shader Graph.
Change the value of "Material" in the Shader Graph from "Unlit" to "Sprite Unlit".
And the value of "Blending Mode" should be "Alpha".
Click the "Save Asset" button in the Shader Graph editor to save it. (It is not saved automatically.)
Run the game, and you can see that the Clipping Mask works well.
This solution works for both Unity 2021 and 2022.
We don't know if this change is an official Unity specification or not, but we will fix the "URP Preset" in a future update version for compatibility reasons.
If the problem is not resolved, please leave a comment.
Okay, it doesn't matter. This will not have much effect on my use of AnyPortrait. Just let you know so that future versions can be fixed as soon as possible.😀
Sorry. we read the Unity version as 2020 instead of 2022 in the content of your post.
So, we installed and tested 2022.1.a and found that the issue appeared.
We don't know yet if this issue is due to Unity 2022 still in the alpha version with a lot of bugs, or if there is a specification change for the Render Pipeline in Unity 2022.
Some of our code for the Scriptable Render Pipeline doesn't seem to be working, but we haven't been able to find the exact cause.
(AnyPortrait script to submit the render request works well, but in Unity's Render Pipeline, the request is not working...)
We recommend using an older stable version of Unity.
Of course, we will continue to respond to the latest version, but it is difficult to support the version that is still in the Alpha stage.
Currently, there is very little information on the Unity forums, so it will take a long time for us to fix this issue.
If we ever find the cause of this issue, or if this issue is fixed in Unity 2022 (if it was a Unity bug), we'll add a comment here again.
Sorry for not being of any help at the moment.
We will continue to monitor this issue closely and try to help.
@RainyRizzle I would like to let you know that 2021.1.15 is working regarding the clipping mask. That was my bad, I totally forgot that I had to run game for the clipping mask to work. Figured that out after switching to 2020 LTS. I was looking through some documentation you have here about materials and rendering and noticed the bumpmaps. But they aren't in the URP where I would assume they would be since that is the draw for using URP, for the lighting and bump maps.Would you know how to use the URP pipeline like the bump maps in the other material presets? What needs to change in the URP material preset or what needs to be added?
@RainyRizzle I appreciate your speed and dedication here. I hope that this manual will help many people going forward. I haven't had the opportunity to follow this, but I certainly will in the next few days. Thanks very much and keep it up!
I use Scriptable Render Pipeline,but i can't resolve this problem. It's ok in unity2020 urp.But when i grade to unity2022,error occurred.When I packaged my game, unity prompted a shader warning for this plugin, but in the 2020 version, it won’t.
Hi!
This issue has been fixed in the updated AnyPortrait v1.3.5.
This issue can be resolved through the newly added "URP (2021)" preset in "Material Library".
https://rainyrizzle.github.io/en/AdvancedManual/AD_URP.html
Thank you!
Hi!
We have found the cause of the clipping rendering failure in Unity 2021, 2022 (Alpha).
This is a problem that occurred as the Shader Graph was updated, and the Shader Graphs for URP provided previously did not work as we thought.
We completely misunderstood this problem, and it took a long time. Sorry.
Modifying the Shader Graph in the way below will solve the rendering problem.
The file causing the problem is included in the URP Presets.
(1) Select "apShaderGraph_URP_Common_AlphaMask" in the "Assets > AnyPortrait > Assets > Shaders > Advanced > URP Common" folder.
(2) If you open this file in the Shader Graph editor and check it, you can see that it is set to "Unlit / Transparent".
In earlier versions of Unity, this setting worked fine.
However, starting from Unity 2021, clipping is not possible because the normal "Unlit" Shader behaves differently.
We don't even know why.
Anyway, now that we know this is the problem, let's change the settings in the Shader Graph.
Change the value of "Material" in the Shader Graph from "Unlit" to "Sprite Unlit".
And the value of "Blending Mode" should be "Alpha".
Click the "Save Asset" button in the Shader Graph editor to save it. (It is not saved automatically.)
Run the game, and you can see that the Clipping Mask works well.
This solution works for both Unity 2021 and 2022.
We don't know if this change is an official Unity specification or not, but we will fix the "URP Preset" in a future update version for compatibility reasons.
If the problem is not resolved, please leave a comment.
Thank you.
Okay, it doesn't matter. This will not have much effect on my use of AnyPortrait. Just let you know so that future versions can be fixed as soon as possible.😀
Hi!
Sorry. we read the Unity version as 2020 instead of 2022 in the content of your post.
So, we installed and tested 2022.1.a and found that the issue appeared.
We don't know yet if this issue is due to Unity 2022 still in the alpha version with a lot of bugs, or if there is a specification change for the Render Pipeline in Unity 2022.
Some of our code for the Scriptable Render Pipeline doesn't seem to be working, but we haven't been able to find the exact cause.
(AnyPortrait script to submit the render request works well, but in Unity's Render Pipeline, the request is not working...)
We recommend using an older stable version of Unity.
Of course, we will continue to respond to the latest version, but it is difficult to support the version that is still in the Alpha stage.
Currently, there is very little information on the Unity forums, so it will take a long time for us to fix this issue.
If we ever find the cause of this issue, or if this issue is fixed in Unity 2022 (if it was a Unity bug), we'll add a comment here again.
Sorry for not being of any help at the moment.
We will continue to monitor this issue closely and try to help.
Thank you.
I use Scriptable Render Pipeline,but i can't resolve this problem. It's ok in unity2020 urp.But when i grade to unity2022,error occurred.When I packaged my game, unity prompted a shader warning for this plugin, but in the 2020 version, it won’t.
Hi!
If you're using a Scriptable Render Pipeline like URP, the "clipping mesh" behaves differently due to the camera's rendering process changing.
So you need to change the Bake option.
Set the value of the "Render Pipeline" option in the "Bake settings" to "Scriptable Render Pipeline".
And running "Bake" again should solve the problem.
Please refer to the page below for Bake settings.
https://rainyrizzle.github.io/en/AdvancedManual/AD_BakeDialog.html
In addition, information about clipping meshes in the Scriptable Render Pipeline exists in the manual for LWRP, the prototype of URP.
(Now that I see, the URP document did not contain this content. Sorry for the confusion.)
https://rainyrizzle.github.io/en/AdvancedManual/AD_LWRP.html
If the problem is not resolved, please leave a comment.
Thank you.