Help! About Polyspatial shader in other platform e.g. Meta Quest

Hi,

I have a Polyspatial base project that I now need build for other platforms, but it reports some errors when building because the project uses Polyspatial shader nodes(e.g. PolySpaital Volume to World node).


Shader error in 'Sub Graphs/Master': undeclared identifier 
'_PolySpatialVolumetoWorld_646b9517de22403ea008b770b79b1ff8_Out_1_Vector3' at line 186 (on metal)

I dont want install the Polyspatial when building for other platforms.

How can I fix these errors? Any solutions?

Thanks.

You should be able to use the built-in “MaterialX” keyword to ensure that any PolySpatial-specific nodes (such as VolumeToWorld) are only included in the MaterialX export used for visionOS, and not in the standard (ShaderLab) shader generated for Unity.

Although, if you don’t have the PolySpatial package installed, you’ll still get that validation warning. The keyword approach might work anyway, but if not, I’m not sure there’s a way around it besides just using an entirely different shader graph.

Thanks. If I have not install the polyspatial package the shader compiler will be fialed.
If two sets of shaders need to be prepared, this goes against the original intention of Unity’s cross-platform.

The best case is to use the same set of shaders to run on different platforms respectively.

Yes, I agree. It should be sufficient just to have the PolySpatial package installed, though. Does that cause an issue on other platforms, or is it just a matter of not wanting the extra time/space to install the package there?

Some Unity users do not have a Unity Pro License, so they cannot install PolySpatial. But they only want to run this project on devices based on OpenXR. That’s all.

I see; thanks for the clarification! We’ll try to think of a way around the issue for the future.