# Syncing up mesh rotation with light direction

**URL:** <https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788>\
**Category:** Questions\
**Created:** [November 4, 2019, 10:36pm UTC](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788 "2019-11-04T22:36:08Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 6, 2019, 4:44pm UTC](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788/22 "2019-11-06T16:44:27Z")

</div>

yeah the problem is on the gizmo side. Rendering is correct. Light icon is not 😉

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [November 8, 2019, 12:50am UTC](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788/23 "2019-11-08T00:50:12Z")

</div>

Is this where to find the same build that’s used in Playground?  
[Babylon.js/dist/preview release at master · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview%20release)

I’m seeing same problem with inverted lighting using the build from that location in Github (but not in Playground). Latest build on left. Playground on right: [https://www.babylonjs-playground.com/#1JLGFP#127](https://www.babylonjs-playground.com/#1JLGFP#127)

 ![53%20PM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/0/07368711f21c6481146bc5567345efbbb5b3c829.jpeg)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 8, 2019, 4:54pm UTC](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788/24 "2019-11-08T16:54:57Z")

</div>

> [@bigrig](#):
>
> Is this where to find the same build that’s used in Playground?  
> [Babylon.js/dist/preview release at master · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/tree/master/dist/preview%20release)

Correct 🙂  
playground is getting its files from [preview.babylonjs.com](http://preview.babylonjs.com) which uses the link above

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [November 8, 2019, 5:19pm UTC](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788/25 "2019-11-08T17:19:58Z")

</div>

Hm. Well, there may be still a bug somewhere in here then. I get different results with same the build from preview and on the PG. And the workarounds that I used from the previous build no longer fix the issue with the light being reversed.

This is how I fixed it previously:  
`this.meshes[i].material.usePhysicalLightFalloff = false;`

 ![18%20AM](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/4/42021286bc09b0ad69c2f71131162b8443321443.jpeg)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [November 8, 2019, 5:23pm UTC](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788/26 "2019-11-08T17:23:20Z")

</div>

You must have a discrepancy somewhere. The PG only uses preview  
Are you sure that you are using everything from preview? babylon.js, loaders, etc…

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [November 8, 2019, 5:24pm UTC](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788/27 "2019-11-08T17:24:33Z")

</div>

Ah yea - just occurred to me that i’m still using some other libraries from local. Will update those to use preview with fingers crossed.

---

<div class="post-metadata">

**Author:** ![bigrig](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bigrig/32/5548_2.png) [@bigrig](https://forum.babylonjs.com/u/bigrig)\
**Post date:** [November 8, 2019, 8:06pm UTC](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788/28 "2019-11-08T20:06:09Z")

</div>

That was it! It was the loaders file. Ooh and the gizmo is working again.  
Phew, thank goodness. That was tough to work around.

Noting that with spotlights and pointlights, if I don’t turn off usePhysicalLightFalloff, it’s pretty tough to get something illuminated… need a light right up against it with high intensity.

[Previous page](https://forum.babylonjs.com/t/syncing-up-mesh-rotation-with-light-direction/6788.md?page=1)
