# Compute bones using shader causes weird shadow

**URL:** <https://forum.babylonjs.com/t/compute-bones-using-shader-causes-weird-shadow/51357>\
**Category:** Bugs\
**Created:** [June 15, 2024, 7:08pm UTC](https://forum.babylonjs.com/t/compute-bones-using-shader-causes-weird-shadow/51357 "2024-06-15T19:08:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Giang\_Le](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/giang_le/32/38757_2.png) [@Giang\_Le](https://forum.babylonjs.com/u/Giang_Le)\
**Post date:** [June 15, 2024, 7:08pm UTC](https://forum.babylonjs.com/t/compute-bones-using-shader-causes-weird-shadow/51357/1 "2024-06-15T19:08:07Z")

</div>

Checkout this playground [https://playground.babylonjs.com/#AQB0DM#10](https://playground.babylonjs.com/#AQB0DM#10)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/c/a/ca27039ad40426c321bf3f9461d29d74124a1605.jpeg)  
“Compute bones using shader” creates shadows with a very strange shape, I can’t turn it off because it will cause a heavy fps drop. When I import this model into Blender and re-export, this shape disappears, but I still want to know the reason, is this a bug?

CC @mrlooi

---

<div class="post-metadata">

**Author:** ![tanpopo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tanpopo/32/32025_2.png) [@tanpopo](https://forum.babylonjs.com/u/tanpopo)\
**Post date:** [June 17, 2024, 1:09am UTC](https://forum.babylonjs.com/t/compute-bones-using-shader-causes-weird-shadow/51357/2 "2024-06-17T01:09:33Z")

</div>

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

Not sure if this is expected, but changing the shadow generator params do work.

---

<div class="post-metadata">

**Author:** ![Giang\_Le](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/giang_le/32/38757_2.png) [@Giang\_Le](https://forum.babylonjs.com/u/Giang_Le)\
**Post date:** [June 17, 2024, 2:50am UTC](https://forum.babylonjs.com/t/compute-bones-using-shader-causes-weird-shadow/51357/3 "2024-06-17T02:50:47Z")

</div>

The issue here is that using the shader and the CPU are not producing the same results.

---

<div class="post-metadata">

**Author:** ![Giang\_Le](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/giang_le/32/38757_2.png) [@Giang\_Le](https://forum.babylonjs.com/u/Giang_Le)\
**Post date:** [June 17, 2024, 2:54am UTC](https://forum.babylonjs.com/t/compute-bones-using-shader-causes-weird-shadow/51357/4 "2024-06-17T02:54:52Z")

</div>

CC @sebavan

---

<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:** [June 17, 2024, 9:27am UTC](https://forum.babylonjs.com/t/compute-bones-using-shader-causes-weird-shadow/51357/5 "2024-06-17T09:27:32Z")

</div>

The problem is that some weights for some vertices are not normalized (their sum is not equal to 1). Loading / saving in Blender fixed it probably because Blender normalizes the weights before saving.

You can normalize the weights yourself at runtime if you want:

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