I am building Web AR through Unity.
The material of the model is not showing in build and it appears black. There are no errors regarding this so I’m unable to figure out the reason. I tried compressing the mesh, applying baked refection probe map, or even changing materials but its not happening. However, the other parts of the model are fine.
When a model appears black in a Unity Web AR build, it’s often related to material or lighting settings. Here are some potential causes and solutions:
Colorspace Settings: Ensure your project colorspace is set to “Linear Colorspace.” You can check this in Player Settings. If it’s set to “Gamma,” it might cause unexpected color outcomes (see the documentation).
Lightmap Settings: Make sure that lightmap encoding is set to “Normal Quality” in Player Settings. If lightmaps are not properly baked, it can lead to black models (see the documentation).
Material Issues:
Ensure that the materials are correctly assigned and compatible with the platform.
Check if the materials are using shaders compatible with WebGL; some shaders don’t render correctly in WebGL builds.
Inspect textures and make sure they’re correctly imported and referenced.
Rendering Pipeline Compatibility: If you’re using a custom rendering pipeline (e.g., URP or HDRP), ensure that the shader you’re using in your materials supports that pipeline (see the documentation).
Model Normals: Ensure the normals of the model are correct. If they are inverted, it could make the object appear black.
Graphics Settings: Make sure that all required settings in the Graphics Settings are configured correctly for WebGL.
If you’ve checked all the above points and still face issues, it might help to look at the materials directly in the Shader Graph or the Material Inspector and see if they reference any missing textures or incorrect settings.
If you require further assistance, please provide details regarding your Unity version, the shaders you’re using, and any console output during the build process for more targeted help.
1 replies left - Get a PRO license for more AI replies. thread_lE8mblUzhB9uyrAhxiE5ovZc Reply to this message to continue the conversation
Thanks – your model seems to have vertex colors. Unity’s Standard material does not display vertex colors, but they will be exported and then multiplied into the color at runtime. If the model is not supposed to actually have vertex colors, please delete them from the model.