DigiHz Data Posted August 16, 2016 Share Posted August 16, 2016 (edited) It seams that when serializing a scene, only the name of the videoTexture is serialized, not the actual filename. Exampel: var videoTexture = new BABYLON.VideoTexture("myVideo", ["video1.mp4", "video1.webm"], scene, true, true); When i serialize the scene it returns something like this in the serialize: Quote {"tags":null,"name":"myVideo","hasAlpha":false,"getAlphaFromRGB":false,"level":1,"coordinatesIndex":0,"coordinatesMode":0,"wrapU":0,"wrapV":0,"anisotropicFilteringLevel":4,"isCube":false,"isRenderTarget":false,"uOffset":0,"vOffset":0,"uScale":1,"vScale":1,"uAng":0,"vAng":0,"wAng":0,"animations":[]} Should it not be....... {"tags":null,"name":"video1.mp4","hasAlpha":false,"getAlphaFromRGB":false,"level":1,"coordinatesIndex":0,"coordinatesMode":0,"wrapU":0,"wrapV":0,"anisotropicFilteringLevel":4,"isCube":false,"isRenderTarget":false,"uOffset":0,"vOffset":0,"uScale":1,"vScale":1,"uAng":0,"vAng":0,"wAng":0,"animations":[]} Or better yet...... {"tags":null,"name":"video1.mp4 seperator video1.webm","hasAlpha":false,"getAlphaFromRGB":false,"level":1,"coordinatesIndex":0,"coordinatesMode":0,"wrapU":0,"wrapV":0,"anisotropicFilteringLevel":4,"isCube":false,"isRenderTarget":false,"uOffset":0,"vOffset":0,"uScale":1,"vScale":1,"uAng":0,"vAng":0,"wAng":0,"animations":[]} As it is serialized now, we can not save a scene with serialisation and load in the videoTexture correctly. EDIT: In fact.....urlsOrVideo is not in the serialization at all. So maybee it should be like this finally..... {"tags":null,"name":"myVideo","urlsOrVideo":"video1.mp4 seperator video1.webm","hasAlpha":false,"getAlphaFromRGB":false,"level":1,"coordinatesIndex":0,"coordinatesMode":0,"wrapU":0,"wrapV":0,"anisotropicFilteringLevel":4,"isCube":false,"isRenderTarget":false,"uOffset":0,"vOffset":0,"uScale":1,"vScale":1,"uAng":0,"vAng":0,"wAng":0,"animations":[]} EDIT2: It would be a good idea to have a base64 fallback texture if the video file could not be loaded. (Same functionality as in when we load in a texture, and if the texture was not loaded the texture is replaced with a base64 internal texture). Edited August 16, 2016 by DigiHz Data Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 16, 2016 Share Posted August 16, 2016 I agree this is wrong Do you mind submitting a PR? Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 16, 2016 Author Share Posted August 16, 2016 I would like to do that, however..... This will affect a lot of code i think in the BJS, so i do not really know how to submit that big PR. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 16, 2016 Share Posted August 16, 2016 Hum not sure to understand. this is a really small update. You have to add a serialize function like this one: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/Textures/babylon.mirrorTexture.ts#L51 and update a bit this function: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/Textures/babylon.texture.ts#L275 Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 16, 2016 Author Share Posted August 16, 2016 I am sorry, but i am not that good a javascript developer yet. Can't you do the PR @Deltakosh. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 16, 2016 Share Posted August 16, 2016 I will but not soon Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted August 16, 2016 Author Share Posted August 16, 2016 Thank you Delta. Please message me when you do. I set my planning of implementing videoTexture into my editor until then. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 16, 2016 Share Posted August 16, 2016 Will be this week for sure Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.