Unity 2021.2.3f1
Shader Graph 12.1.1
This is a simple Shader Graph shader.
Screenshot1. Universal - Material - Sprite Unlit: Alpha is wrong.
Screenshot2. Universal - Material - Unlit: Something weird texture.
Unity 2021.2.3f1
Shader Graph 12.1.1
This is a simple Shader Graph shader.
Screenshot1. Universal - Material - Sprite Unlit: Alpha is wrong.
Screenshot2. Universal - Material - Unlit: Something weird texture.
I donât think Sprite Unlit shader is supposed to work in UI, plus I think _MainTex should not be exposed if you want to use image set in Image component.
Meanwhile I just tested how it works in my project and Unlit shader graph does not work at all in game view - there is just black square and ironically Sprite Unlit displays something, but itâs broken:
I just updated my project from 2020 LTS to 2021.2 and have the same problem.
All my UI elements which use a shader graph material now have a black background where they should be transparent. It works fine when setting the canvas screen space to âCameraâ (so thatâs something you could do for now, @Seromu ) but I need my canvas to be âOverlayâ.
Really hope this gets fixed otherwise Iâll need to roll back to 2020 LTS.
Edit: Iâve submitted a bug report, Iâll come back with the link once itâs up on the Issue Tracker.
@ali_mohebali Do you mind looking into this? Iâve submitted a bug report but havenât heard anything back.
For anyone wanting to use an Overlay canvas and having the same issue, a workaround is to create a new layer and assign your UI to said layer. Then create a new âRender Objectsâ Renderer Feature and set its Event to âAfter Renderingâ. Youâll need to set the Queue to âTransparentâ and Layer Mask to your newly created layer.
The canvas Render Mode will also have to be set to âScreen Space - Cameraâ but it will still be treated as an Overlay canvas.
[SHADER GRAPH] SHADERS FROM SHADER GRAPH DONâT WORK ON UI WITH CANVAS âRENDER MODEâ SET TO âOVERLAYâ
âBY DESIGNââŚ?
I finally got an email saying they were able to reproduce the bug and itâs now up on the issue tracker. You can vote for it here: Unity Issue Tracker - [ShaderGraph] Alpha is shown as black when using a custom Shader Graph material on an Image component
It might be that theyâll end up saying itâs âby designâ again but you never know. Even so, voting for this could raise more attention and maybe theyâll push this issue up on their priority list.
Seems so weird that we even need a vote-based issue tracker. This is quite clearly a fundamental need.
This issue has been known since before November 2021. Itâs February 2022. Four months. And thatâs just since this forum post.
So bored of basic features being ignored. Beyond frustrated.
I think that transparency will start working with a Sprite Unlit shader if you set the Canvas component to Render Mode Screen Space - Camera and assign the MainCamera as the Render Camrera.
I hope it helps!
I appreciate the attempt to help, but, Screen Space - Overlay exists for a (very good) reason.
Whilst itâs great that Camera works, for as long as Overlay doesnât work this feature is not finished, and the absolute lack of communication (or progress) from the ShaderGraph team is not up to par.
We just upgraded from 2021.1.20f1 to 2021.2.12f1 and experienced this very issue. All UI images that use custom ShaderGraph materials, to for instance animate a shine-effect onto the image, now render black where they should be rendering transparent. Within the scene view everything looks fine, but in the Game view the issue appears.
This seems like a very annoying bug, which now seems to exist for months without any updates. The devised workaround to set the Canvas mode to âScreen Space - Cameraâ and put all UI elements on a layer that is referenced within a URP RenderFeature set to AfterRenderingPostProcessing DOES work for us. Although this pretty much defeats the purpose of Overlay Canvases altogether and intoduces additional overhead due to the extra RenderFeature needed.
Please donât forget to vote the issue up, so that it might get fixed soon!
I added a comment to the issue and cross-referenced this thread, in hopes anyone reviewing it might get an immediate sense for the scale of the problem, given the screenshots that appeared within this thread.
No replies from a Unity dev in the ShaderGraph forum since July, itâs not looking good friends
Update: The issue has been set by Unity to âBy Designâ, giving the following reason:
âŚhopefully this âcoincidenceâ comes back a few package versions down the road.
But hey, at least there is yet another page to vote for the issue, so I guess in the meantime letâs do that
Welp, thatâs disappointing.
I guess all we can do now is mark it as âCriticalâ on the product board then. Or use Amplify Shader Editor, they seem to support UI.
Hi - had a similar issue with shadergraph material not working on a UI image.
What eventually worked for me is:
The âTexCoord1â Channel by itself is critical and please check it doesnât change on runtime.
On my other canvas TextMeshPro triggers the tangent and normal channels which made the material not appear. Please note that those are automatically triggered by TextMeshPro even if unselected before pressing Play.
@uzisho your solution did not work for me. Really disappointed in Unity with this. I canât believe itâs been known about for months and the problem still exists on an LTS versionâŚ
Unfortunately, the only solution is setting the canvas screen space to âCameraâ.
This is horrendous. How is this not just a basic feature of Shader Graph? Does Unity think that no one would want to use a shader on a UI object? That seems extremely obvious to me.
Alright, this is my workaround.
Create a new Camera and set the Render Type to Overlay and Projection to Orthographic
Set the Culling Mask to UI
Go to the base Camera and find the âStackâ option, and add the new Camera to the Stack.
Put the UI elements with all the Shaders onto a Canvas set to Screen Space - Camera, and set the Camera to the Overlay camera
For me itâs working identically to Render Mode. Iâm not smart enough to know the differences between this and the Canvas Overlay mode. This is a bit ridiculous though
remove source image only use material,
you are displaying 2 image, one source image second one base_Texture with shader this is whatâs wrong.