Seyren Posted January 14, 2015 Share Posted January 14, 2015 I'm not pretty sure the reason of why is this happening, but when we import meshes and use instance of these ones, they tend to blink until they disappear. This is something that only happened on the website, since when i test it on localhost, seemed to work fine, however this has been happening since ever on some computers and not on others. This is the scene where the issue happens, it's basically two meshes, they both make a floor with roads, the first one is a direct mesh import, but the second one is an instance, see the of the whole function code here:var Prt_f01_map = function(scene, offset) { var box = BABYLON.Mesh.CreateBox("box", 1.0, scene); BABYLON.SceneLoader.ImportMesh("", "../Models/Maps/", "prt_bd01.babylon", scene, function (mapZone, particleSystems, skeletons) { mapZone[0].position = new BABYLON.Vector3(-101.492996, 2.988000, -19.001993); mapZone[0].scaling = new BABYLON.Vector3(0.001000, 0.001000, 0.001000); mapZone[0].rotationQuaternion = null; mapZone[0].rotation = new BABYLON.Vector3(0.000000, 4.712389, 0.000000); }); var Prt_f01_prt_bd02_inst = 0; BABYLON.SceneLoader.ImportMesh("", "../Models/Maps/", "prt_bd02.babylon", scene, function (mapZone, particleSystems, skeletons) { mapZone[0].visiblity=false; mapZone[0].isVisible=false; mapZone[0].name = "Prt_f01_prt_bd02"; Prt_f01_prt_bd02_inst++; objInstance = mapZone[0].createInstance("Prt_f01_prt_bd02_inst_"+ Prt_f01_prt_bd02_inst +""); objInstance.visible = true; objInstance.isVisible = true; objInstance.position = new BABYLON.Vector3(-101.492996, 2.988000, -19.001993); objInstance.scaling = new BABYLON.Vector3(0.001000, 0.001000, 0.001000); objInstance.rotationQuaternion = null; objInstance.rotation = new BABYLON.Vector3(0.000000, 4.712389, 0.000000); objInstance.backFaceCulling = true; objInstance.useOctreeForRenderingSelection = true; });}So, the first one the direct import and the next is the instance. http://puu.sh/evLiR/103395f93a.jpg Here you can see both of the meshes, but when you rotate the camera a bit down for example: http://puu.sh/evLnr/5b63b0e0f0.jpg poof! it disappears. Here's the reproduction of the issue: http://www.diviniaro.com/WGClient/Client/index_sprt_f01.html It's a free camera, so feel free to move it the way you want to. Thanks in advanceSeyren Quote Link to comment Share on other sites More sharing options...
amorgan Posted January 14, 2015 Share Posted January 14, 2015 I've seen dissapearance like this and seems more related to the octree selection. Could be completely wrong, but try removing the octree selection and see if the probelm persists. Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 14, 2015 Share Posted January 14, 2015 Pretty sure we're not using octrees in the actual rendering calls. Quote Link to comment Share on other sites More sharing options...
gryff Posted January 14, 2015 Share Posted January 14, 2015 The last line of the code above is :objInstance.useOctreeForRenderingSelection = true;If you look at my Christmas Village piece, it is built on instances - two types of tree, fence posts, wreaths and flashing lights. But the all come from Blender, no octree and not generated in code. cheers, gryff Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 14, 2015 Share Posted January 14, 2015 then maybe there's an issue with octrees? Quote Link to comment Share on other sites More sharing options...
Seyren Posted January 14, 2015 Author Share Posted January 14, 2015 I tried to replace the file with one without hte octree line but now the server replaced it for a blank .js instead, so for now i can't fix it, i'll edit it when this is fixed , thanks in advance EDIT: Commented the line and the issue is still there Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 14, 2015 Share Posted January 14, 2015 octree reference fixed and the issue is still present. Quote Link to comment Share on other sites More sharing options...
amorgan Posted January 14, 2015 Share Posted January 14, 2015 The only other thing that I notice is backFaceCulling, set it to false? I wouldn't think this was it, because I would imagine it would just not show it at all from the angles it disappears, but if it were, maybe the normals are wrong in the scene. Otherwise, i will let the big guys solve this. Quote Link to comment Share on other sites More sharing options...
Seyren Posted January 14, 2015 Author Share Posted January 14, 2015 Setting it to false didn't solve it either, unfortunately . I guess it can be a babylon bug or something, i don't know. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 14, 2015 Share Posted January 14, 2015 Could you reproduce it on a simpler case? Or even on the playground? Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 14, 2015 Share Posted January 14, 2015 It's only 2 models. What would you like simplified, and we can try. We can try to recreate the issue on the playground, but I'm not sure. Quote Link to comment Share on other sites More sharing options...
Seyren Posted January 14, 2015 Author Share Posted January 14, 2015 I would like to reprodude it on the playground but the issue seems to only be happening on mesh importing, and since i can only use the default meshes that come with babylon i can't do it :s And also it's easy to create the issue on that webpage, if you move the camera you'll notice that part of the ground disappears, try moving it down Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 15, 2015 Share Posted January 15, 2015 Ok I understand In this case can you reference www.babylonjs.com/babylon.max.js instead of current version. This will help me debugging Quote Link to comment Share on other sites More sharing options...
Seyren Posted January 15, 2015 Author Share Posted January 15, 2015 At this moment i'm unable to do so but i'll do it as soon as possible >_< done by reddozen Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 15, 2015 Share Posted January 15, 2015 done. I think this is similar to the other times you've fixed this similar issue for me. Every major update seems to break instances or multi mesh objects. I think what's happening is that the parent mesh of the instance that isnt visible is leaving the fulstrum and it's causig the instance to be hidden. That's my best guess. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 15, 2015 Share Posted January 15, 2015 I already checked this and this is not the case as you can see here:www.babylonjs.com?INSTANCES Quote Link to comment Share on other sites More sharing options...
dbawel Posted January 15, 2015 Share Posted January 15, 2015 Is there any chance that the normals on adjcent instances might be infinately close together or have any overlap? I've observed this before when rendering geometry (specifically cubic) with an infintesimal overlap of normals so small that redraw is somewhat conditional (depending on distance, angle, resolution, etc.) when firing camera rays at different angles. It might be worth applying a very slight additive postional offset to the instances just for testing purposes. This has solved similar issues for me in the past. Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 15, 2015 Share Posted January 15, 2015 It worked perfectly in 1.13, so I doubt thats the case dbawel. Quote Link to comment Share on other sites More sharing options...
Seyren Posted January 15, 2015 Author Share Posted January 15, 2015 This bug was also made with an empty project in localhost with nothing more than the two meshes, the project is just 2,45 MB and is enough to make the bug happen. Just open the html and you should see the same thing that is displayed on the link i sent on the first post I hope this helps.WGClient.zip Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 15, 2015 Share Posted January 15, 2015 Guess what? it was a bug with the LOD engine I fixed it Thank you for reporting this one! Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 15, 2015 Share Posted January 15, 2015 Thanks as always! Quote Link to comment Share on other sites More sharing options...
Seyren Posted January 15, 2015 Author Share Posted January 15, 2015 Thanks to you for solving it 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.