Search Unity

SimpleLOD user support thread

Discussion in 'Assets and Asset Store' started by Orbcreation, Nov 25, 2014.

  1. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    I'd also like to know if it works with 2017.x
     
  2. trilobyteme

    trilobyteme

    Joined:
    Nov 18, 2016
    Posts:
    309
    I use it quite a bit with Unity 2017.2.1 with no issues. I've done some basic testing in Unity 2017.3.x and 2018.1 beta and the things I tried worked as expected.
     
    henkjan, julianr and hopeful like this.
  3. henkjan

    henkjan

    Joined:
    Aug 1, 2013
    Posts:
    146
    Thanks! That's what I needed to know :)
     
  4. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Does anyone else get the situation where the merged normal atlas makes the character look corrupted? I usually have to remove the normal map. Any way around this?
     
  5. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    do you merge the child meshes?
     
  6. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101

    Yes, I created a merged mesh and then combined the materials into a single atlas and then used the Lod option to make lods with lodswitcher.
     
  7. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    The normal map would match the original created mesh. So it would look corrupted as it would be misaligned. Have you tried the Bake atlases option after? Then if it doesn't produce what you need, create a normal map after - which would be based on each of the LODs.
     
  8. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I think I created a baked atlas. I combined the textures into one after combining the mesh. However, after doing this, the normal map becomes pink. How do I create a normal map?
     
  9. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    You can create a normal map in Photoshop or Gimp art programs or there might be an asset in the store. I'm not sure there is an option on Unity by default as I normally create them using an art program.
     
  10. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    I've not delved into this at all, but I wonder if maybe this is some sort of formatting issue that could be resolved by playing with texture settings in Unity? Normal maps ought to be handled a lot like other textures in terms of atlas building, but they have some special rules, don't they?

    One old thread on a pink normal map issue suggests going to the texture and deselecting "normal map".
     
    twobob likes this.
  11. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    You also have to specify in Unity that its a normal map. Not a standard texture
     
  12. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Thanks for the tips. I tried them but it doesn't seem to fix it.
     
  13. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    So without the normal map its fine?
     
  14. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Yeah, what I usually do is just remove the pink normal map from the combined material. It's just unfortunate because certain models look much better with normal maps obviously.
     
  15. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    Google is your friend on this one... plenty of results for this, one of them may fix it.
    Link here for search results based on Pink Normal Map
     
  16. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Getting some strange results after upgrading to Unity 2017.3.1f1 (when I first bought SimpleLOD a month ago, everything worked as expected).

    Simple case: I create a cube in Blender, Subdivision surface to 16K verts and import as FBX to Unity. If I run SLOD on it, with 0-3 levels (LOD1 0.4, LOD2 0.8, LOD3 1, Small parts: 1, Steps 5, All other options at 1) I get the following when using option A (LOD Switcher)

    LOD0: 12404 vertices, 12233 triangles,
    LOD1/2/3: 8 vertices, 12 triangles (all the same!)

    What am I doing wrong?!
     
  17. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    So is this asset dead? :-(
     
  18. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    Have you used the support email provided with the asset? That's normally the best way to get support.

    @Orbcreation hasn't visited the forums for about 3/4 a year, according to the forum. He many not be getting notifications of posts to this thread.
     
  19. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Thanks - will try that now. Still a shame there's no user base. I'm not so happy if it's just me and the developer using it :)
     
  20. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    I'm using it actively. I just haven't updated to the latest unity version yet on my project.
     
    hopeful likes this.
  21. Artur7

    Artur7

    Joined:
    Nov 30, 2015
    Posts:
    34
    I have one question - let's say that my current level (basic city) is loaded whole into memory - it takes (along with all cars and peds models) around 1.2GB. If I use SimpleLOD to create only nice looking buildings around the player, and rest of them will be LODs, and still load everything to memory at once, will it reduce memory consumption?
    For my first thought I would say that it will enlarge memory usage cause all LOD models + normal ones will have to be in RAM. But it is just my thinking, can somebody explain? Thanks :)
     
  22. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    Im pretty sure you are correct in thinking that your total memory usage will actually be larger(depending on how your lods use textures).. But you will benefit with less drawn textures and triangles through gpu /cpu. This is where some sort of scene streaming system would be useful to load /unload unneed assets.. But would love to hear others opinions on this.?
     
  23. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    While there can be a LOD solution that reduces memory, I don't think that is the standard implementation. Usually all the textures and meshes for the LODs are all in memory at the same time, enabling the LOD transitions to happen fast. Where LOD saves is on frame rate, by reducing GPU load.

    Ah, I see @JBR-games is responding a little ahead of me. :)

    You'll have to think a lot about how you want to reduce memory; specific solutions for your game. A typical tactic is to re-use a lot of the same textures, and maybe combine the most frequently used textures into either an atlas or a texture array, and thus keep draw calls low. Textures are typically the biggest memory pigs.
     
    JBR-games likes this.
  24. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    A little input from how I do it.. I use SECTR stream to stream in chunks with a region loader on the player, which means when the player is in range it will load in the full building with the LODs, you can also go a step further with interiors by loading them in as and when you need them. With SECTR stream you can also add a proxy mesh which is a lower poly version of your building, it will leave it there after unloading the full chunk with the LODs, so you still have a building presence that is of good quality. I am currently trialing Amplify Impostors so I can take it a stage further to increase performance by having a 360 degree impostor image for greater distance buildings (not ideal up close) - but for that it will require me to make a code change to remove or deactivate the Proxy mesh.

    I use Simple LOD to create a Simple Mesh for the Proxy.
     
    Last edited: Sep 2, 2018
    jeromeWork, hopeful and JBR-games like this.
  25. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    @julianr Very helpful, thank you. That SECTR usecase is very much what I'm wanting to do. I've also been looking at WorldStreamer as an alternative (it also does ring streaming of low poly versions of distant meshes).

    Before I buy, I'm wondering whether it's possible to replace the highest LOD created by SimpleLOD with an Amplify Impostor. It's unclear from asset demo on the asset store whether SimpleLOD uses Unity's LODGroup or if everything handled by the LODSwitcher script. Do the two assets play nicely together? (Amplify on their asset description state that it can be used with 'any third-party LOD system'...)
     
    julianr likes this.
  26. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Not sure how amplify imposter works but you can use lod groups with simplelod.
     
  27. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    You can insert an imposter as a LOD in Unity LOD Groups, or have it on its own as a gameObject that you can set active.
     
  28. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    While I've not used the LOD aspect of Simple LOD, I've used SECR LOD and Unity's LOD system which works with Amplify impostors. So it should work. I also have World Streamer but it was way complicated to setup (not sure if they've improved it) but just couldn't get my head around it, where SECTR stream was more visual and GUI based. Developer of Gaia has recently acquired SECTR.
     
    jeromeWork likes this.
  29. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Should work fine then. Just create a parent object with an lod group and put simplelod objects as lod 0, 1, 2, etc. and the imposter object as the final lod before culling.
     
    jeromeWork and julianr like this.
  30. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    Thanks @Rajmahal and @julianr . Got a recommendation for Simple LOD on a dev discord. Been slightly struggling with the overly complicated workflow of using MeshBaker and the mesh decimation from Advanced Tools Mega Pack. Slightly put off by the age of the asset, a possibly missing dev and asset store comments about it not working "in latest Unity versions"... But with you guys so helpful on this forum I may well take the plunge. :)
     
    julianr likes this.
  31. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Using simple lod ver 6.0

    Have a weird child merge mesh issue shown in the image

    Note that Bottles_01_2_LOD0 which is highlighted does not get merged.

    The Merged part 1 and 2 game objects contain all the other meshes under LOD0 correctly.

    I think this is a bug. Can the author please look into the boundary conditions where part meshes are generated.

    Update
    ======================

    Debugging the problem it seems if the last object mesh vert count fits inside the limit (65535) but there was objects prior to this that did not fit then the error occurs. So its definitely a bug in the algorithm.

    e.g. if the Cocktail_01_x were moved to the top of LOD0 then it would merge correctly.

    So to fix this in GameObjectExtensions.cs

    Modify Line 501 to 533

    Code (CSharp):
    1.                 } else if(meshRenderers != null && meshRenderers.Length > 0) {
    2.                     //int counter = 0;
    3.                  
    4.                     foreach (MeshRenderer meshRenderer in meshRenderers) {
    5.                         if(lightmapIndex<0 || meshRenderer.lightmapIndex<0  || meshRenderer.lightmapIndex>253 || lightmapIndex == meshRenderer.lightmapIndex) {  // only merge objects with the same lightmapIndex
    6.                             MeshFilter filter = meshRenderer.gameObject.GetComponent<MeshFilter>();
    7.                             if (filter != null && filter.sharedMesh != null)
    8.                             {
    9.                                 if (filter.gameObject.activeSelf && vertices.Count + filter.sharedMesh.vertexCount <= 65534)
    10.                                 //if (meshOffset <= counter && vertices.Count + filter.sharedMesh.vertexCount <= 65534)
    11.                                 {
    12.                                     bool allSubmeshesMerged = MergeMeshInto(filter.sharedMesh, null, meshRenderer.sharedMaterials, vertices, normals, uv1s, uv2s, uv3s, uv4s, colors32, boneWeights, bones, bindPoses, subMeshes, ((filter.transform.localScale.x * filter.transform.localScale.y * filter.transform.localScale.z) < 0f), meshRenderer.lightmapScaleOffset, filter.transform, topGO.transform, filter.gameObject.name + "_" + filter.sharedMesh.name, skipSubmeshNames);
    13.  
    14.                                     if (allSubmeshesMerged && filter.gameObject != topGO)
    15.                                     {
    16.                                         filter.gameObject.SetActive(false);
    17.  
    18.                                         // Also disable parent (go's with meshes often have empty parent transforms that we dont need anymore)
    19.                                         Transform parentTransform = filter.gameObject.transform.parent;
    20.                                         if (parentTransform != null && parentTransform.gameObject != topGO)
    21.                                         {
    22.                                             parentTransform.gameObject.SetActive(false);
    23.                                         }
    24.                                     }
    25.  
    26.                                     meshOffset++;
    27.                                 }
    28.                  
    29.                                 //counter++;
    30.                             }
    31.                         }
    32.                     }
    33.                 }

    Thanks
    Mark

     
    Last edited: Oct 14, 2018
  32. WarpBubble

    WarpBubble

    Joined:
    Dec 4, 2013
    Posts:
    33
    Hey folks, I noticed a couple of bugs I thought I'd mention for the developer's and others knowledge...

    The LODSwitcher.cs script initialises int lodLevel as -1, this is the same value used when a renderer should be disabled because it is outside of the "deactivateAtDistance" range. The result is, if you begin your scene outside of that range from any gameobjects, they think they are already disabled and so stay enabled. To fix this just change the initialisation of lodLevel to any other negative value, e.g. private int lodLevel = -2; (Found at line 25 and for some reason also under Start at line 45).

    Additionally, when using child objects for your LOD models with LODSwitcher.cs, again with the deactivateAtDistance option, instead of disabling the gameobjects (or even just their renderers) when outside of the deactivateAtDistance range, the script still only disables the MeshRenderer in the parent transform, which is irrelevant because it doesn't contain a mesh when using child objects. I haven't made a fix for this one yet, just mentioning it so people are aware.
     
  33. KingLlama

    KingLlama

    Joined:
    Jul 18, 2015
    Posts:
    199
    Any idea if you'll make it work with 2018 unity?
     
    Arkade likes this.
  34. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    @KingLlama Sad to say the asset now shows as deprecated and is no longer available from the Asset Store. So my guess is not :(

    Very sad to see it go as it's become by far my favourite optimisation utility.
     
  35. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Anyone any ideas what led to it's deprecation?
     
  36. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    429
    I contacted the developer in Oct after purchasing the asset and had a couple of issues with it. He replied "There'll be an update for SimpleLOD soon that addresses these and a few other issues" but the update never came, and now this deprecation. I've emailed him to ask, but sadly these things happen. Sometimes developers get ill or have a family tragedy and just go off the map. He didn't come across as one of those unscrupulous developers who would just ditch an asset for no good reason, so I'm giving him the benefit of the doubt :)
     
    Arkade likes this.
  37. Arkade

    Arkade

    Joined:
    Oct 11, 2012
    Posts:
    655
    Agreed. He seemed like a nice guy when I interacted with him a little years ago when I bought the asset. Here's hoping everything is ok!

     
    JBR-games and jeromeWork like this.
  38. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    That's depressing. I love this asset and depend on it heavily. Hopefully, it continues to work for a long time.
     
  39. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    As it's depreciated, I've taken the time to edit the title so people don't get too lost. Hopefully Unity comes up with a native solution in 2019.
     
    JBR-games likes this.
  40. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Thank you.
     
  41. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    ya, also need to remember they cant give it out for ever, if they don't make money, its like your working for free. so this happens a lot in the asset store they stop making any money and drop it after awhile. Some will release a paid update to fix this issue, but some people throw fits over it..Well, again, they dont want to work for free, and I don't blame them. SO I bet this happen as Simple LOD has been around awhile.. he may have gotten busy.. with work that makes money.

    anyways, it still works . I tested it . so for those wanting to use it , should be able too.
     
  42. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    It could be an auto-deprecation by Unity, pending an update. (?)
     
  43. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,683
    Aaaand it's back, and with an update featuring improvements! :D

    Version 1.6.

    - Atlas resolution would automatically be set to the size of the resulting texture, which would limit the size of the atlas when you added the next.
    - Added a slider under "more' to boost the compression. It is essentially a multiplier for the compression sliders for LOD 1-5. Setting the multiplier to 10 and the compression to 3 would result in the a compression value of 30.
    - The decimation algorithm has been changed to further prevent the creation of holes in decimated meshes. This would typically occur in flat shaded meshes, meshes created with Mesh Materializer and meshes with only a few vertices.
    - Creating LOD levels and using an LODGroup to control them would change the hierarchy by creating a new stand alone gameObject. It now moves this new gameObject under the previous parent and preserves the hierarchy
     
    recon0303, JBR-games and Rajmahal like this.
  44. Rajmahal

    Rajmahal

    Joined:
    Apr 20, 2011
    Posts:
    2,101
    Awesome. This guy is a legend.
     
  45. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    nice to see it back. :) and a update to boot.
     
    red2blue and JBR-games like this.