Jump to content

Instance meshes are unstable


Seyren
 Share

Recommended Posts

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 advance

Seyren :P

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 :P

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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...