# Decals are not supported for glb files

**URL:** <https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571>\
**Category:** Questions\
**Tags:** material\
**Created:** [October 7, 2022, 11:34am UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571 "2022-10-07T11:34:11Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 11, 2022, 8:32pm UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/21 "2022-10-11T20:32:21Z")

</div>

Small teaser:

https://player.vimeo.com/video/759268747?h=1b8905cfea&app_id=122963

(it’s still a work in progress on the coding side)

---

<div class="post-metadata">

**Author:** ![vijay\_krishna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/vijay_krishna/32/18667_2.png) [@vijay\_krishna](https://forum.babylonjs.com/u/vijay_krishna)\
**Post date:** [October 12, 2022, 4:16am UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/22 "2022-10-12T04:16:41Z")

</div>

Its more than a teaser 🙂

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [October 13, 2022, 11:13am UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/23 "2022-10-13T11:13:00Z")

</div>

You’re the fastest webgl wizard on the west 🙂

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 13, 2022, 6:38pm UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/24 "2022-10-13T18:38:37Z")

</div>

Nearly there!

https://player.vimeo.com/video/760022450?h=9036d1698e&app_id=122963

If not using the new “Culling back faces” flag, you can get a “leak” of the decal on the back, depending on the depth of the projector (meaning the z component of the decalSize parameter):

https://player.vimeo.com/video/760032764?h=9d77564f51&app_id=122963

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [October 13, 2022, 7:51pm UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/25 "2022-10-13T19:51:18Z")

</div>

you rock

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 13, 2022, 9:52pm UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/26 "2022-10-13T21:52:47Z")

</div>

Here’s the PR:

> <https://github.com/BabylonJS/Babylon.js/pull/13111>
>
> See https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/2…1
> 
> The doc has also been updated (https://github.com/BabylonJS/Documentation/pull/673).
> 
> I have tried to remove a number of object creations (\`Vector3\` / \`Vector4\`) to lower GC pressure, at least in the main paths.
> 
> Also, to avoid over-complicating the code even more, I handle only the first 4 matrix indices/weights of a rigged mesh when creating new vertices at the clipping stage (vertices that are not clipped retain their full indices/weights). I did not see any artefacts because of that in my testings. This code can be revisited later if necessary.

I have also updated the docs:

> **[Decals | Babylon.js Documentation](https://documentation-git-fork-popov72-decal-support-rigged-babylonjs.vercel.app/features/featuresDeepDive/mesh/decals)**
>
> Learn how use decals in Babylon.js.

@vijay_krishna I hope you don’t mind I have used your character for the screenshots in the doc?

Here’s a PG you can play with but that will fully work only when the PR is merged:

> **[Babylon.js Playground](https://playground.babylonjs.com/#EEUVTY%23201)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![vijay\_krishna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/vijay_krishna/32/18667_2.png) [@vijay\_krishna](https://forum.babylonjs.com/u/vijay_krishna)\
**Post date:** [October 14, 2022, 5:45am UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/27 "2022-10-14T05:45:36Z")

</div>

Thanks @Evgeni_Popov u r amazing

quick question,  
once we click on the moving object the decal is getting in front of the object only, not getting overlayed on the moving object. ideally it shud be part of the mesh. Do we need to add any settings to get the decal overlayed ?  
i think PR is merged…

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 14, 2022, 8:17am UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/28 "2022-10-14T08:17:14Z")

</div>

I think the Playground was not updated yet when you tested as I have just tested and it is working as expected (you may need to clear the cache of the browser to get the updated Playground). If you are looking at the first video [here](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/24) you will see the decal is moving with the object.

---

<div class="post-metadata">

**Author:** ![vijay\_krishna](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/vijay_krishna/32/18667_2.png) [@vijay\_krishna](https://forum.babylonjs.com/u/vijay_krishna)\
**Post date:** [October 14, 2022, 8:37am UTC](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571/29 "2022-10-14T08:37:48Z")

</div>

Thanks @Evgeni_Popov so much

[Previous page](https://forum.babylonjs.com/t/decals-are-not-supported-for-glb-files/34571.md?page=1)
