Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Mesh Simplify - Quickly reduce polygon count on your 3D models

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 a new Unity extension:

    Edit:
    Good news! We have been greenlighted by the Asset Store.
    The extension is now available at https://www.assetstore.unity3d.com/en/#!/content/43658

    Mesh Simplify is a powerful Unity extension that allows you to quickly reduce polygon count on your 3D models using just a single click.
    Mesh simplification is especially useful when importing high resolution meshes or targeting lower end mobile platforms where low polycount is key.
    Our Automatic LOD package includes Mesh Simplify in its full extension, so if LOD management is required please consider getting our Automatic LOD package instead.

    Features:

    • Simplify / decimate meshes procedurally using just one click
    • Finetune mesh simplification using different parameters
    • Select mesh areas that should have less priority or more priority during polygoncount reduction.
    • Mesh simplifier supports both static and skinned meshes!
    • Includes full source code
    • Includes high quality 3D models and sample scenes seen on the screenshots
    • Clean, easy to use and powerful UI with multiediting support
    • Valid for all platforms! Especially useful on mobile
    • Supports complex object hierarchies with sub-objects and multiple materials
    Demos:

    Windows: http://bit.do/baJQL
    Mac: http://bit.do/baJQ3

    Youtube video:



    Screenshots:





     
    Last edited: Aug 19, 2015
  2. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
  3. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    382
  4. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,369
  5. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Yes! you can. Check it out in the video. It works with all kinds of meshes and setups :)

     
  6. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
  7. Xoduz

    Xoduz

    Joined:
    Apr 6, 2013
    Posts:
    135
    Is BlendShape data conserved after mesh simplification?
     
  8. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
  9. Xoduz

    Xoduz

    Joined:
    Apr 6, 2013
    Posts:
    135
    Sure. Sent you an e-mail with a basic human model with a single blendshape on it. After importing to Unity, increase the "Bloat" blendshape value on the character's mesh to make it appear... well... bloated :)
     
  10. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Not at the moment, but I think I will have it working in no time :)
     
  11. andyastro

    andyastro

    Joined:
    Sep 17, 2015
    Posts:
    16
    Very happy to find this asset at the store! I though of dropping by just to ask a quick question. Would it be possible to use your asset to erase interior parts of meshes? I have an application where big objects are generated procedurally, by aggregating other small prefab meshes. However, in the end, although I got fairly satisfactory results, I end up with plenty of vertices and faces inside the final object. I wonder if your tool would help me deleting those? Thanks anyway and congrats for the great asset.
     
  12. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Sure! If you check the video at 2:40 you can see how to assign priorities to vertices. In your case I would select all interior vertices and assign them -1 priority :)
     
  13. andyastro

    andyastro

    Joined:
    Sep 17, 2015
    Posts:
    16
    Wow, that sounds pretty awesome. And yours is a smart idea: I should go for a runtime simplification passed via script after my objects are procedurally generated and then set the priority of inner vertices to -1, right? I guess now the challenge is how to select inner vertices of objects procedurally generated objects, since they have random shapes. Do you think your asset has any tool that might help in that or would you recommend any other asset/script that I could buy together with yours so to achieve that? Many thanks for the quick and warm reply.
     
  14. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    That's a tricky part. There is a lot of literature about testing whether a 3D point lies inside an arbitrary mesh. A very common algorithm is described here: http://objectmix.com/graphics/13280...ide-mesh-intersectionlocation.html#post460971
    If you think about it, that solves your whole problem because you simply need to go through the mesh and eliminate those triangles that have one or more vertices inside the mesh :)

     
  15. andyastro

    andyastro

    Joined:
    Sep 17, 2015
    Posts:
    16
  16. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Version 1.01 has been submitted. Waiting for approval :)
     
    xxhaissamxx likes this.
  17. Deleted User

    Deleted User

    Guest

    Just bought it and found that it has issues with optimizing flat models. Try optimizing default unity's Plane mesh.

    Also here is my example model. It generates many wrong triangles when mesh is flat.
     

    Attached Files:

  18. DRIVER1ksa

    DRIVER1ksa

    Joined:
    May 29, 2015
    Posts:
    27
    i try it with unity4.3.3
    after use "compute mesh" the object come invisibile when run game
    any idea why this happen ?
     
  19. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Did you activate the "Enable Prefab Usage" checkbox? That will save your meshes to disk and enable instancing/prefabs
     
  20. DRIVER1ksa

    DRIVER1ksa

    Joined:
    May 29, 2015
    Posts:
    27
    yes i did
    after click save file with name mesh_CarStripe7828 in "Asset folder"

    i don't think it work because no file save in dir

    look

     
    Last edited: Aug 9, 2016
  21. DRIVER1ksa

    DRIVER1ksa

    Joined:
    May 29, 2015
    Posts:
    27
    i send to you multiple email even before buy
    but no respond

    if there no solution
    can i have refund ?
     
  22. UGTools

    UGTools

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

    I have no way to reproduce this on any computer. Could you send me your specs and Unity/Mesh Simplify versions?
     
  23. AgathaCrup

    AgathaCrup

    Joined:
    Jun 20, 2013
    Posts:
    22
    Hey guys, I written to you directly and on facebook, so this is my last try to get a reply on whether this will work with rigged morphed character meshes from Daz3d, I can supply an FBX if you need to check please let me know. Warmest.
     
  24. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Hello there!
    Sure, send me an .fbx to info@ultimategametools.com and I will check it out for you :)
     
  25. Archviz3d

    Archviz3d

    Joined:
    Apr 4, 2016
    Posts:
    92
    Hi!!!

    Your asset seems really great!

    But i wonder if it has, or if its possible to add something like paint weight, like there is in simplygon (user weights - where areas with one color will be more optimized, other areas painted with other color wont be optimized (keeping all the detail))?

    Check this video:



    I know from what i saw in your video that theres this sphere you can add that would do similar thing, but using it can be really tricky or impossible with some models!! So painting weights is the way to go...it would be awesome if i could bring some map with that info painted and/or i could paint directly on unity and your asset could support that!

    Its something also like instalod for UE4 has, called "Custom Vertex Weighting" i belieave

    http://www.instalod.io/#Features

    Thanks :)
     
    Last edited: Oct 4, 2016
  26. Ithkul

    Ithkul

    Joined:
    Apr 8, 2012
    Posts:
    21
    Did anyone get this to work with Unity 4.X ? I'm currently stuck on 4.6 due to the wide selection of old assets i'm using.
     
  27. M-Hanssen

    M-Hanssen

    Joined:
    Sep 8, 2014
    Posts:
    19
    Why is all mesh data persisted inside the scene files? This is very annoying when scene file size grows above 100mb! Is there another way to persist this mesh data outside the scene file?
     
  28. baroquedub

    baroquedub

    Joined:
    Aug 27, 2015
    Posts:
    11
    I seem to have the same problem as UGTools,: enable for prefab not working

    Using MeshSimplify, click enable prefab select folder and file name for .asset, change Vertex % then compute mesh. After 'Apply' on prefab, if I remoce the prefab instance from the scene and reinstantiate it the mesh is missing.

    Using Unity 5.4.3 on Windows7 64bit. v1.06 of Advanced Tools Mega Pack. (I did notice that on import UNity asked to update some scripts. Does the package need an update before it will properly support newer versions?)

    Any help would be much appreciated.
     
  29. Nasa13

    Nasa13

    Joined:
    Jul 1, 2015
    Posts:
    3

    Found the solution!

    1) Compute Mesh - first
    2) Enable prefab usage - second
    3) Save .asset
    4) Then you should make your object as prefab (that you compute)
    5) Save scene and should work...
    ====

    I dont know but there is no instruction about this im just found this because i make many test. Maybe its bug option?

    Want to know if will be in future fix of this and real instruction! Thx for attention!
     
    Last edited: Mar 15, 2017
    alexrau and jeromeWork like this.
  30. Nasa13

    Nasa13

    Joined:
    Jul 1, 2015
    Posts:
    3
    Best future if will be option auto save individual object (all object even children) on disk (no need prefab and etc. just compute new object and then plugin auto save in direction where original object but with add "OriginalName_SimplifyMesh).
     
    tcantr and jeromeWork like this.
  31. JonPQ

    JonPQ

    Joined:
    Aug 10, 2016
    Posts:
    70
    Hi, does this worked with blendWeight animated characters ?
     
  32. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Do you mean skinned characters? If so, yes
     
  33. JonPQ

    JonPQ

    Joined:
    Aug 10, 2016
    Posts:
    70
    Thanks yes. I meant characters are normally animated in 2 ways... bones, or MorphTarget animations. Does it work with both types, or only with boned animations ?
     
  34. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
    Not with blendshapes for example. I've tried to implement them but Unity just doesn't expose the necessary data through scripting. My guess is it is the same for your case, but I can try out meshes for you if you want. Just send them to info@ultimategametools.com :)
     
  35. JonPQ

    JonPQ

    Joined:
    Aug 10, 2016
    Posts:
    70
    ok no worries, thanks for your reply
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    854
    I'm looking for an in-editor solution to decimate my meshes for LODs. I'm using Mantis LOD currently, which works fine, except for the fact that it does not retain the mesh's normal directions. Which in my case are trees with modified normals, for shading purposes.

    Is Mesh Simplify able to keep, or reproject the normals onto the decimated meshes?

    What about uv2 and vertex colors, are those retained as well?

    These are some of the things I need, so I would be curious to know if this is the right tool for me ;)
     
  37. UGTools

    UGTools

    Joined:
    Oct 10, 2012
    Posts:
    738
  38. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    854
    Thanks! Will give it a try!

    Edit: Works perfectly! :D
     
    Last edited: May 23, 2017
  39. ikusia

    ikusia

    Joined:
    Oct 5, 2016
    Posts:
    2
    Hello, please tell me if your plugin works under uwp?
     
  40. dave-loper

    dave-loper

    Joined:
    Nov 10, 2017
    Posts:
    6
    @ug:

    So this function Vertex MinimumCostEdge() pops the vertex with least cost from the heap created in ComputeAllEdgeCollapseCosts() and in ComputeMeshWithVertexCount() we keep collapsing edges until the remaining vertices have a defined count.

    I like MeshSimplify, but I have one issue with it:
    I'd like to give it the maximal cost for collapsing an edge instead of a number of remaining vertices.
    Basically I need a function similar to ComputeMeshWithVertexCount(int numbOfVert) but called ComputeMeshWithMaximalCollapseCost(float maxCollapseCost)

    I though i can just check against the cost of the current vertex to collapse instead of the number of remaining vertices for determining termination. But I seem to miss something, because Debugging your code it doesn't look like MinimumCostEdge() even gets called once... what am i missing? Looking forward to your hint
     
  41. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,111
    2017.x supported?
     
  42. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    68
    @UGTools
    I get an Error message, any ideas:

    Error generating mesh: Object reference not set to an instance of an object Stack: at UltimateGameTools.MeshSimplifier.Simplifier.GetWorldVertices (UnityEngine.GameObject gameObject) [0x00110] in B:\Unity\UEBSimulator\Assets\Ultimate Game Tools\MeshSimplify\Scripts\Simplifier.cs:413
    at UltimateGameTools.MeshSimplifier.Simplifier+<ProgressiveMesh>c__Iterator0.MoveNext () [0x0003e] in B:\Unity\UEBSimulator\Assets\Ultimate Game Tools\MeshSimplify\Scripts\Simplifier.cs:132
    at MeshSimplify.ComputeDataRecursive (.MeshSimplify root, UnityEngine.GameObject gameObject, Boolean bRecurseIntoChildren, UltimateGameTools.MeshSimplifier.ProgressDelegate progress) [0x00282] in B:\Unity\UEBSimulator\Assets\Ultimate Game Tools\MeshSimplify\Scripts\MeshSimplify.cs:342
    at MeshSimplify.ComputeDataRecursive (.MeshSimplify root, UnityEngine.GameObject gameObject, Boolean bRecurseIntoChildren, UltimateGameTools.MeshSimplifier.ProgressDelegate progress) [0x002cd] in B:\Unity\UEBSimulator\Assets\Ultimate Game Tools\MeshSimplify\Scripts\MeshSimplify.cs:366
    at MeshSimplify.ComputeDataRecursive (.MeshSimplify root, UnityEngine.GameObject gameObject, Boolean bRecurseIntoChildren, UltimateGameTools.MeshSimplifier.ProgressDelegate progress) [0x002cd] in B:\Unity\UEBSimulator\Assets\Ultimate Game Tools\MeshSimplify\Scripts\MeshSimplify.cs:366
    at MeshSimplify.ComputeData (Boolean bRecurseIntoChildren, UltimateGameTools.MeshSimplifier.ProgressDelegate progress) [0x0000a] in B:\Unity\UEBSimulator\Assets\Ultimate Game Tools\MeshSimplify\Scripts\MeshSimplify.cs:241
    at MeshSimplifyEditor.OnInspectorGUI () [0x00a79] in B:\Unity\UEBSimulator\Assets\Ultimate Game Tools\MeshSimplify\Editor\MeshSimplifyEditor.cs:482
    UnityEngine.Debug:LogError(Object)
    MeshSimplifyEditor:OnInspectorGUI() (at Assets/Ultimate Game Tools/MeshSimplify/Editor/MeshSimplifyEditor.cs:507)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  43. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    68
    OK, this one is solved, a part of a mesh was missing,
     
  44. Slowbud

    Slowbud

    Joined:
    Jul 19, 2015
    Posts:
    68
    I found an issue where others might run into too since Unity 2017.3.
    2017.3:

    Graphics: Support for 32 bit Mesh index buffers:

    • By default, meshes larger than 65k vertices get imported with a 32 bit index buffer. Smaller meshes still use 16 bit indices.
    • Added Index Format setting to Mesh Importer to override this behavior.
    • Added Mesh.indexFormat to scripting API for Meshes created at run time.
    https://unity3d.com/de/unity/whats-new/unity-2017.3.0

    If you've got an > 65K 32 bit mesh and reduce it with Mesh Simplify below 65K poly, it seems to stay a 32 bit mesh. If you are using an other tool afterwards, which just can't handle 16 bit meshes, you may run in an issue. At current state this is just an assumption, but I'm working on to verify it.
     
  45. tareksalah

    tareksalah

    Joined:
    Jan 28, 2017
    Posts:
    16
    Hi UG Tools,

    I've just bought the asset and I'm facing some difficulty to have it run smoothly.

    I'm using it on this model
    and setting the vertex % to 90% - so only 10% reduction - results in having the model dissappear from the scene view as the newly generated mesh has zero number of vertices!

    I've used the script on other models and it works ... I don't know why it does that with this model.

    Thanks for your feedback
     
  46. tareksalah

    tareksalah

    Joined:
    Jan 28, 2017
    Posts:
    16
    Also I get this error when I use it on some models, although I'm using the script only on the object that has a mesh and I'm not checking the option Recurse Into Children as it's only a single object model.

    MeshSimplifyError.PNG
     
  47. modernator24

    modernator24

    Joined:
    Apr 7, 2017
    Posts:
    8
    Hi, I just used this asset and it's really cool. However after simplify, I loose all sharp edges. How do I fix this?
     
  48. Haleluya

    Haleluya

    Joined:
    Feb 24, 2015
    Posts:
    8
    Hi, I used this asset and it's pretty nice, but I got some black shape. How do I fix this?
     
  49. ZoiX

    ZoiX

    Joined:
    Feb 9, 2017
    Posts:
    7

    Did you guys solve it? Why @UGTools is not replying?
     
  50. modernator24

    modernator24

    Joined:
    Apr 7, 2017
    Posts:
    8
    @ZoiX Nope, no response from dev.