# Wireframe shader issue

**URL:** <https://forum.magicleap.cloud/t/wireframe-shader-issue/1271>\
**Category:** Unity Development\
**Tags:** development\
**Created:** [December 2, 2022, 9:37pm UTC](https://forum.magicleap.cloud/t/wireframe-shader-issue/1271 "2022-12-02T21:37:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhartley](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@dhartley](https://forum.magicleap.cloud/u/dhartley)\
**Post date:** [December 2, 2022, 9:37pm UTC](https://forum.magicleap.cloud/t/wireframe-shader-issue/1271/1 "2022-12-02T21:37:03Z")

</div>

On device the application crashes when loading an object with the Wireframe material and VR/SpatialMapping/Wireframe shader. Works as expected in the simulator in Unity but will crash every time on device. Other materials / shaders do not cause an issue and it seems to be related to the geometric computation going on in the shader.

It worked on the previous SDK we were using (SDK 0.53.1) both in the simulator in Unity and on device. Any help is much appreciated.

**Unity Editor version** : 2022.2.0b12  
**ML2 OS version** : B3E.220818.12-R.046-R.420 (user)  
**MLSDK version** : 1.0.0  
**Host OS** : Windows

---

<div class="post-metadata">

**Author:** ![dtrujillostyle](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/dtrujillostyle/32/485_2.png) [@dtrujillostyle](https://forum.magicleap.cloud/u/dtrujillostyle)\
**Post date:** [December 8, 2022, 4:51am UTC](https://forum.magicleap.cloud/t/wireframe-shader-issue/1271/2 "2022-12-08T04:51:08Z")

</div>

I've had the same issue, and it SEEMED that it would only do it when I had Magic Leap's new spatial mapping wireframe in the scene with it. I say 'seemed' because I did add it to scenes that didn't use ML's wireframe, and it worked.

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [December 8, 2022, 2:56pm UTC](https://forum.magicleap.cloud/t/wireframe-shader-issue/1271/3 "2022-12-08T14:56:29Z")

</div>

@dhartley Thank you for your post. I'll talk to our engineers and report back here asap.

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [December 8, 2022, 3:05pm UTC](https://forum.magicleap.cloud/t/wireframe-shader-issue/1271/4 "2022-12-08T15:05:48Z")

</div>

@dhartley Can you please try updating to the latest releases in the Magic Leap Hub and let us know if this is still an issue? Thanks very much.

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [January 7, 2023, 8:23pm UTC](https://forum.magicleap.cloud/t/wireframe-shader-issue/1271/5 "2023-01-07T20:23:26Z")

</div>

Hi @dhartley, we've released MLSDK 1.1.0. and Unity Package 1.3.0. Please try updating and let us know if this is still an issue. Thanks very much.

---

<div class="post-metadata">

**Author:** ![john.estrada](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@john.estrada](https://forum.magicleap.cloud/u/john.estrada)\
**Post date:** [March 8, 2023, 3:14pm UTC](https://forum.magicleap.cloud/t/wireframe-shader-issue/1271/6 "2023-03-08T15:14:04Z")

</div>

This is still an issue in with the newest MLSDK. I am working with the following versions

Unity: 2022.2.7f1  
MLSDK: 1.4.0  
MRTK: 2.8.3  
URP: 14.0.6

I tested two scenarios.

- The first one: sphere with material whose shader was "Universal Render Pipeline/VR/SpatialMapping/Wireframe
- The second one: Sphere with a material whose shades was "Mixed Reality Toolkit/Wireframe"

I use the trigger to enable the sphere. As soon as I enable the sphere other gameobject stop rendering but the app still running. I enable a development build to see the log while the app is running and I did not see any error message so I do not why wireframe material is still not working with the newest SDK's releases. Any help would be appreciate it.

---

<div class="post-metadata">

**Author:** ![dhartley](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@dhartley](https://forum.magicleap.cloud/u/dhartley)\
**Post date:** [March 8, 2023, 6:09pm UTC](https://forum.magicleap.cloud/t/wireframe-shader-issue/1271/7 "2023-03-08T18:09:08Z")

</div>

I haven't tried it with the latest MLSDK but I have gotten it to work with shader the Magic Leap uses in their Meshing example "Shader Graphs/Textures/TexturedWireframeGraph" and using their script "MeshTexturedWireframeAdapter" to get the shader to produce the correct result. Using these examples as a base we have been able to get the meshing to work well within our application. The Meshing example scene is included in the Unity Examples package under the Unity packages in the Magic Leap Hub Package Manager.

Hope this helps!
