Jump to content

LOD bugged when being used in instances.


Seyren
 Share

Recommended Posts

I tested the Instances and i'm not sure if it's a bug or bad coding or mine, but i'm working with mesh instances and seemed to be bugged.

 

Here's the code that i used:

	var knot00 = BABYLON.Mesh.CreateTorusKnot("knot", 0.5, 0.2, 128, 64, 2, 3, scene);	knot00.addLODLevel(10, null);		var newInstance = knot00.createInstance(1)	newInstance.position = new BABYLON.Vector3(1, 1, 1);

If we remove the newInstance, the LOD just works fine and disappears when the camera is 10 units far from the knot, however, when i create the instance, no matter how far i leave, any of the knots will leave.

 

6ffdf681fe.png

 

If for example i add the addLODlevel to the instance instead of the mesh (newInstance.addLODLevel(10, null); ), the webpage just crashes.

 

I thought the instance of the previous mesh was going to get the LOD level too but didn't seem to, am i doing something wrong?

Thanks in advance

Seyren

Link to comment
Share on other sites

with my primitive knowledge of LOD, I'm actually not sure of the point of an instance if you do this. Reason is the whole point of an instance (I think) is that it's a replicate of the mesh.

 

I'm sure someone could make a fancy instance system that basically does this:

 

Instead of having one mesh being the instance maker, make each LOD level mesh be one. Then whenever a instanced mesh needs to change LOD level, it will basically become re-instanced with the other LOD level mesh. Does that make any sense at all? It's hard to explain. ;)

Link to comment
Share on other sites

I think the "LOD system" recently implemented has not yet been done for the Instances.

I do not think the use of LOD to a mesh that appears or disappears as your example, be made for it. LOD is scheduled to take meshes with different levels of polygons.

I think the use of visibility = true or false; to show or hide a grid is more appropriate.

 

 

Link to comment
Share on other sites

  • 3 weeks later...

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