microsoft / MixedRealityToolkit-Unity

This repository is for the legacy Mixed Reality Toolkit (MRTK) v2. For the latest version of the MRTK please visit https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity
https://aka.ms/mrtkdocs
MIT License
6k stars 2.12k forks source link

Graphics Tools/Standard shader does not work with URP #11248

Closed alexandermeijersavanade closed 1 year ago

alexandermeijersavanade commented 1 year ago

This issue has been migrated a new MRTK repository, and the status of this issue will now be tracked at the following location:


Describe the bug

I have created a Unity project with the MRTKDevTemplate project. Everything works fine out of the box. All scenes look good and work perfectly.

Result

Several materials based on the Graphics Tools/Standard Canvas are causing materials to become purple. Example material would be Canvas Backplate Quad.

screenshot

image

According to the documentation (https://learn.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/mrtk3-graphicstools/features/standard-shader) these shaders do support the standard Unity URP

Your setup

Target platform

Zee2 commented 1 year ago

Hmmm, thanks for calling this out. They definitely should support URP, in fact most internal projects here are URP. Pinging @Cameron-Micka here :)

Cameron-Micka commented 1 year ago

Hi @alexandermeijersavanade, if you select the shader the magenta materials are using (sounds like it is the Graphics Tools/Standard Canvas shader) do you see any errors in the inspector?

If not, what happens if you right click on the shader and select reimport? I've occasionally seen Unity's shader caching system be overzealous when switching render pipelines.

alexandermeijersavanade commented 1 year ago

Hi @Cameron-Micka Thank you for your response. It is indeed the Graphics Tools/Standard Canvas shader. There are no errors in the inspector except the warning about the depth buffer. But that warning was already there before I even enabled URP. And the shader was working. I tried to reimport the shader. But that has no effect.

alexandermeijersavanade commented 1 year ago

the same issue is for the Magic Window Backplate_190x62 material what is using the Graphics Tools/Standard

alexandermeijersavanade commented 1 year ago

I noticed something else. If I change the shader to Graphic Tools/Canvas/Backplate it seems to work. See screenshot. Not sure if this is the right direction.

image

Cameron-Micka commented 1 year ago

Thanks for the extra info @alexandermeijersavanade!

Could you try closing Unity and deleting your Library folder? (That is where your project's shader cache lives.)

I'm not able to reproduce this locally (and we use URP for almost everything). Maybe I'm on a different version of the URP. What URP version are you using?

Also, shader errors are normally reported in this area of the shader file's inspector: image

alexandermeijersavanade commented 1 year ago

Hi @Cameron-Micka yes!!! that did the job. For some reason there were still artifacts in the library folder. it looks as it should be and completely running on URP :)

Cameron-Micka commented 1 year ago

That is excellent to hear, thanks for troubleshooting that @alexandermeijersavanade!

Zee2 commented 1 year ago

Closed! Thanks for the huge help @Cameron-Micka :))