Seyren Posted November 15, 2014 Share Posted November 15, 2014 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. 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 advanceSeyren Quote Link to comment Share on other sites More sharing options...
joshcamas Posted November 15, 2014 Share Posted November 15, 2014 There seems to be many bugs with instances. :/ One example is outlines don't work. Quote Link to comment Share on other sites More sharing options...
Seyren Posted November 16, 2014 Author Share Posted November 16, 2014 That's a shame... Well the version is still in alpha so i guess this kind of stuff happensI hope they get the instances working soon since its pretty much the point of a LOD imo Quote Link to comment Share on other sites More sharing options...
joshcamas Posted November 16, 2014 Share Posted November 16, 2014 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. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 16, 2014 Share Posted November 16, 2014 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. Quote Link to comment Share on other sites More sharing options...
Seyren Posted November 16, 2014 Author Share Posted November 16, 2014 I will eventually add different levels of geometry, but since i didnt have them yet prepared, i only used the last Level to test the new LOD system. Quote Link to comment Share on other sites More sharing options...
joshcamas Posted November 16, 2014 Share Posted November 16, 2014 ahh so in the future LOD will not use separate meshes but different # of vertices... cool! Excited! Quote Link to comment Share on other sites More sharing options...
reddozen Posted November 17, 2014 Share Posted November 17, 2014 yea, we use instances for a lot of things like trees.It would be nice if you defined all your LOD models for the parent item, then that single reference carried though to all the instances based on their distance. Then you don't have to code for every instance. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2014 Share Posted November 20, 2014 LOD is still in alpha version. I plan to do exactly what reddozen pointed out: you define the LOD on the main mesh and all instances use the same LOD data Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2014 Share Posted November 20, 2014 There seems to be many bugs with instances. :/ One example is outlines don't work. COuld you create a playground repro for this? Quote Link to comment Share on other sites More sharing options...
reddozen Posted November 20, 2014 Share Posted November 20, 2014 LOD is still in alpha version. I plan to do exactly what reddozen pointed out: you define the LOD on the main mesh and all instances use the same LOD data Awesome stuff. Welcome back... early. Couldn't stay away? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 21, 2014 Share Posted November 21, 2014 I missed you guys:) Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 21, 2014 Share Posted November 21, 2014 And btw, instances and outlines are working great together:http://localhost:57500/Playground/index%20-%20debug.html#TWDEA#2 Quote Link to comment Share on other sites More sharing options...
joshcamas Posted November 21, 2014 Share Posted November 21, 2014 uhhh that's a localhost link. :S XD Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 21, 2014 Share Posted November 21, 2014 I should go back on vacation http://www.babylonjs-playground.com/#TWDEA#2 Quote Link to comment Share on other sites More sharing options...
joshcamas Posted November 22, 2014 Share Posted November 22, 2014 ahh well what I meant was making a instance have outline, while another does not. I'm assuming this will never be added due to how instances work, right? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 22, 2014 Share Posted November 22, 2014 Correct. Instances must be exactly the same except the world matrix Quote Link to comment Share on other sites More sharing options...
Dad72 Posted December 13, 2014 Share Posted December 13, 2014 @Seyren: LOD with instances working now. View: http://www.babylonjs-playground.com/#14ESWC adam and GameMonetize 2 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.