Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Automatic LOD - Create and manage LOD levels automatically

Discussion in 'Assets and Asset Store' started by UGTools, Aug 11, 2015.

  1. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello guys! we are happy to announce our new Unity extension, currently waiting for approval.

    Edit:
    Asset is now available at the Asset Store!: https://www.assetstore.unity3d.com/en/#!/content/43652

    Automatic LOD is a powerful Unity extension that allows you to quickly generate and manage multiple levels of detail for your 3D models.
    LOD levels are simplified meshes that are generated procedurally by the extension and help optimize your game especially on lower end platforms.
    The Automatic LOD component takes care at runtime of enabling the correct mesh for each object depending on its distance to the camera or its screen area covered. This way you can use meshes with lower polycount when the object is far away or covers small screen space and higher polycounts for up-close views.

    Features:

    • Generate LOD level meshes fully procedurally with just one click
    • Supports both static and skinned meshes
    • LODs are automatically handled by the component. No scripting needed
    • Build on top of our Mesh Simplify extension which is also included
    • Includes full source code
    • Includes high quality 3D models and sample scenes seen on the screenshots
    • Clean, easy to use and powerful UI
    • Valid for all platforms! Especially useful on mobile
    • Supports complex object hierarchies with sub-objects and multiple materials
    • Live preview both in edit mode and play mode
    • Supports both screen coverage and distance to camera algorithms
    • Allows finetuning assigning priorities to vertices using volumes
    • Classic mesh decimation / polygon count reduction using the included Mesh Simplify tool

    Demos:

    Windows: http://bit.do/baJRD
    Mac: http://bit.do/baJRQ

    Youtube video:



    Screenshots:



     
    Last edited: Aug 20, 2015
    Nikulenkov and Venryx like this.
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Hey UG - I didn't see any reference to texture level of details. Does Automatic LOD have ability to reduce the resolution of textures as well?
     
  3. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi there!

    For version 1.0 we centered our effort on geometry and reducing both processing time and bandwith use.
    Usually for textures the video card itself takes some good care about them using Mipmapping. Using mipmaps you don't need that much bandwith/memory and you have many more cache hits which really speeds rendering up.

    That being said, we are working on that for our next release. This has just begun :)
    Features we are looking for are:
    • Texture LODs. Be able to generate different texture sizes for each LOD.
    • Material LODs. Be able to generate materials with less texture slots and complexity.
    • Shader LODs. Be able to use simpler shaders on simpler LODs.
     
    Last edited: Aug 13, 2015
    theANMATOR2b likes this.
  4. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
  5. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Why should we use your LOD asset as opposed to the standard unity LODGroup component? The mesh simplification looks amazing, but what makes your LOD component better than Unitys?
     
    theANMATOR2b likes this.
  6. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    The company I work for bought this asset, and I do like it, and I see the use of it, it is definitely worth it! But, I find it is slow in the scene view, like very slow when I have 150 duplicated objects in the scenes. Why is this?
     
  7. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello there!

    I will check it out, it is probably the algorithm computing the screen occupation. Does it only happen in the scene view or also at runtime?

     
  8. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I will probably make a Unity LODGroup compatibility option in the near future. I wanted to have my own component because of flexibility and control, but as you can see the UI is almost the same so you don't have to get used to it. Right now it has a couple of options I was missing on the LODGroup but I definitely plan to give support to both as some people may be more used to the LODGroup.

     
  9. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Also, LODGroup was a Pro only feature when I started the development, and I wanted to give Unity Free support as well :)
     
    theANMATOR2b likes this.
  10. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Just in the scene view it is super slow, but also at runtime it adds an extra drawcall per mesh which is not usable for me. A compatibility option with Unitys LODGroup would be amazing, because this tool is great for doing all my lods in one place, just the LOD switcher component itself is not useful for me, I'd like to just use Unitys LOD component.
     
  11. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello!
    I will check first the slowdown and the extra drawcall, maybe they have an easy fix. Then how long it would take to support LODGroups, because I'm not sure if they work the same way in complex hierarchies.
     
  12. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Awesome! I appreciate the effort :) Cuz apart from those small problems, this is a solid product you have, looking forward to seeing how it develops
     
  13. FG_dev1

    FG_dev1

    Joined:
    Nov 3, 2014
    Posts:
    44
    I want to be able to pass in a Mesh object at runtime and then return a generated simplified mesh with a lower LOD based on some "factor" of detail. Is this possible with Automatic LOD?

    $90 is a lot to risk on 1 function from this asset.
     
  14. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi there!

    Yes you can, but if you just want to simplify a mesh at runtime and not use any LOD functionality at all you can use our Mesh Simplify asset which is 30$ cheaper :)

     
  15. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,654
    Is it possible to combine any skinned mesh with any other and still work as separate entities ?

    Also combine non skinned with skinned ?

    Thanks
     
  16. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    @UGTools

    Your Automatic LOD asset looks very awesome.
    Is Automatic LOD a super set of Mesh Simplify?
    Is there any function that Mesh Simplify provides, but Automatic LOD does not provide?

    I didn't see any API documentation for Automatic LOD on your website.
    http://www.ultimategametools.com/products/automatic_lod/help
    Is there any API that can be called in Unity editor or runtime?
     
  17. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, Automatic LOD is a super set of Mesh Simplify. Automatic LOD includes the full Mesh Simplify folder and uses its core to do the LOD simplification as well. There is nothing in Mesh Simplify that is not included in Automatic LOD.

    I'm still preparing the API documentation, but there is an API that can be called at runtime yes. In fact, if you download the demo you will see that the mesh simplification is done at runtime in the background (you can still move the camera while the progress is updating). This demo is included in the package so you can check the sourcecode and see how it is done :)
     
    Dan2013 likes this.
  18. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    Awesome. Thanks. I'll get the Automatic LOD.
     
  19. fishhead2

    fishhead2

    Joined:
    Mar 20, 2015
    Posts:
    1
    i use unity522p3 + automatic lod. (camera distance, prefab saved)
    lod tearing of the mesh appears when lod changing (it looks like vb, ib error)
     
  20. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Is it a skinned mesh? I've noticed this behaviour sometimes but it is quite erratic and can not be reproduced. I'm thinking it may be a bug related to switching a GameObject's mesh at runtime instead of enabling/disabling gameobject LODs.
    I will release a version enabling/disabling child objects so that this won't happen. Stay tuned :)

     
  21. Mr.Goldfinger

    Mr.Goldfinger

    Joined:
    Nov 30, 2015
    Posts:
    2
    I want to buy your Automatic LOD tool but I have a question in my mind. When I buy it, can I use Mesh Simplify without creating any LOD settings just like using only Mesh Simplify tool? Thanks...
     
  22. Haagndaaz

    Haagndaaz

    Joined:
    Feb 20, 2013
    Posts:
    232
    Yes.
     
  23. Mr.Goldfinger

    Mr.Goldfinger

    Joined:
    Nov 30, 2015
    Posts:
    2
    I have a problem with LOD's. I have an animated gameobject with skinned mesh renderers, when switching LOD levels it gives big artifacts for a short period of time. I tested on both PC and Android devices. I cannot use it like this please help me:(
     
  24. SuHwanK

    SuHwanK

    Joined:
    Dec 30, 2014
    Posts:
    43
    Hi,
    Can 'Automatic LOD' support Unity Version 4.6.1f1 ?
    My Project's Draw Calls is 2400.(FPS 10~20)
    If I use 'Automatic LOD', how more better?
    Thank you :)
    (my english is bad. sorry.)
     
  25. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hello,

    could you explain us what is better in this tool, why it is 3 times expensiver than Simple LOD? I already have Simple LOD, never used it for LOD levels, but I will use it at the end of the game project for performance optimization. I'am asking you, because there is nothing valuable on the level 11, except this asset.

    Thanks in advance for your answer.

    @SuHwanK: This tool simplifies the meshes, not the draw calls. 2400 draw calls are not much for PC, if you have high quallity meshes, then this tool can lower the video card load.
     
  26. SuHwanK

    SuHwanK

    Joined:
    Dec 30, 2014
    Posts:
    43
    Ops. my miss take, Draw Calls is not Mesh.
    Just Rendering Objects Count.
    So. I Can use 'AutoMatic LOD' in Unity 4.6.1 Version?
    Thank you :)
    Have a nice Day.
     
  27. nxtboyIII

    nxtboyIII

    Joined:
    Jun 4, 2015
    Posts:
    281
    Hi,
    does this work with lightmapping? Like if I have an LOD object will it lightmap all the LODs correctly?

    thanks
     
  28. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Hi @UGTools. I started using your LOD creation asset and I love it! :)

    I have met an issue though. And I hope that's something that can be worked out, or something I'm doing wrong. When I save my scenes (or even project), the editor freezes for 5-10 seconds and after that a window saying "Importing assets..." pops up, and after the progress bar reaches completion then it starts saving the scene/project.

    That's a pretty big issue because it really slows down my workflow (I save a lot). Would you have any idea what's happening, or a way to remedy that?

    I'm on Windows 8.1 and Unity 5.3.4.


    Well that was probably just a momentary issue; I closed and restarted Unity and no more waiting when saving! Which is excellent! :)

    EDIT:
    Another issue I noticed is if you use camera distance (rather than screen coverage) and change the distance to say 30 meters, then the LOD sliders in the inspector (other than LOD 0) all disappear. I have to manually re-set the distance to 1000 to move the sliders one by one to the left so they remain visible in the UI when the distance is shorter.

    Could it be possible to simply keep the LOD sliders proportional to the distance chosen, please?
     
    Last edited: Mar 25, 2016
  29. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    I'm also looking for information on the API. For example I would like to quickly apply some custom LOD creation settings to some models via editor code. How would I go about doing this?

    Another problem: it looks like the LODs work on the object I did it on, but all the other instances of that prefab in the scene disappear when entering game mode!

    This is what I see on the mesh inside the gameObject prefab I added the LOD component to:


    And here is how it looks like on one of the disappearing instances:


    It looks like all none of the instances have the LOD mesh information. Also please note I am NOT instancing the prefabs; those are already in the scene.

    I tried using the "Enable Prefab Usage" setting but it didn't seem to do anything (besides saving a file on the disk).

    EDIT:
    Alright, after more testing I found out that in fact you HAVE to use "Enable Prefab Usage", even if you don't instantiate prefabs at runtime (the documentation is a bit misleading about that I guess).

    So that brings me to a few more questions:

    1) What exactly is the asset file that's saved when you click on the "Enable Prefab Usage" checkbox?
    2) Where should I save it? Should I rename it to know exactly what it relates to? Should it be put somewhere special in order to work in a build (ie: Resources folder)?
    3) When I change the fbx model (ie: re-export it from Maya), do I have to delete this "Enable Prefab Usage" asset file? Or is it automatically replaced when I click on "Recompute All Meshes"?
    4) I tend to prefer using camera distance rather than screen percentage for driving the LOD switching. Is that okay in terms of performance?

    Unrelated:

    5) Is there a way to simply tell the LOD system to ignore a submesh altogether?

    Sorry for asking all those questions. Your asset is really neat and the poly reduction works brilliantly; I just need to understand exactly how it works to include it in my pipeline. :)
     
    Last edited: Mar 25, 2016
  30. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi Seith!

    I'm glad you worked your initial problems out. I already submitted a new version of the Automatic LOD which uses the original mesh for LOD0 (something a lot of users asked for and improves quality, memory usage and computation time).

    The .asset file contains all computed LOD meshes, if you click on the file on the project window you can check them out. The problem is if you don't save the meshes to disk using Unity's AssetDatabase API, other instances can't make references to it since they only exist as part of the original component. When that happens you will see all mesh slots that reference the original mesh will be empty. I added the Enable Prefab Usage parameter because saving to disk sometimes can be pretty slow so I don't want that to happen by default.

    You can save it anywhere but if you want to keep things tidy you can create a folder named LOD Meshes or something like that.

    If you change the fbx model use "Recompute all Meshes" again. This will overwrite (= update) the old meshes contained in the .asset file. If you delete the .asset file all references to it from other instances will be lost.

    Yes. Camera distance is even a little bit faster compute :)

    Yes, LOD panels on child objects have an option called "Exclude from LOD Tree" when you activate the "Override XXX settings" checkbox. Check it and it won't get processed nor switched at runtime. If by excluding you mean not rendering at all on some LOD level just use 0 vertices as target number on this same panel :)
    By default all sub-objects use the same settings as the parent. By clicking "Override XXX settings" you can use different LOD settings or even disable LOD on child objects.

    Hope that helps! No worries about asking many questions, I'd be glad to answer them all :)
     
  31. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Fantastic! Thank you very much for answering those questions! :)

    And what you said regarding the LOD0 answers another one I wondered: I was indeed puzzled by the fact that the LOD0 (which I thought was the original mesh) actually looked different from the original mesh! I absolutely agree that LOD0 should BE the original mesh and then LOD1 should be the first decimated version, and so on...

    Also, is there a way to create/update a LOD system via code? For example let's say I want to use the same settings on a bunch of models. I would like to avoid having to manually configure the whole thing for each model; I would prefer to use editor code to quickly set up the LODs (including saving the LOD asset files). How would I go about doing that? Is there an API documentation I could access? Thanks!

    Edit:
    One last thing: Unity's default LOD system offers an option to cross-fade between LODs so that the change is less noticeable. Is that something you would be willing to implement (I'm not even sure that's possible)?

    I also get a couple of error messages when I set the percentage slider to 0 (to completely hide the model in the last LOD):



    (There's no further info when clicking on the errors in the console)
     
    Last edited: Mar 28, 2016
  32. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello Seith,

    Indeed :)

    I provided support for multiselection and multiediting, so you should be able to edit multiple models at the same time provided they have the same amount of LOD levels.

    I will think about it, maybe as an option but in theory it would draw the mesh 2 times with alpha blending, which goes completely against improving rendering performance. Having it as an option could be interesting though, maybe considering shader variations would be the tricky part...

    Thanks for the heads up. I will try to reproduce it on my system and send a fix ASAP :)
     
  33. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    I agree about the potential issues regarding blending between LODs. This could prove to not be efficient in the long run. May not be worth implementing after all.

    Now I have some questions about the next release and what will happen with the existing LODs.

    1) Will the LOD0 be magically turned into the original mesh, or do I have to recreate all the existing LODs?
    2) When rebuilding LODs, are the disk assets updated automatically, or do I have to uncheck and re-check the prefab checkbox to force the recreation (overwriting) of the existing LOD asset files?
    3) I have access to the Advanced Tools Megapack (which you graciously offered to me); is that going to be updated as well, or did you only update AutomaticLOD on the asset store?
     
    Last edited: Mar 30, 2016
  34. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
    Is there a simple way to hook into the detail level change to disable other things like lights on the lower quality versions?
     
  35. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    I'm afraid you would need to recreate them
    In all cases, once they are created they are always updated so no need to manuall uncheck/check.
    I always keep the ATMP up to date with every release on all other assets :)
     
  36. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    No but that's a nice idea. How about exposing an event on the component so you could do something like:

    Code (csharp):
    1.  
    2. myAutomaticLOD.OnLODSwitch += OnLODSwitch;
    3.  
    4. void OnLODSwitch(AutomaticLOD automaticLOD, int level)
    5. {
    6. ...
    7. }
    8.  
    9.  
     
  37. KyleOlsen

    KyleOlsen

    Joined:
    Apr 3, 2012
    Posts:
    237
    That would be perfect.

    Another question I have is disabling renderers at their lowest quality. Currently I'm generating the lowest LOD level with 0% vertices, but it seems that it's actually creating a mesh with no data. Could Automatic LOD simply disable the renderer instead of generating an empty mesh?

    One more thing to mention is the mass creation of LOD levels. I modified the generation code to use the actual mesh GUID instead of the prefab's instance id. This allows prefabs that share meshes to use the same data for their LOD swaps, greatly reducing memory for levels that have lots of prefabs. I also made the mass LOD level saving work in a batch mode sort of way, so that when generating thousands of meshes I don't have to browse to the save location on disk and overwrite it. Just some thoughts to improve your amazing asset :)
     
  38. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    755
    Thanks! :)

    (And just so you know, I mentioned this asset in the latest Ghost of a Tale update)
     
  39. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,637
    When I use this my LODs flicker quite randomly and for about 1 frame I see a mess of polygons, not always even during the transition just any time. The models are skinned mesh characters from mixamo, anyone got any ideas how to stop this happening ?
     
  40. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,637
    Managed to get screenshots of my problem, every so often a frame looks like this

    https://dl.dropboxusercontent.com/u/4194619/Snap 2016-05-04 at 02.52.38.png

    then next frame is perfect

    https://dl.dropboxusercontent.com/u/4194619/Snap 2016-05-04 at 02.52.47.png

    Apart from that this asset is astoundingly easy to use and will result in some crazy savings in my game. I would also like to know if there is a way to list objects in the scene by amount of polys, this would be really helpful to know what to target with Automatic LOD.

    Thanks,
    Gaz
     
  41. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi radiantboy,

    Yes, I notified Unity since it seems to be a bug when changing the mesh at runtime on skinnedmeshrenderers. Since this may take a while I'm adding a new option to either a) Use mesh switches (which is how it currently works) or b) Create child objects and enable/disable them to switch between levels. Using b) would eliminate your problem and hopefully be a workaround until the bug is fixed.
     
  42. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Thanks for the idea! I will add a menu entry for that :)
     
  43. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,637
    Wow great, thats amazing, cant wait to get this working. Was about to yesterday when unity crashed and deleted my entire SSD drive from the system! Took 15 hrs to fix, but I will get back to the LODs now. I will put my review up to 5 stars as soon as I can get 1 guy LODed without the polygon soup as you called it :) Thanks for the support, and apologies if you got blamed for Unity bug.
     
  44. Rod-Galvao

    Rod-Galvao

    Joined:
    Dec 12, 2008
    Posts:
    210
    Does Automatic LOD work with Mesh Baker (or other mesh combine utility) at runtime?
     
  45. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes, it should work with anything that outputs meshes :)
     
  46. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi guys! I've submitted version 1.03 which fixes issues with LOD0 when vertex count is 100%. Now it uses the original object.
    I have been working lately on a fix for the polygonsoup thing which is a bug on Unity's side but found a way around it. It should be available soon as well :)
     
  47. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    By the way, those of you that have the Advanced Tools Mega Pack will have these updates as well. Currently I'm waiting for the approval.
     
  48. McSwan

    McSwan

    Joined:
    Nov 21, 2013
    Posts:
    132
    Hi,

    Has the flicker/polygon soup thing been fixed?
     
  49. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hi McSwan,

    I've uploaded a new version which hopefully fixes the issue. Check the readme file for more info.
    Please tell me if it worked! :)
     
  50. Griffo

    Griffo

    Joined:
    Jul 5, 2011
    Posts:
    700
    @UGTools

    Hi, what happening about this flicker/polygon soup as for me this asset is unusable in its current state ..

    Thanks.