Jump to content

videoTexture serialize


DigiHz Data
 Share

Recommended Posts

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 by DigiHz Data
Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...