Video Texture / createInstance bug take 2

resurrecting Video Texture / createInstance issues - Questions & Answers - HTML5 Game Devs Forum , as I never figured it out and am now further convinced it is a bug after diving deep into the rabbit hole today. – I think I may have explained it wrong initially also, so the quick, corrected explanation is:

Create instance on a mesh with a video texture works fine, if there is only 1 unique sourceMesh in the scene. As soon as I add a second sourceMesh (with a different video texture), and createInstance on that, it bugs out. For a visual example of what I am actually seeing (and or in case for some reason people still can’t reproduce it):

//dont know why the video won’t play but go to url directly I guess Dropbox - IMG_0199.mp4

The red attack icons are an instanced mesh, they play fine, once the blue blocker icons are created (also instances of a source mesh), they bug out.

It’s def specific to createInstance, multiple video textures not using instance behavior or using clone, has been working fine for me. - And it only happens if I have at least 2 different shaderMaterials attempting to use different video textures on different source meshes. If I have just 1 sourceMesh / video texture using createInstance, works fine.

@sebavan were you ever able to test it out on OSX to see if you could recreate the bug?

I created a somewhat cleaned up version of the playground demonstrating the issue here.
https://www.babylonjs-playground.com/#K14Y78#10

I dug around in spector, and the only issue I could see, that didn’t happen if I used a normal custom shader with an image instead of a video, is, in the following screenshot, (in which I am rendering the blocker icons, and the 4 blue meshes bugging out below it are the attack icons, which occurs in the second screenshot) - There is a bindTexture null call, in the first frame. Not sure if that is related to the issue or not.

And the next draw call where it bugs out:

blinking on ios as well, it looks unfortunately like a driver issue cause it happens cross browser there…

Correcting myself, ios looks ok macos looks blinking.

The trace in spector looks as expected despite having a potential rebind optim. I am more and more confident we are unlucky with abdriver issue… could you stitch your video together like an atlas to only have one runing at a time ?

Ok Last Correction from an afternoon of tests: It impacts only Chrome on MacOS from what I can see.

The code should work after a deeper look.

Could you create an issue on the chromium project with the following PG ? https://www.babylonjs-playground.com/#K14Y78#14

I simply removed the underscore depency so it runs the first time you open it

Yea, was just about to reply that it is working on Safari so don’t think it’s driver issue. Sorry forgot to mention that part last night. – Awesome, I will open an issue on chromium tonight, thanks for looking into it!

1 Like

@sebavan 930479 - WebGL video flickering/overwrite issue - chromium - Monorail

2 Likes