# debugWireframe not working with 3DTILES\_content\_gltf

**URL:** <https://community.cesium.com/t/debugwireframe-not-working-with-3dtiles-content-gltf/19741>\
**Category:** CesiumJS\
**Created:** [July 28, 2022, 4:38am UTC](https://community.cesium.com/t/debugwireframe-not-working-with-3dtiles-content-gltf/19741 "2022-07-28T04:38:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![donhatch](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/donhatch/32/3458_2.png) [@donhatch](https://community.cesium.com/u/donhatch)\
**Post date:** [July 28, 2022, 4:38am UTC](https://community.cesium.com/t/debugwireframe-not-working-with-3dtiles-content-gltf/19741/1 "2022-07-28T04:38:07Z")

</div>

In CesiumJS, I’ve noticed that wireframe mode (tileset param `debugWireframe`) doesn’t work with 3D Tiles tilesets that use the 3DTILES\_content\_gltf extension, i.e. tilesets that have content as .glb files  
rather than .b3dm files. In particular, it doesn’t seem to work with 3D Tiles Next tilesets.

Is this a known problem? Is there a workaround?

To demonstrate, start with each of the following two sandcastle demos:

- [the 3D Tiles “Adjust Height” demo](https://sandcastle.cesium.com/?src=3D%20Tiles%20Adjust%20Height.html&label=3D%20Tiles)
- [the “3D Tiles Next S2 Globe” demo](https://sandcastle.cesium.com/?src=3D%20Tiles%20Next%20S2%20Globe.html&label=3D%20Tiles%20Next)

and either:

- add `debugWireframe:true,` to the tileset construction params, or
- add `tileset.debugWireframe = true;` after construction of the tileset, or
- add `viewer.extend(Cesium.viewerCesium3DTilesInspectorMixin);` after construction of the viewer, pick the tileset at runtime, and then try toggling the Display-\>wireframe checkbox.

Notice that wireframe mode works in the first (3D Tiles) demo, but seems to be ignored in the second (3D Tiles Next) demo. In general, I’ve observed that the problem seems to be specific to tilesets that use the 3DTILES\_content\_gltf extension.

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [July 28, 2022, 2:34pm UTC](https://community.cesium.com/t/debugwireframe-not-working-with-3dtiles-content-gltf/19741/2 "2022-07-28T14:34:37Z")

</div>

Hi @donhatch,

Tilesets that are loaded with `glb` / `glTF` files are loaded with `ModelExperimental` instead of old `Model`. `ModelExperimental` requires an `enableDebugWireframe` option in order for `debugWireframe` to work.

So you’ll want to construct your tileset like so:

```auto
const tileset = new Cesium.Cesium3DTileset({
    url: "my url",
    enableDebugWireframe: true,
  });

```

Then, `debugWireframe` can be toggled at runtime. Note that we plan for `ModelExperimental` to replace `Model` entirely in the future, so this will eventually become required for all tilesets.

The underlying reason for this difference is that `Model`’s wireframe was not implemented accurately, and `ModelExperimental` needs to be loaded differently in order to correctly construct a wireframe. If you want, you can see these issues for more info:

> <https://github.com/CesiumGS/cesium/pull/10344>
>
> Closes #10340. Currently wireframes in \`ModelExperimental\` require the indices t…o be loaded as typed arrays for WebGL1. However, this will result in performance costs for users that don't need the \`debugWireframe\` option.
> 
> The preferred solution is to require an option, \`enableDebugWireframe\`, to be explicitly set as \`true\` in the \`ModelExperimental\` constructors. If this is true, then \`debugWireframe\` will work for models in WebGL1. However, if this is not true, then toggling \`debugWireframe\` will have no effect. This will not affect models in WebGL2 because in WebGL2, data can be pulled from GPU buffers.
> 
> \[\`ModelExperimental\` Sandcastle\](http://localhost:8080/Apps/Sandcastle/index.html#c=tVdtb9s2EP4rhPehzmDLsuMkrpcWy1uzDg0a1GkLbB4GSjpbhClSIynbWZH/viMpyXLsbF2LOLEtkkfec3cP786xFNqQJYMVKPKKCFiRC9CsyIJPbq49bcVufCGFoUyAmrY65MtUEKJTWfDkTLCMGhgTowro2PkYJWFt3ueG4eFjL0xIr0c+ilhmGQhDjCQGULFJqSErpmCmaAaarKRakJlU5DNE1+8G1U4FfxUojpNzPvCq7NLDVDwc/DQVU+ENCGIu40UQF0qhkjuWAZpUmvNrwRkVlwg1mCmZvdVydBz22/aYaWsQDvrdfr8bvrwbhOPByfjwJAj7x+HxcHhydDgcHY+GL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YQHXmU+44/Eu5zIuLAcDOZgrjjYx/P7t3iPW6XMtGW1lZYsBHbXSNTAWMXtmkX7RGie8/vzEstGtFMp37PHesECeR9pUEvLxOa+aWs/V1suSIEuIh0rFkGDkUvKC6gZme0hvE1nVmgTAfvX6rROtbnn8LoK6M8syzHB20TVxpppAGsmOlz3IuzrwASx1lUBJOSHyr9fNoSL0GFz1waMiZpHtD0cdEj1DoPRZjfeDow6em1Mhvm6MR1JlYDqepZuLz7sqGYix4TSALAEZRgmoi7lbC7GmLmShMOu1q6x1B1saa6WImmMzLZXd1W7FA1b1s/wF2F35SrPGO3gyePtp72mv08TtiQsebXnpyeJOdUaV2YFdxl32np92kP5na1cujzyHg3n9N6Kpf3X7/xkEASnPRzu31lTvw7/qXenuc/BgkohXkS2//LksWhs34LjBNuorr2BlZhtavbytuP3fswT9+P5hdPwoqFzksrVpghUbtrg/Qc) and \[3D Tiles sandcastle\](http://localhost:8080/Apps/Sandcastle/index.html#c=zVh7Uxs3EP8qqicTzhNzBidMWtswLYYktBCY4CZ/YKaR74RPQZauks7gMP7uXUn30Dkm4ZWZZphYt9rHb1d7q90bEEWzabh/nRJJp4RrzN4QrDNJVEg4HjNyJGLC/H20jbTMSG/EI8GVRjNKrogEKidXaOD0fbS0YNSI7PNAgCDlRI4aLXQz4gipBMfiSnWtqpahgDJNrvVxqimo7To2hNpt9DcYmhrbSAukCZjUCdboikpyIfGUKHQl5CW6EBJ9IuO3h51CUpJ/M2AH4oR1nCmztRjxRRPgO+AhGCU8DnLkjugeXu4NKSPqgKuURFrII3pNebN0nBZ0460NEwQhVxqtVGC1W05QUgKImIguwyiTEnwcQpTrsfwzYxTzPaxJ0Hm19Xqr0wk3t169/q3TtEocFhURTirz9hG2GYFgGQhEe8wzD68Nc84CUT9zscuDjxCH+HbRqDF0HHB+xQ5kiMhkRLoFAQFbGLbh7xRPU0YAMW7XAtnOtZSLdm44/KIEL3UvWreBkJgrloFvjwWyi3WUkLj49RQ/HFL7OMWQbz8N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oqvJJjPsHK2c3mwrA94muk/rB+eQ+YaMpU498lZvXAftsDqioKXb1oPV9x++XZ1UdXqxfy9rerbhQlzK5/4W0FxIk6MET7RCfDX5ENHzjnN56zAfL+hwLfRg59+LtdDL15Q77S+hbKs+Yye93xuwUjIxMQrYJ+f3fgSiy56drPCmcBnai4+FwpqV735vta67VSH85SEh/tvhv8MDg8Gf/1vzrNwViWQ93CQMA844R97c3Swt3e4X/nTaDX6tkbvFOH5ncLQKLVpIQLotDWBThtDY9AeZ9ElVPRIqSKC/bYv2o/pDNF4e8WHVBQxrBTsXGSMndKvUDp2+m3g/0aUCXvtHs+IZHhu2JLNnUNHDMOw34bH1ZJl51x60ncvO4phTFgfQ9sMXKL4ZFu87K2iTRqSa2j518xYApfEDEM96y6PBCXzANtf4B8kQiiCMMpZAOSa9c6JVmAM5j41GYM0nIQJU0Kiy7G4hvj4EC2ZxF1UduY76NQta5576/8A) for testing. I left comments for the lines that should be toggled on / off for testing.

> <https://github.com/CesiumGS/cesium/pull/10526>
>
> \`ModelExperimental\` requires a user to specify \`enableDebugWireframe: true\` in t…he constructor of a tileset, in order for the debug wireframe to work. In preparation for enabling \`ModelExperimental\` by default, this PR adds that flag to the sandcastles that use the 3D Tiles Inspector.

---

<div class="post-metadata">

**Author:** ![donhatch](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/donhatch/32/3458_2.png) [@donhatch](https://community.cesium.com/u/donhatch)\
**Post date:** [July 28, 2022, 3:48pm UTC](https://community.cesium.com/t/debugwireframe-not-working-with-3dtiles-content-gltf/19741/3 "2022-07-28T15:48:53Z")

</div>

Hi Janine, thanks for explaining, and for the references.  
I’ll add enableDebugWireframe to my programs.

It seems to me there’s a remaining usability problem here, though.  
That is, if I hook up a Cesium3DTilesInspector to a tileset that uses glb/glTF content,  
then the inspector will contain a “wireframe” checkbox that doesn’t do anything,  
and the user is given no hint of what this checkbox is supposed to do, or, conversely, whether any kind of wireframe mode is available at all.  
Is there anything that can be done about this?

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [July 28, 2022, 4:56pm UTC](https://community.cesium.com/t/debugwireframe-not-working-with-3dtiles-content-gltf/19741/4 "2022-07-28T16:56:37Z")

</div>

Hi @donhatch ,

Those are good points, thank you for bringing them up. I opened an issue below so we can address this when we make all tilesets load with `ModelExperimental`. We’ll work on communicating this to users to avoid future confusion.

> <https://github.com/CesiumGS/cesium/issues/10608>
>
> In \`ModelExperimental\`, the \`enableDebugWireframe\` flag is required for \`debugWi…reframe\` to work. Otherwise, nothing happens when \`debugWireframe\` is toggled. This isn't a requirement for tilesets that use \`b3dms\`, for example, but \`ModelExperimental\` will eventually be used to load all model types. When we make this transition, we should more clearly convey to the user that \`enableDebugWireframe\` needs to be set true for \`debugWireframe\` to work.
> 
> Some suggestions:
> \- \`oneTimeWarning\` if a user is setting \`debugWireframe: true\` in the tileset constructor without setting \`enableDebugWireframe\` true
> \- disabling the wireframe checkbox in \`Cesium3DTilesInspector\`, with some text that \`enableDebugWireframe\` should be true for this to work
