Hagop Posted October 8, 2016 Share Posted October 8, 2016 Hi I have a number of questions on binary and incremental conversion I have a scene with a number of meshes which I exported to a file after serializing.I used the makeincremental tool (after adding Newtonsoft jhost) and converted my scene to incremental. I had a performance gain of 40% which is excellent. My initial questions are my incremental files have extension babylongeometrydata and not babylonmeshdata. What is the difference? the makeincremental command seems to use a [textures] parameter, but I don't see it being used in the .cs source file. Now I want to convert my original scene to binary format to get even better performance do I need to use the original scene file (ie: somefile.babylon) or do I process the incremental file (ie: somefile.incremental.babylon)? I get the following error when I run converttobinary.exe on either somefile.babylon or somefile.incremental.babylon Cannot perform runtime binding on a null referenceMicrosoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime bi nding on a null reference at CallSite.Target(Closure , CallSite , Object ) at ConvertToBinary.Program.Extract(String srcPath, String dstPath, String obj Name, Object meshObj, Boolean isMesh) in C:\ConvertToBinary\Program.cs:line 191 exp7storey_11r1.babylon Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 10, 2016 Share Posted October 10, 2016 Hey! 1. Generally speaking: no difference. Internally this is used by geometry (basic shapes or shared data) and pure mesh data (when not shared) 2. Not implemented (Yet) 3. You have to process initial file 4. can you debug it? (Source are available on the repo) Quote Link to comment Share on other sites More sharing options...
Hagop Posted October 11, 2016 Author Share Posted October 11, 2016 I think there is a bug in the converter. The following line causing the null reference error when meshObj.id is valid and meshObj.name is null meshName = meshObj.name.ToString(); I fixed it this way string meshName = ""; if(meshObj.name !=null) { meshName = meshObj.name.ToString(); meshName = meshName.Trim(); if (meshName.Length > 40) meshName = meshName.Substring(0, 40); } Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 13, 2016 Share Posted October 13, 2016 Please submit a PR for this fix Quote Link to comment Share on other sites More sharing options...
Visam Posted January 23, 2017 Share Posted January 23, 2017 On 11/10/2016 at 11:13 PM, Hagop said: I think there is a bug in the converter. The following line causing the null reference error when meshObj.id is valid and meshObj.name is null meshName = meshObj.name.ToString(); I fixed it this way string meshName = ""; if(meshObj.name !=null) { meshName = meshObj.name.ToString(); meshName = meshName.Trim(); if (meshName.Length > 40) meshName = meshName.Substring(0, 40); } I have got almost the same problem: Quote Fatal error encountered: Cannot perform runtime binding on a null reference but there is no this string in the source file: meshName = meshObj.name.ToString(); there is even no meshObj in the file Program.cs Quote Link to comment Share on other sites More sharing options...
Visam Posted January 23, 2017 Share Posted January 23, 2017 On 08/10/2016 at 5:02 PM, Hagop said: Hi I have a number of questions on binary and incremental conversion I have a scene with a number of meshes which I exported to a file after serializing.I used the makeincremental tool (after adding Newtonsoft jhost) and converted my scene to incremental. I had a performance gain of 40% which is excellent. My initial questions are my incremental files have extension babylongeometrydata and not babylonmeshdata. What is the difference? the makeincremental command seems to use a [textures] parameter, but I don't see it being used in the .cs source file. Now I want to convert my original scene to binary format to get even better performance do I need to use the original scene file (ie: somefile.babylon) or do I process the incremental file (ie: somefile.incremental.babylon)? I get the following error when I run converttobinary.exe on either somefile.babylon or somefile.incremental.babylon Cannot perform runtime binding on a null referenceMicrosoft.CSharp.RuntimeBinder.RuntimeBinderException: Cannot perform runtime bi nding on a null reference at CallSite.Target(Closure , CallSite , Object ) at ConvertToBinary.Program.Extract(String srcPath, String dstPath, String obj Name, Object meshObj, Boolean isMesh) in C:\ConvertToBinary\Program.cs:line 191 exp7storey_11r1.babylon @Hagop may be you have an executable file to share with me? Quote Link to comment Share on other sites More sharing options...
Visam Posted January 23, 2017 Share Posted January 23, 2017 48 minutes ago, iTekVR said: @Hagop may be you have an executable file to share with me? both ConvertToBinary and MakeIncremental don't work.... Quote Link to comment Share on other sites More sharing options...
Visam Posted January 23, 2017 Share Posted January 23, 2017 Just now, iTekVR said: both ConvertToBinary and MakeIncremental don't work.... line 101: if (mesh.checkCollisions.Value) // Do not delay load collisions object Quote Link to comment Share on other sites More sharing options...
Visam Posted January 23, 2017 Share Posted January 23, 2017 7 minutes ago, iTekVR said: both ConvertToBinary and MakeIncremental don't work.... line 227: if (mesh.checkCollisions.Value) // Do not delay load collisions object Quote Link to comment Share on other sites More sharing options...
Hagop Posted January 24, 2017 Author Share Posted January 24, 2017 iTekVr, I will reply to you in 2 days if you don't mind. Visam 1 Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 26, 2017 Share Posted January 26, 2017 i stream sometimes movies up to 1,5GB http://www.flipcode.com/archives/The_Half-Edge_Data_Structure.shtml https://github.com/tolkanabroski/coding/blob/master/webgl-xp/testpage/cat.json good luck Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 26, 2017 Share Posted January 26, 2017 you can also stream singel LODs of the mesh and then merge them them in real time. google it. Quote Link to comment Share on other sites More sharing options...
Hagop Posted January 29, 2017 Author Share Posted January 29, 2017 iTekVr, OK, so I had a scene with multiple meshes which I serialized and exported as a babylon file var serializedScene = BABYLON.SceneSerializer.Serialize(scene); var strScene = JSON.stringify(serializedScene); var filename = globalRackExportName; saveBlob(filename,strScene); function saveBlob(filename,strScene) { var blob = new Blob ( [ strScene ], { type : "octet/stream" } ); // turn blob into an object URL; saved as a member, so can be cleaned out later var objectUrl = (window.webkitURL || window.URL).createObjectURL(blob); var link = window.document.createElement('a'); link.href = objectUrl; link.download = filename; var click = document.createEvent("MouseEvents"); click.initEvent("click", true, false); link.dispatchEvent(click); return; } It is important for you to understand at this point is that, since the scene was in the memory of the PC, the exported babylon file contains geometry data (vertex) and not mesh data. The ConvertToBinary & MakeIncremental utilties will treat the input as geometry and not mesh data and export in babylonbinarygeometrydata & babylongeometrydata respectively. However, at the time I was working with BABYLON.JS ver. 2.4, Babylon could not process babylonbinarygeometrydata but ony babylonbinarymeshdata.So I "tricked " the system, so that the output file name was babylonbinarymeshdata, but I continued using the geometry data in my exported scene file and I had a huge gain in performance. Attached in the cs file you can open in Visual Studio which includes the bug fix mentioned above.Finally be remined that you can use the command BABYLON.SceneLoader.Append("productshr/", sceneVar, scene, function (newScene) {} to append the converted files to your existing scene, where sceneVar is the entry point name of your converted file (either incremental or binary). Hope this helps ! Program.cs 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.