GameMonetize Posted January 20, 2015 Share Posted January 20, 2015 Yes please create a page on the new doc site: doc.babylonjs.com (You can obviously copy/paste what you already did ) I locked down the Wiki while we are transitioning to doc.babylonjs.com Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 20, 2015 Author Share Posted January 20, 2015 So, submitted the page. I made a few small changes to what I wrote in the github wiki, but in general i took your advice and copy/pasted it :-)Once i can add further demos I will. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 20, 2015 Share Posted January 20, 2015 Playground updated and doc validated! Thanks RaananW!!! Quote Link to comment Share on other sites More sharing options...
joshcamas Posted January 21, 2015 Share Posted January 21, 2015 If anyone wants to know the page for LOD is found here:http://doc.babylonjs.com/page.php?p=24822 And I just wanna say that you, Raanan, has done a HUGE favor to all of us here at babylon. You've created something that will make our games faster for the years to come, and I for one am super grateful for it! Your awesome! Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 21, 2015 Author Share Posted January 21, 2015 I will be really glad to see that working in a game. :-) Always a pleasure contributing back to such a great project! Skull is decimated wonderfully - http://www.babylonjs-playground.com/#2JBSNA (it will alert when it finished all 5 levels of simplification, just zoom in and out and look at the number of vertices). Still a small problem with disappearing triangles, but it is actually unnoticeable when you are so far away from the object. I will anyhow look into that, this shouldn't have happened. Maybe due to the async porting, I gotta check.I will continue on improving and fixing this code, if anyone has a question or something is not working correctly, please let me know! Would be happy to answer. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 21, 2015 Share Posted January 21, 2015 I notice that at the first transition, some face missing on the models. Is this a bug? Thank you Raanan for this wonderful functionality. Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 21, 2015 Author Share Posted January 21, 2015 yes, this is what I meant with "Still a small problem with disappearing triangles". I am working on it, I believe it has something to do with concurrency. On large models, or if set at a relative large distance, it will be unnoticed (look at the skull from very far away, it is 90% reduction, but shape is preserved).I hope to fix it in the next few days. Will update here. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted January 21, 2015 Share Posted January 21, 2015 Ok Raanan. Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 22, 2015 Share Posted January 22, 2015 Auto LOD doesn't appear to be taking the scale of the parent mesh with the babylon 2.0 beta. Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 23, 2015 Author Share Posted January 23, 2015 Hi,I tried avoiding object cloning, as this sets the geometry as well. But by not using clone, I didn't set the other parameters... I know how to fix this, will upload a fix today.The triangles problem should also be much better, I pushed a fix yesterday. I just don't know if it's in the playground yet. Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 23, 2015 Share Posted January 23, 2015 My issue is in regards to instances, so hopefully these will be included as well as clones. If instances cannot be set independently, do they inherit their LOD info from the parent? This may be even better in my situation to avoid creating so many additional models. Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 23, 2015 Author Share Posted January 23, 2015 My question is - what do you define as the parent of the LOD Mesh? the original mesh from which the LOD was made, or the parent node (if exists) of the original mesh?The parent attribute of LOD levels is already being set, this why i assumed you mean the original mesh.What's currently missing is changing the scale, position, rotation etc' attributes of the LOD mesh to be equal to the original mesh's attributes. Will do that later on today.If I am wrong here, please show me an example so I can understand what you mean. Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 23, 2015 Share Posted January 23, 2015 Currently what I reported on was the parent of the LOD mesh (which in some cases is an instance mesh in my scene). My other question is if it would be possible to use the LOD mesh of the instance parent, but the scale, rotation and location of the instance so I'm not recreating the same LOD mesh for every instance. This would free up a lot of redundancy if it doesn't already work this way. Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 23, 2015 Author Share Posted January 23, 2015 If i understand your question correctly, you ask if you can take one mesh's LOD level and add it as another mesh's LOD level.The answer is yes, of course. It is just a mesh. If those LOD-parent meshes have different scaling (for example) you will have to clone the LOD mesh, change its scale (or any attribute you want) and add it to the other mesh as LOD level.It is technically possible, no need to recalculate 100 meshes, if they are the same. Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 23, 2015 Share Posted January 23, 2015 Judging by what DK said in a previous LOD discussion, all LODs should or will eventually follow instanced meshes back to their parents. So maybe my questions are moot points since based on that, if I instance a model, it will automatically have the LOD information. Correct me if I'm wrong in that assumption... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 23, 2015 Share Posted January 23, 2015 LOD and instances are working together http://www.babylonjs-playground.com/#1OIEW5 Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 23, 2015 Share Posted January 23, 2015 Thanks DK, I'll adjust my loader script accordingly and wait for the scale / rotation fix of the auto LOD Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 23, 2015 Author Share Posted January 23, 2015 Just checked it as well - http://www.babylonjs-playground.com/#2JBSNAI load a mesh, give it scale and rotation, create an instance with a new position and only then run the simplification. This seems to work with no fix needed.Maybe show a playground example of what is wrong before I fix something that's not a bug :-) @Deltakosh, any chance of deploying the new babylon.js file? the triangles fix is not yet in the playground. Quote Link to comment Share on other sites More sharing options...
reddozen Posted January 23, 2015 Share Posted January 23, 2015 Confirmed... I re-setup my test and it works fine... sorry about that Only other thing that would be nice is the LOD models in cache, but I know you mentioned looking into that at some point. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 20, 2015 Share Posted February 20, 2015 Why create copy objects when uses 'simplify'.When I look in DebugLayer this every time I create a duplicate of the object by adding 'Decimated' before the model name.So that augment the number of Draw calls and the number of models on the scene. This has no impact on performance in the end?I question only. I also find a bug. Certain object does not seem to be simplified.In made if he create the two simplification of a base object, but the object disappears in the first distance. Example:mesh.simplify([{distance:150, quality:0.9}, {distance:200, quality:0.8}, {distance:300, quality:0.5}]);The objects disappears to the distance 150. Subject simplify and three on the same number of poly.I can you send the model if you want. for testing. Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 21, 2015 Author Share Posted February 21, 2015 Hi dad72, as only one mesh is being rendered at the time, there is only 1 draw call per simplified object. The number of meshes however changes.There shouldn't be any impact on performance (well, there should - it should be better ). Please send me the models, would be great to check them! Make sure you are simplifying after the object was loaded, this is the problem I had with ground from height map. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 21, 2015 Share Posted February 21, 2015 Ok, I have you send the models by PM. Raanan thank you. Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 27, 2015 Author Share Posted February 27, 2015 Hi Dad72, as we already discussed the problem is that the mesh has submeshes. the algorithm was not created with that thought in mind. Wanted to give an update - I am working on improving the implementation to allow simplification of meshes with submeshes. I hope that I will finish in a day or two. It requires a bot more than simplifying the submeshes, as parallel processing of so many meshes will lower the FPS quite a lot. With that thought in mind, I am creating a "simplification queue" that will automatically process one mesh after the other. When I finish I will push it to babylon's github and hopefully babylon 2.1 will have submeshes support for the simplification functionality. Dad72 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 27, 2015 Share Posted February 27, 2015 Hi Raanan, I am delighted to hear that. Thank you for this wonderful functionality. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 2, 2015 Share Posted March 2, 2015 Hi Raanan, I saw the new work to support submesh, but it does seem to work. Total model disappears. The model I have you send through MP is always available if you want to test. And I notice that the first models on simplification (No submesh here) lacks full polygon. when I go to the 2500 => 2100 the half of the model disappears. Here in picture: No simplify (2500 verts) Simlifie (2100 verts) => mesh.simplify([{quality:0.9, distance:100}]); 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.