Error logs for every instance of a material 0.7.1

There’s an issue in 0.7.1 where shaders on material instances are throwing errors in the “MaterialConversionHelpers.cs” class. This seems to be happening for all non-shadergraph shaders. We’re using many hand written shaders for objects and rendering to texture though so this is causing a lot of log spam.

Example of log:

Material ‘Actor (Instance)’ with Shader ‘Mobile/VertexColor+Tint+Stencil’ doesn’t have a color property ‘_BaseColor’
UnityEngine.Material:GetColor (int)
Unity.PolySpatial.Internals.MaterialConversionHelpers:ConvertCommonMaterialProperties (int,int,bool,bool,UnityEngine.Material,Unity.PolySpatial.Internals.PolySpatialMaterialData&) (at .../com.unity.polyspatial/Runtime/Rendering/MaterialConversionHelpers.cs:215)
Unity.PolySpatial.Internals.MaterialConversionHelpers:ConvertCommonURPMaterialProperties (UnityEngine.Material,Unity.PolySpatial.Internals.PolySpatialMaterialData&) (at .../com.unity.polyspatial/Runtime/Rendering/MaterialConversionHelpers.cs:282)
Unity.PolySpatial.Internals.MaterialConversionHelpers:ConvertURPSimpleLitMaterial (UnityEngine.Material,Unity.PolySpatial.Internals.PolySpatialMaterialData&) (at .../com.unity.polyspatial/Runtime/Rendering/MaterialConversionHelpers.cs:696)

I experience this as well with 0.7.1, but also for my custom made ShaderGraph shaders.
In Play to device, all shaders appear black (different from the lighting bug in 0.6.x).

Material ‘TextureSlicer (Instance)’ with Shader ‘Shader Graphs/TextureSlicer’ doesn’t have a float or range property ‘_AlphaClip’

I’ve logged a bug for this case:

IN-64127

1 Like

Thanks – we’ll take a look. I suspect the problem here is that the polyspatial machinery is running over objects that you’re just using for render to texture, and it shouldn’t be.

Out of curiosity, is the content you’re rendering to a texture in a separate Unity scene / different layer with a camera set to a particular culling mask? Or how are you managing the content that you’re only using for render-to-texture?

It’s on a layer thats not being tracked by polyspatial, and using a normal camera and manually calling Render() on it each frame. We’re using a mixture of render to texture and polyspatial tracked 3d objects.

In the submitted bug report project, the object using the incompatible shader (SphereRT) is on the Default layer, which is being tracked by PolySpatial. If I change it to be on the Water layer (just for example), and then set “Disable Tracking Mask” in the PolySpatial settings to Water, then the object is no longer tracked by PolySpatial and the errors don’t appear.

For rendering to texture, the bug report project doesn’t have a script to call Render manually, but if I add the one we have in the docs, then I see the rendered material as expected:

Ah sorry, I was referring to our project, not the bug report project. I’ll open up the bug report project and try these fixes and see if I can apply them to our main project and get back to you!

1 Like

Confirmed that this fixes the error logging. Can I request better error logs for this - its pretty hard to decipher which things are throwing errors.