invisible materials in build

ive started to have this problems all of the sudden, in the editor it all looks fine, but when i make whe windows build and try it, 99% of the materials are invisible, you can only see the ui and 2d elements, using URP.
pls somebody help

What version of Unity are you using?

Are you using one of the built-in URP shaders, or are you using something custom?

unity 2021.3.16f1, do you mean these? 8728701--1180950--upload_2023-1-13_15-50-18.png

I was going to mention that list, actually! But no, I just mean if the shaders you’re using are from the URP/ category or not.

You could try putting the shader(s) you’re using in that list, to see if Unity is throwing them out for some reason.

im not really sure what shaders should be in there, i have a huge list of things ive imported and im a noob still


the only thing i can think of i did, was added a couple of shaders to that list, then took them out cuz i wasnt gonna use them, im kinda desperate and willing to pay somebody for their time to guide me through fixing this issue before i throw myself out the window

If you click on one your materials, you’ll see the shader that it’s using:

8728740--1180959--upload_2023-1-13_14-9-6.png

Note that the dropdown there is using the name the shader declares for itself, whilst the file picker you’re looking at is based on file name, so they might not be identical.

So, find a material that’s invisible in the build and check what shader it’s using. If it’s a custom one you imported, then try putting it in the always-include list.

all my materials are using universal render pipeline/lit, ive considered changing to the built in rp since URP as always given me some kind of problem, but i dont know if thats a good idea

i changed it from lit to simple lit and that made the material visible in build, tho it doesnt look like i would like it but at least its something, looks like the problem is with the lit shader

Same bug with 2021.3.18f1 waiting for a fix

Try going to the material the custom shader is applied to and changing “Queue Control” to “User Override” and then below it changing “RenderQueue” to a value like 2501. Over 3000 works too.

2 Likes

it works but… Why?

I realize this issue has some age, however it still exists so I’m posting the fix that worked for me below…

POTENTIAL FIX: recreate the materials (i.e., new materials, not copies of existing).

The invisible materials issue occurred in my existing URP project in all Unity IDE versions I’ve tested (2020+ and I’ve verified using numerous versions) ONLY when using Shadergraph UNLIT materials. Object were only visible once I created a material from scratch and applied. Attempting to convert to URP material did not work, yes I tried this as a last resort with the mindset that maybe the internal structure of the material changed at some point in the Unity release cycle, hoping for a quck fix… no luck.