jerome Posted July 10, 2015 Share Posted July 10, 2015 Hi, I'm trying to add some simplified skull meshes into my SPS.I'm following this doc and this related PG : http://www.babylonjs-playground.com/#2JBSNA#4 The thing I don't get is : Is the original mesh modified after the simplication process (meaning : it has then less vertices and indices than before) ?Or are new instances created somewhere (submeshes ?) ? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted July 10, 2015 Share Posted July 10, 2015 Hi Jerome, These are the instances that are modified/simplify and not the original. Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 10, 2015 Share Posted July 10, 2015 and added as LOD level I am working on moving the entire implementation to a worker, maybe I will find the time to do it for 2.2. Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 So, given a mesh, how can I access its first simplified instance ?var mesh = aBrandNewMesh;mesh.simplify(blah, blah, ...); Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 10, 2015 Share Posted July 10, 2015 mesh.simplify({...}, true, QUADRATIC,function() { var simplified = mesh.getLODLevelAtDistance(distance);});where "distance" can be set by you, as you gave it in the settings. Another way aould be to directly use the simplification, I documented it shortly here - http://doc.babylonjs.com/page.php?p=24822 , scroll all the way down. Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 Ok, that's exactly what I need : the direct simplication !I need to import the skull mesh, then to simplify it, then use a simplified instance as a shape model for my 3D particles (it runs for now with complete skulls but the FPS decreases to 30 with only 6 skulls) So what is the way to do ?var decimator = new QuadraticErrorSimplification(skull);Then I set, if needed the decimator properties (iteration, aggressiveness, etc).Then ... ?mesh.simplify( what here ? I don't need distance, neither many different decimation levels);How do I actually run the decimation and where is the simplified instance ? Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 10, 2015 Share Posted July 10, 2015 you will need to give one single Settings object. The distance will technically not be used. So:var decimator = new QuadraticErrorSimplification(skull);decimator.simplify({ quality: 0.9, distance: 25, optimizeMesh:true }, function(newMesh) { console.log("Profit!!!", newMesh);});will give you newMesh, that will be the mesh you wanted.In theory this should work :-) Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 The theory works I'm going to do a PG to show this ! Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 10, 2015 Share Posted July 10, 2015 oh, I love it when theory works... GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 thannnnk so much you Raanan !!! The results locally are impressive in Chrome : I can emit 100 skulls at 60 FPS here [EDIT] 150 is the limit at 60 FPS on my machineI feel surprised by my own SPS... and BJS power ! Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 BTW Raanan, I think the simplify() method is an excellent candidate for being ported to workers ! Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 12, 2015 Share Posted July 12, 2015 Yep, it's all on the to do list that is getting bigger all the time. The thing about this list, is that my son keeps on adding things on top I hope to get it finished with 2.2. jerome 1 Quote Link to comment Share on other sites More sharing options...
Temechon Posted July 13, 2015 Share Posted July 13, 2015 I see we are all in the same case, with a BIG todo list and not enough free time xD Quote Link to comment Share on other sites More sharing options...
jerome Posted July 13, 2015 Author Share Posted July 13, 2015 I'm working on a time-extender implementation here : 36h per day is my goal RaananW 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted July 13, 2015 Share Posted July 13, 2015 are there any positive results towards this goal? or is it also on your to-do list? :-) Temechon 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 13, 2015 Author Share Posted July 13, 2015 recursive humor ! love 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.