Search Unity

Cruncher - Polygon Reduction Plugin for Unity Pro

Discussion in 'Assets and Asset Store' started by bibbinator, Sep 4, 2012.

  1. unityasoft

    unityasoft

    Joined:
    Oct 28, 2011
    Posts:
    263
    HEY ITS MORNING HERE TOO! and i've already managed to make breakfast
     
  2. Pflugshaupt

    Pflugshaupt

    Joined:
    Sep 7, 2012
    Posts:
    35
    Hi bibbinator

    Great idea to integrate Balancer with Unity! It was an instant buy for me. I tried your plugin on several of my meshes last night and I have a couple of questions. Congrats on your work, I am getting good reduction results. Btw. I'm not interested in multiple LOD levels, just single mesh reduction.

    - For some reason I cannot start the reduction process on an object which is not linked to a prefab. Is this by design or is it a bug? From reading the manual I thought your plugin would create new objects/prefabs/instances automatically, but I can only choose the menu point if I have an instanciated prefab.
    - When reducing the polygons I get a new mesh inside my prefab (only doing 1 level...) - but it has the same name as the original mesh. Shouldn't the suffix be added to the mesh name?
    - I see that the process does preserve bone-weights, but does it also consider them during the simplification - meaning less simplifcation for areas where bone weights change a lot? Afaik Balancer itselt cannot handle skinned meshes/bone weights.
    - Can I somehow just store the generated mesh alone to disc? After generation it appears to be stored inside my prefab file. I'd rather have it in an independent file - one that I maybe could tweak again in my 3d software. If that's not possible now - are there any plans to have such an option?
    - Lastly - are there any plans to add a way to preserve parts of the model completely? For instants I have skinned character meshes with eyes and eyelids. During simplification I'd like those parts of the mesh to just stay as they are. There used to be an open source unityscript simplifier which had the option to select vertices to be excluded from simplification. A very nice option to have.

    My absolute dream way of doing this would be an asset post processor allowing to reduce polygons right after import - possibly with multiple settings per platform. Thanks a lot for making this plugin - a great step forward.
     
  3. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    Hi Pflugshaupt!

    Thanks!

    You can select a few different types, including model assets in your project folder. You don't need to instance the mesh first.

    No, the suffix is added to the prefab name, and the meshes follow the original mesh (unless multi-part) because you can have nested hierarchies of meshes inside, not just one. The idea is to mirror it as closely as possible so make it easier to understand and debug.

    No, simplification is based on eliminating one vertice at each step of decimation, ideally the one with the least impact on the mesh. UV seams/boundaries are preserved, and so is keeping the mesh manifold.

    At the moment no such plans. The plugin is designed to make it easy to get some performance wins through polygon reduction, and handling more complicated meshes.

    There is such functionality in Balancer and I would love to add this to Cruncher. The problem is simply one of how to author/specify which parts to lock. The easiest way I see for character would be to provide "lock maps" where I take the UV coordinate for the mesh and then lookup that coordinate in the lock map to see if the vert should be locked or not.

    Also, there is an API in Cruncher I haven't really documented yet, but is already exposed, whereby you can write your own scripts to use the Cruncher functionality. There's one beta tester that has done this already, but I just haven't documented it yet.

    Yes, I thought about this too. Cruncher seems easy enough and straightforward to patch into a post-processing event, but internally there's a lot of acrobatics Cruncher does to handle the myriad of edge cases arbitrary meshes present. Once more people have field tested it and it is rock solid, I'll probably experiment with the post-processor and batching.

    Thanks for your note, comments and suggestions, I appreciate it!

    Have a great weekend!
    Brett
     
  4. Crazy Robot

    Crazy Robot

    Joined:
    Apr 18, 2009
    Posts:
    921
    +1

    I could really use this feature. If it's at all possible I'd like to be able to open the resulting low poly model in my 3d software.
     
  5. Monoic

    Monoic

    Joined:
    Aug 23, 2010
    Posts:
    5
    Hi,

    Just bought Cruncher. This tool will save me quite a few hours of work, I think - need to experiment some more. However, what does "this extension requires one license per seat" mean? Do I have to purchase separate licenses for my Windows workstation and Mac?

    Also, I got a couple of issues:

    1) The quality settings keep resetting to full (1), whenever I run the included scene - shouldn't they remain at the selected level? The mesh seems fine.

    2) When I try to create more than one LOD version of the included dino, I get a stacktrace:
    IndexOutOfRangeException: Array index is out of range.
    CruncherEditorPlugin.CruncherConverterWindow.UpdateConversion ()
    CruncherEditorPlugin.CruncherConverterWindow.OnInspectorUpdate ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj)
    UnityEditor.HostView.Invoke (System.String methodName)
    UnityEditor.HostView.OnInspectorUpdate ()

    - and only one LOD dino is generated.

    Using Cruncher 1.02 on my Mac, Unity is version 3.5.5f3.

    Later,
    Claus Arwilk
    Arwion
     
  6. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    Hi Arwion!
    Yeah, it should remember your settings and reuse. Investigating that and the error message. Stay tuned.
    Cheers,
    Brett
     
  7. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @Arwion

    Okay the problem is pretty simple, and it's hard to believe I missed this before :-|

    I assume if you want to generate multiple LODs at once that you are selecting assets, not instances in the scene. I'm guessing you put your model into the scene and then ran the converter. Since it's an instance, and not an asset, it gets tripped up at the additional level of indirection and that causes the out of bounds array error.

    So the workaround for now is simply choose your model asset, then run the converter and all will be fine. The preferences will be saved correctly too. I will make sure this is fixed in the next release. I'm organizing and running a Unity game jam this week though and I might not be able to get this fixed until the weekend.

    Cheers,
    Brett
     
  8. Monoic

    Monoic

    Joined:
    Aug 23, 2010
    Posts:
    5
    Hey, thanks, I'm really good at making code go boom. ;)

    Didn't you work with instances in the Youtube videos? Anyway, it works fine when using assets, so I'm good for now. Enjoy the Game Jam - wish I could be there myself.

    Best regards,
    Claus Arwilk
    Arwion
     
  9. Nomad5oul

    Nomad5oul

    Joined:
    Aug 18, 2012
    Posts:
    24
    So until the fix is applied if generating multiple LOD versions of a model you need to use the tool on a prefab in the project directory rather than one you added into the scene?
     
  10. PrimeDerektive

    PrimeDerektive

    Joined:
    Dec 13, 2009
    Posts:
    3,090
    Is a reliance on the 3.5+ LOD system in Pro the only thing that limits this plugin to being Pro only?
     
  11. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @Arwion I did work with instances, but when I generated the multiple LODs it was on the assets if I remember correctly.

    @Nomad5oul Yep, that's correct.

    @PrimeDerektive No, the Pro only is because for performance the plugin is in native C++ compiled for Mac and Windows.

    Cheers,
    Brett
     
  12. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    I bought it today and I have to say that I am more then satisfied with the results!!

    But I'd love to be able to produce more then 1 lod stages for the instance in the scene.
    And it would be cool to have a checkbox to create a the lod group for this instance too.
     
  13. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @elias_t

    I'm glad you like it! I will add the ability to generate more than 1 LOD from instances to the list of things to do. I wanted to setup the LODGroup automatically but there wasn't an API for it. I'll have to check if that's still true in 4.0.

    Cheers,
    Brett
     
  14. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
  15. unityasoft

    unityasoft

    Joined:
    Oct 28, 2011
    Posts:
    263
    just here to give my consent, by saying THE CRUNCHER IS BEYOND AMAZING.

    WHY>

    Well ever wanted to use a dosch model in you're game but it turns out the res is too high?
    look no further... i simply import a model and lower the quality by about 5-10% i get amazing results and the model looks pretty much identical.
     
  16. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @elias_t I did not try that, thanks for the heads-up!

    @shifty Thank you sooo much for your kind words, it really helps :)

    Cheers,
    Brett
     
  17. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    Hi everybody,

    Reminder that I plan to raise the price of Cruncher to $200 starting October 1st.

    Cheers,
    Brett
     
  18. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    Ah, i just sent my paypal money to credit card....ah what a waste.
     
  19. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    You have at least 1 extra day. I couldn't log into Asset Store, plus I'll wait until all timezones have entered Oct. I don't know how long it takes the Asset Store to update the price. So no worries, I think it will take a day or two before it changes.
     
  20. reddotgames

    reddotgames

    Joined:
    Apr 5, 2011
    Posts:
    705
    amazing work - I'm wondering if your tool works better than polygon cruncher
    any chance for me to will send you some sample model and you will send me back results?
     
  21. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @reddotgames

    I would normally be happy to do that for you. I'm traveling though nearly constantly at the moment, busy giving Unity talks. I simply don't have the time to do it now, sorry. Maybe somebody else would be kind enough to do it meanwhile. Really, sorry I can't help you out at the moment.

    Cheers,
    Brett
     
  22. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    Hi what about a paint option to reduce polygons locally functionality ? I would love the ability to just paint on parts of the model where I want the reduction to take place. Ideally with wacom pressure support in order to give more control. I know this is quite a lot to ask, but thought it could not hurt to share my ideas :)
     
    Last edited: Oct 13, 2012
  23. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @Lars

    Actually, this is a really good idea. Cruncher does a great job of reducing polygons, but humans can do an even better job giving hints. And being able to mark off where to reduce and where not to, would be very cool.

    I would probably do something like red zones won't reduce, yellow is low priority, blue average (default would be whole model is marked blue), green high priority reduction area or something.

    That way you could edit a model and it's all blue, paint red what to avoid, green where to focus and yellow gives it a hint to avoid, but not lock.

    thanks for the suggestion!
     
  24. Batigol

    Batigol

    Joined:
    Oct 17, 2012
    Posts:
    234
    Great work. It will more nice to see it as plugin in 3dsmax :)
     
    Last edited: Oct 17, 2012
  25. janpec

    janpec

    Joined:
    Jul 16, 2010
    Posts:
    3,520
    There is Moo tools polygon cruncher which works great and also Pro Optimiser which works good too. Both for max.
     
  26. Mikie

    Mikie

    Joined:
    Dec 27, 2011
    Posts:
    367
    Hi Bibbinator,

    How do you compare your package to Daz Studio's decimator? Daz Studio is $100.
     
  27. artzfx

    artzfx

    Joined:
    Apr 28, 2008
    Posts:
    572
    Cruncher uses Balancer http://www.atangeo.com/ to crunch its polys. Balancer is a standalone app for 3D poly reduction outside of Unity. Looks like they have some discount offers currently http://www.atangeo.com/buy.

    I happily own both :) Great tools.
     
  28. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @Mikie

    I haven't used Daz Studio's decimator, but I guess they wold be very similar. The point of Cruncher though is to sit inside Unity and work with all your models. There's some planned features that will likely make Cruncher a better solution that other tools when it's released, but for now it's mostly the convenience of having it in the Unity editor.

    Cheers,
    Brett
     
  29. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    I have Decimator for Daz Studio and Cruncher for Unity3D...
    Both are great but :

    1) It's much better to work directly in Unity3D. Because you immediately can see the result into Unity and can change as often as possible until you have the right number of vertices... From Daz if you are disappointed with your decimated mesh, you have to redo all in Daz before exporting/importing again.

    2) The result of reduction of the vertices isn't similar with Decimator and with Cruncher. I have tried with the same model (the blob of my avatar !) and it is much better ("smoother") with Cruncher !!!

    3) Why use 2 softwares if you can use only one ??? :)

    6R
     
  30. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @p6r

    Thanks for taking time to offer some info on decimator and Cruncher, helpful for me too!

    One of the features I'm considering adding to Cruncher is a user suggestion to have the ability to "markup" a model by painting on it right inside Unity so that you can denote areas to emphasize or de-emphasize during reduction which will give a lot more control over the process. If I can get this added, I would think Cruncher would be a very versatile and valuable addition to any project.
     
  31. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    You're welcome...
    Your plugin is so fantastic : so easy to use and very efficient !!!

    Yes, the more features you add the more it will be useful and different from other plugins we can find in other softwares...
    So, Cruncher will be the best one !!! And within Unity3D !!! :)

    6R
     
  32. bigdaddy

    bigdaddy

    Joined:
    May 24, 2011
    Posts:
    153
    I really think Cruncher is going to be a heavily used plugin here.

    I'm having a problem, however, with weird artifacts showing up when crunching - I get a couple of triangles that extend out from the model. I get the artifacts even with a Target Quality of 1. I have a unitypackage of a project stripped down to just the essentials to show the artifacts; would it be possible to send you the package so you can take a look?

    Tom
     
  33. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @bigdaddy

    Uncheck "Mesh Optimization" and set Mesh Compression to "Off" in the model import properties. It's because Unity changed the underlying behavior of this and it's the driver stitching together tristrips which causes those weird triangles to render. This problem will go away in the future, nothing you need to worry about now, it's harmless.

    If for some reason unchecking the box and setting the compression to off doesn't work, send me a PM and I'll look at it.

    Cheers,
    Brett
     
  34. p6r

    p6r

    Joined:
    Nov 6, 2010
    Posts:
    1,158
    When you say "Would it be possible to send you the unitypackage ?", we don't know wo you ask !?! :)
    But I could test it for you if it can help you to improve your great plugin...

    6R
     
  35. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    The triangle problem is because Unity passes the driver the mesh to render. When there's a break in the tristrip, sometimes the driver will stitch it to the next one and that creates a visible distorted triangle.

    It's not a bug of mine and won't cause a problem. Just uncheck the Mesh Optimize and all will be fine (and setting mesh compression to none since I reprocess all the data anyway so it doesn't really do anything).
     
  36. unityasoft

    unityasoft

    Joined:
    Oct 28, 2011
    Posts:
    263
  37. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @shifty

    And the raw model, without any Cruncher added to it, doesn't do that? Or is the base model showing the same problem?
     
  38. unityasoft

    unityasoft

    Joined:
    Oct 28, 2011
    Posts:
    263
    No it works perfectly without cruncher, but once i apply just the script it does that on play
     
  39. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @shifty

    Which version of Unity are you using?
     
  40. unityasoft

    unityasoft

    Joined:
    Oct 28, 2011
    Posts:
    263
    I'm using 4.0 final 1 and cruncher 1.02

    Thanks
     
  41. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @ shifty, @bigdaddy

    I need you guys to help me check this more (and others too if you've seen this problem!) because I don't think it's my bug, but I could be wrong. To check:

    1. Click on the converted asset in the Project view and open the disclosure triangle.
    2. Click on each mesh inside there and examine it. I believe you will _not_ see the problem.

    This means that the mesh I converted is fine. I believe it's an editor rendering problem as that's where the problem shows. The only area that might be caused by me is bone weights, but I checked this carefully and all the data looks good. Plus, in the sample sent to me there is no bone anywhere near the stray vertice that could cause the problem. So it looks like the tristrip problem I described before.
     
  42. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    Okay, an update. I think it is my bug here. I reproduced a case where I can get it to fail.

    The problem is when the mesh isn't welded together and has bone weights. The bone weights need to be remapped when the mesh gets optimized. I remap the bone weights when a normal reduction occurs, but in the case where there are verts that should be welded together even with no reduction it fails.

    So the short term fix is to run "weld" on your models to eliminate needless vertices.

    I can prevent the error easy enough, but it might have some side effects. I need to look at this some more and will post an update here once I figure out the best solution. I'll try to basically do a first-pass remapping of the mesh before reduction and see if there's any issues with that.

    Cheers,
    Brett
     
  43. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    Hey all,
    I'm pleased to announce that there's a new version of Cruncher available, v1.03, that fixes issues seen on some skinned meshes. Please update to the latest version even if you haven't seen any problems with skinned meshes because it's possible that there could have been some problems that weren't necessarily visible.

    If anybody finds any issues, please do let me know.

    Cheers,
    Brett
     
  44. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    Hi everybody!

    Cyber Monday sale: Cruncher is 25% off this week!

    Cheers,
    Brett
     
  45. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Hi bibinator.
    Since the 1.03 update cruncher is not usable by me anymore. It does not even work on the dinosaur model.

    The plugin does not apply anything to the model and it spams the debuglog with the following error messages. (I have to close unity to stop it)

    I have unity3d pro 3.5.6f4 and winxp.

    $cruncher.jpg
     
    Last edited: Dec 4, 2012
  46. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    Hi guys,
    I released a new update v1.04 and it's live on the asset store. Please update you Cruncher and try it and let me know if it's working for you now.
    Cheers,
    Brett
     
  47. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    The new update seems to only support unity 4, which I don't have yet, is it possible to support unity 3.5.6 a little longer?
     
  48. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @Lars

    I fully intend to support Unity 3.x for the foreseeable future. I did test with both 3.x and 4.0. What's the problem you're seeing?

    Cheers,
    Brett
     
  49. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,524
    I think you uploaded the update with unity 4, which sets the required unity version automatically to 4 in the store, and does not allow to update when on older versions.
     
  50. bibbinator

    bibbinator

    Joined:
    Nov 20, 2009
    Posts:
    507
    @Lars

    Nice catch. I think that's new. I didn't think previously that the asset store tracked what version of Unity it was for. I'll resubmit a new version. Sorry for the trouble.

    Cheers,
    Brett