# Scene become black when highlight an object with an invalid video texture

**URL:** <https://forum.babylonjs.com/t/scene-become-black-when-highlight-an-object-with-an-invalid-video-texture/729>\
**Category:** Bugs\
**Created:** [January 13, 2019, 12:40pm UTC](https://forum.babylonjs.com/t/scene-become-black-when-highlight-an-object-with-an-invalid-video-texture/729 "2019-01-13T12:40:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sybaris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sybaris/32/414_2.png) [@sybaris](https://forum.babylonjs.com/u/sybaris)\
**Post date:** [January 13, 2019, 12:40pm UTC](https://forum.babylonjs.com/t/scene-become-black-when-highlight-an-object-with-an-invalid-video-texture/729/1 "2019-01-13T12:40:10Z")

</div>

Hello

First, thanks for this beautiful framework.  
I am very impressed by the work you have done …

I have a problem, and I would like you to confirm me or not if it is a bug …  
Code is here : [Babylon.js Playground](https://www.babylonjs-playground.com/ts.html#WURV1X)

Steps to reproduce :

- Run : you see a scene with a plane, a cube and a sphere in gray.
- Mouve over the plane : all the objects of my scene becomes black.
- Mouse out the plance : all the objects of my scene are now ok.

Note something : the video is ‘invalid’.  
In my real application (here is only an extract to reproduce my bug), the stream of the video is KO (network problem, or other problem…).  
I understand, that the plane becomes black, but I do not understand why all my scene is affected by this problem.

1°/ Could you to confirm me or not if it is a bug …  
2°/ Do you have an idea of workaround ?

Thanks for advance  
Jean-Pierre

---

<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:** [January 14, 2019, 12:05am UTC](https://forum.babylonjs.com/t/scene-become-black-when-highlight-an-object-with-an-invalid-video-texture/729/2 "2019-01-14T00:05:38Z")

</div>

In order to draw the material, the texture needs to be ready which was causing trouble. PR is here: [Fix highlight on unready meshes by sebavan · Pull Request #5747 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/pull/5747)

This will be fixed on the next nightly.

---

<div class="post-metadata">

**Author:** ![sybaris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sybaris/32/414_2.png) [@sybaris](https://forum.babylonjs.com/u/sybaris)\
**Post date:** [January 15, 2019, 8:26pm UTC](https://forum.babylonjs.com/t/scene-become-black-when-highlight-an-object-with-an-invalid-video-texture/729/3 "2019-01-15T20:26:35Z")

</div>

Hi,

Thanks for your answer. Happy to see you have fixed that so quickly…  
I have not tested yet.  
Do I have to download/clone the gitbug babylonjs repo to make a test, or there is an easiest way ?

I just take a quick look on the pull request, I am very surprised : I was thinking there was some code to test if video was invalid…

Regards  
Jean-Pierre

---

<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:** [January 15, 2019, 9:06pm UTC](https://forum.babylonjs.com/t/scene-become-black-when-highlight-an-object-with-an-invalid-video-texture/729/4 "2019-01-15T21:06:40Z")

</div>

You can directly test on the playground you provided it is deployed at least once a day from master.

The issue was not related to video but to the presences of none ready materials.

---

<div class="post-metadata">

**Author:** ![sybaris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sybaris/32/414_2.png) [@sybaris](https://forum.babylonjs.com/u/sybaris)\
**Post date:** [January 15, 2019, 9:31pm UTC](https://forum.babylonjs.com/t/scene-become-black-when-highlight-an-object-with-an-invalid-video-texture/729/5 "2019-01-15T21:31:35Z")

</div>

Wonderful. I was not aware that playground uses the latests sources.  
I suppose if I want this in my project, I can use [https://preview.babylonjs.com/babylon.js](https://preview.babylonjs.com/babylon.js) …

Thank you very much for a so quick fix…
