ALINE Label3D not visible on Android

When using Label3D in the unity editor, all is working as expected. But as soon as I make a build for android using Vulkan graphics API, the 3d label isn’t displayed. I didn’t see any errors or other issues with the rendering.

Lines and other primitive shapes work as expected.

I also noticed that the Label3D is not burst compatible (inside of an ISystem) even when used with a FixedString.

Any Advice would be appreciated.

Hi

Do you see any errors when clicking on the shader assets in Unity?

It should be supported. Make sure you pass the FixedString using ref.

Thank you Aron for answering so promptly (as always :smiling_face:)

The error during complication I get is the following:

.\Library\PackageCache\com.unity.collections@2.1.0-pre.6\Unity.Collections\FixedStringAppendMethods.cs(417,17): Burst error BC1016: The managed function `System.String.get_Length(System.String* this)` is not supported

This bubbles up from the ALINE drawing code.

Now if this is a burst bug or not I’m not sure.

Any idea why the rendering on android seems not to work only for the text labels (all other primitives work)

Code I used to draw:

var text = new FixedString512Bytes("Frank");

drawing.Label3D(position + math.up() * 0.3f, transform.WorldRotation,
                        ref text, 0.2f, LabelAlignment.Center,
                        Color.black);

After further testing, Label3D works as expected.

For some reason, unity had a build artifact, and after deleting the build folder and building again from scratch all is working.

So the only issue is with the burst compiler.

Hi

Great that it works now!

When creating fixed strings in burst you need to use the following syntax:

FixedString512Bytes = "Frank";

to allow the burst compiler to allocate it without using a managed string.

:man_facepalming: thank you @aron_granberg. Indeed how could I overlook that?

Now all is working fully bursted!

I just wish we could use DrawingManager.GetBuilder(true); also fully bursted :wink:, but that isn’t supported correct?

Great!

No, that is not supported, I’m afraid. Due to Unity limitations, I cannot guarantee that this would be thread-safe.

1 Like