Search Unity

BooleanRT : Realtime 3D boolean operations for (Runtime,Editor)

Discussion in 'Assets and Asset Store' started by baha, Nov 2, 2012.

  1. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    Hello Everyone,

    I'm excited about the release of BooleanRT :D which is a real-time 3D boolean operations extension for Unity that allows you from executing 3D Boolean operations (Union, Intersection, Substract) during runtime or during level creation and editing in the editor’s sceneview, check it out in the following video:



    The extension provides the following functions:

    1- Real-time or per-click Boolean execution.
    2- Material, UV and texture preservation.
    3- Saving to prefab.
    4- Constructive solid Geometry (CSG).
    5- Smoothing of Boolean execution to keep smooth frame rates by splitting the execution of the Boolean operation over multiple frames.
    6- Optional updating of the collider.
    7- Creating a new mesh or overwriting existing mesh to affect all referenced objects.
    8- Optional smart execution by avoiding the calculation when not need (when there is no intersection or the operands are not being transformed.

    $inspector.png

    $0.png

    $2.png

    $3.png

    $4.png


    Can be found in the Asset Store for $35
     
  2. omarzonex

    omarzonex

    Joined:
    Jan 16, 2012
    Posts:
    158
    wow
    beautifull Coool
    are testing packageunity3d
     
  3. ecurtz

    ecurtz

    Joined:
    May 13, 2009
    Posts:
    640
    Just bought this, I've been waiting for somebody to do boolean operations!

    I'm getting invalid results if operand 1 is scaled, at first glance it seems ok if operand 2 is scaled.

    Edit: I'm also getting errors and large amounts of unnecessary new geometry for any meshes with more than a few hundred polygons. Shows a lot of promise, but I'm afraid this version won't help on my personal project. May still work well for other people, especially if you're dealing with simple primitives.
     
    Last edited: Nov 2, 2012
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Please don't post duplicate topics; it's against the rules. I removed the one in Showcase since Assets and Asset Store is the most appropriate category.

    --Eric
     
  5. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    Can you please send us an email to support@mixeddimensions.net so we can help out, or if you can send me the sample you are working with to take a look at.
     
  6. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    Sorry for that,didn't saw the rules before and it is ok to remove your post now since I saw it ;) you could've PM me though.
     
  7. zipper

    zipper

    Joined:
    Jun 12, 2011
    Posts:
    89
    Would have purchased if it came with source.

    zipper
     
  8. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    Maybe we will deliver the source in a future update, is it ok for you if I PM you in case we decided to ship the code?
     
  9. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,462
    Some questions:

    1. Is the source provided Yet?
    2. Will this work on complex mesh
    3. Animated Mesh?
     
  10. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    unfortunately not yet, we are thinking of releasing the source code but no promises yet!
     
  11. Drakorian-Labs

    Drakorian-Labs

    Joined:
    Feb 23, 2012
    Posts:
    88
    Hi,
    does this tool works at runtime or is it editor only?
    Thanks for your answer.
     
  12. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    For both, mainly for runtime.

    It works great with small meshes and very fast on them, the bigger the mesh the slower it will become.

    If you want more advanced toolset for the editor then you might want to take a look at gamedraw as it also contains Boolean operations.
     
  13. Drakorian-Labs

    Drakorian-Labs

    Joined:
    Feb 23, 2012
    Posts:
    88
    Thanks, so a couple more questions:
    -I see the tool creates a copy of the Operand B (named target mesh), is it possible not to have that copy and modify the Operand B directly?
    -Can i use a disabled mesh renderer as Operand A (i want an invisible mesh to create holes on operand b)?
     
  14. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    you can but you will have 2 cases, the first is that operand B will change thus each time it will apply on the new changed mesh, the second is that you can do it by code and temporarily store a reference to the original mesh so each time it works on the original mesh not to the modified one.

    yes you can
     
  15. PassivePicasso

    PassivePicasso

    Joined:
    Sep 17, 2012
    Posts:
    100
    Is Boolean RT no longer available to purchase separately from GameDraw?
    If so is there any documentation I can look at so I can analyze the value of the real time API provided by GameDraw and Boolean RT?

    I've been unable to find ANY documentation on either package, and this has been a major barrier for entry. As I can't test any of the features I want to use in the Free version I have no way to evaluate whether or not I can justify the cost of the package.

    I've already ran into this problem before, with unfortunately consequences, and I'd like to avoid it in the future.
     
  16. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Hi Baha,

    I need to do some in game realtime (no editor) boolean operation.
    Is your package able to do this?

    Kenshin
     
  17. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    i'm interested

    but why was booleanrt removed from asset store?

    also would be nice to have save to fbx so you can then later import it as a model?
     
  18. Michiko

    Michiko

    Joined:
    Apr 9, 2013
    Posts:
    3
    hi,baha ,the link is removed, MXD bundle is too much for me,I just need it ,could you please send me a BooleanRT link to buy? thx.
     
  19. Ging2020

    Ging2020

    Joined:
    Jan 15, 2013
    Posts:
    33
    baha ,Boolean RT is removed, this is bad news
     
  20. kasplask

    kasplask

    Joined:
    Jan 16, 2013
    Posts:
    11
    Indeed! I understand if you'd rather focus your efforts on GameDraw, and it is an amazing plug-in, but some of us are willing to pay for the boolean algorithms alone. You are robbing yourself by removing it from the Asset Store, mate :)

    I really need this thing for my project, so if you won't sell it, I'll spend the time to build it myself.
    And then I'll open source it :p
     
  21. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    I agree, I'd like to see a standalone package focused on realtime boolean operations. MegaFiers folks planned something like that, but they sure take their time developing it and it will probably be released as a part of some huge bundle.
     
  22. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    MXD Bundle will be on sale after ( <1 hour :) ) and the price tag will be less than BooleanRT if it was alone, MXDBundle contains (GameDraw,LightmapManager2,BooleanRT,MXD Edit and several other packages on the way) so I would rather pick that up :D

    Don't worry! we will have it back once we finish some major updates on our packages :) and hire someone to help in documentation and support.

    Ours is part of the MXD Bundle which will be on sale in less than an hour from now as I mentioned previously :D

    btw HUGE and important update is coming to GameDraw with a runtime API exposing most of the functions
     
  23. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    Great to hear, thanks! In the meantime, a question for you: how well can BooleanRT handle subtractions against cylinders, like that one?



    I'm planning to have level geometry as simple as possible and I don't need per-frame update of the resulting cut (the hole is made once and can be probably hidden from the player with smoke and other FX until it's calculated), but still, interested in potential speed. Any metrics, like time required to build geometry per certain amount of affected vertices?

    Also, how is texture mapping of the resulting cut handled? Triplanar? Or outward projection from surface normals of the object making the cut?

    Upd: The sale has started, awesome price you've got there!
    https://www.assetstore.unity3d.com/#/content/5674
     
    Last edited: Oct 29, 2013
  24. kasplask

    kasplask

    Joined:
    Jan 16, 2013
    Posts:
    11
    Baha, I am not seeing this amazing "sale" price you mentioned, it's still $75. If you mean that it was on sale _for_ and not _in_ less than an hour, then I was pretty screwed, as I live in Hong Kong and was dead asleep at the time :D I understand that BooleanRT will be back as a stand-alone module though, looking very much forward to that. Thanks for the replies.
     
  25. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    All Asset Store sales are 24 hours only, unfortunately. Whole bundle was going for 20$, quite a steal.
     
  26. eugene-bartosh

    eugene-bartosh

    Joined:
    Jan 13, 2013
    Posts:
    3
    Hi Baha,

    I would be quite interested to get just BooleanRT, because so far we do not need GameDraw and other stuff.
    Is this possible?

    Kind Regards,
    Eugene
     
  27. kasplask

    kasplask

    Joined:
    Jan 16, 2013
    Posts:
    11
     
  28. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    Thanks! it should work well and the texture mapping is based upon existing UVs, will try to get you some benchmarks!

    There is another sale coming up! wait for it, this time it is a bit longer ;)

    Thanks :)

    The sale is coming back soon so keep an eye on the asset store :)

    Noooooo worries, the sale is coming back!
     
  29. eugene-bartosh

    eugene-bartosh

    Joined:
    Jan 13, 2013
    Posts:
    3
    Many-many thanks, Baha! Great deal!

    Have just started with BooleanRT - very nice product, great work!
    And will try GameDraw one day also. Thanks again!

    Cheers,
    Eugene
     
  30. pateras

    pateras

    Joined:
    Jan 12, 2013
    Posts:
    50
    Hi. I have a few questions:

    1. Can boolean CSG operations be performed programmatically? I've seen in the BooleanRT demo video that real-time CSG operations are possible, but can this be done without the editor? We would like to specify the target meshes, and then allow the user to position the meshes to do a subtraction.

    2. Have the tools within the MXD Bundle been tested with iOS devices, and are there any other portability restrictions with any platforms?

    3. How long will the bundle sale be running?

    Thanks!
     
  31. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    1. Can boolean CSG operations be performed programmatically? I've seen in the BooleanRT demo video that real-time CSG operations are possible, but can this be done without the editor? We would like to specify the target meshes, and then allow the user to position the meshes to do a subtraction.

    Yes they can be done programmatically, we haven't done a proper documentation yet "I know, we are a bit behind :( " and it is designed to run without the editor, most functions can be done directly using the component or by manipulating the values of the component, the case you mentioned can be done.

    2. Have the tools within the MXD Bundle been tested with iOS devices, and are there any other portability restrictions with any platforms?

    Not all of them got tested on iOS but most of them are editor extensions and should run fine, booleanRT and LightmapManager 2 contains functionality that can be used on runtime but they are designed to work on all platforms, in general they should work and if you faced any issues we will provide the support needed.

    3. How long will the bundle sale be running?
    Till the mid of the month :)
     
  32. kasplask

    kasplask

    Joined:
    Jan 16, 2013
    Posts:
    11
    I can't be bothered to wait for that :)
    I looked through the code after I bought it, and this is how you do it (make sure to attach the BooleanRT component to a GameObject in the scene):

    Code (csharp):
    1. var nrt : BooleanRT = this.GetComponent(BooleanRT); // ...or whichever object it's attached to
    2.  
    3. // These are just a few parameters to set. Any other parameters will show up in MonoDevelop after typing "nrt."
    4. nrt.recalCollider = true;
    5. nrt.recalculateNormals = true;
    6. nrt.type = BooleanRTLib.BooleanType.Union;
    7.        
    8. nrt.obj1 = someTransform; // the transform of the first object
    9. nrt.obj2 = someOtherTransform; // the transform of the second object
    10.        
    11. nrt.ExecuteNow ();
    The plugin is working nicely, much appreciated!
     
    Last edited: Nov 5, 2013
  33. pateras

    pateras

    Joined:
    Jan 12, 2013
    Posts:
    50
    Thanks!
     
  34. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    Hmm unfortunately it didn't work as easily for me. I'm trying to do something similar except in C# and I have the following error:

    Code (csharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. BooleanRT.ExecuteNow ()
    Here's my code:
    Code (csharp):
    1. GameObject booleanRTGO = new GameObject("BooleanRT");
    2. BooleanRT nrt = booleanRTGO.AddComponent<BooleanRT>();
    3.  
    4. // These are just a few parameters to set. Any other parameters will show up in MonoDevelop after typing "nrt."
    5. nrt.recalCollider = true;
    6. nrt.recalculateNormals = true;
    7. nrt.type = BooleanRTLib.BooleanType.Subtract;
    8. nrt.obj1 = gameObject1.transform; // the transform of the first object
    9. nrt.obj2 = gameObject2.transform; // the transform of the second object
    10.  
    11. nrt.ExecuteNow();
    I'm also wondering where the resulting game object (or mesh) goes?
     
  35. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    Nevermind. I see from watching the video that the result goes to the object that has the BooleanRT component. I'm still not sure why my code wouldn't have worked then. I'm sure I'm missing something simple.
     
  36. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    So I got it working. But now I'm having another issue that I had with another Boolean operation product on the Asset store (I'm pretty sure everyone making these Boolean products are using the open-source CSG library and converting it to Unity). Basically I just have two cubes of equal size that are side by side, but slightly inside of each other only on one axis. So the same sized cubes but just +0.5 on the X axis. When I do Boolean subtraction you will see two extra planes on the top and bottom. I will post screenshots of this issue soon but is there any support for something like this? I bought this package specifically to fill this need and it's not working correctly so I'm not sure what to do.

    Here are screenshots as examples:

    $cube-subtract1.jpg $cube-subtract2.jpg
     
    Last edited: Nov 8, 2013
  37. testure

    testure

    Joined:
    Jul 3, 2011
    Posts:
    81
    Bleh.. I bought BooleanRT because it was a nice package at a reasonable price. now it's gone and the only option available is GameDraw that is $50 with a per seat license.. Guess I'll just have to do without.

    man I'm getting tired of seeing plugins switch to a per-seat license model. small indie teams can't afford to buy 6 copies of all of these various plugins... if I get a part time artist to help with my project, boom there's another license. A small 'after work' team is starting to become non-existent with Unity, and IMO that was the whole appeal of the engine. I understand that people need to make money- but IMO it's going the opposite direction. You're losing money because I'm not going to buy 6 licenses, I'm going to buy zero and just live without it, so you don't even get the one purchase. Eh.. just my rant i guess.
     
  38. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    Get the MXD bundle for $22.5 on 70% sale as it contains 7 packages including GameDraw and BooleanRT, how about that :)
     
  39. kasplask

    kasplask

    Joined:
    Jan 16, 2013
    Posts:
    11
    Same here. I am trying to do an Unreal-style boolean based level editor for my game, and this behaviour really makes that impossible. The fact that we have to break copyright law and decompile it just to address stuff like this is kind of baffling. But it's not stopping me :D I'll try to help debug this, even though...

    ...like this guy, I strongly disapprove of the license on this thing. No amount of sales can make up for that.
     
    Last edited: Nov 8, 2013
  40. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    I really feel with you guys, we can make it free but this means you will never see any updates at all and it will die, it will be the end because we need to keep living and to grow! even with this licensing we are not getting much unfortunately to date we have more costs than revenue but we are reaching the break-even point soon and hopefully then we can do more and give more value :D
     
  41. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    Can you send me the objects, need to go through a test case and your objects will be the optimal for it.
     
  42. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    Sent more info via email.
     
  43. testure

    testure

    Joined:
    Jul 3, 2011
    Posts:
    81
    i wouldn't hold your breath on a fix- i used redgate reflector on his DLL and it's pretty much a line for line port of csgjs with .net threading tacked on. On that note he's in violation of the MIT license by not including the original copyright of the library he derived from.

    sorry to call you out like that baha, but when somebody like evan wallace builds an awesome library and releases it with a generous MIT license and then somebody else comes along and ports it to C#, hides it behind a DLL, and then complains about not recouping 'development costs' as the sole justification for having a per-seat license while not even attributing the back he stood on to get to that point- I have a duty to say something.
     
  44. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    First of all you are not calling me out and it was an assigned task to one of the team so I will look into this, secondly the MIT license permit the use in proprietary software so will add the license to it "in case what you are saying is true" but still will deliver it as a DLL and yet we are not getting even appreciation for our hard work, please feel free to port that library, add editor functionality and components, threading and make it unity compatible and then release it for free, it's not making us food today and why in hell you need more than one license in the first place to use it, buy one seat and let one developer handle the code of boolean functions it is that simple, we are not asking for thousands of dollars, even more basic stuff are more expensive than what we offer on the asset store for GOD sake!

    btw you are violating the asset store license by decompiling and if you want to violate the per-seat license you don't even need to decompile the package, better yet go to some websites and you will find every single software on earth for you to download and use, it is up to you to follow licensing or not, to be legit or not.
     
    Last edited: Nov 10, 2013
  45. testure

    testure

    Joined:
    Jul 3, 2011
    Posts:
    81
    Don't get so worked up- perhaps my statement was not delivered tactfully. I'm not saying porting it is easy, I'm just saying that you need to attribute the open source software you used and that's it.

    I'm an old school advocate of OSS, and when I see people take things that were given away for free and turn around and sell them without even a 'thank you' or acknowledgment that they've done so, I feel the need to point it out. That type of behavior is damaging to the open source community, especially when an author goes out of his way to make something as unrestrictive as an MIT license and only asks for a simple acknowledgement. The reason I mentioned the license thing is simply because in my opinion- if the MIT license hasn't been respected in the creation of your plugin, how can you expect others to respect yours? I'm not trying to be combative, just trying to show the disparity here. And on that note- the asset store license stipulation revolves around reverse engineering and modification of compiled libraries- not "peeking" which is perfectly legal where I live (see section 6.1 of the asset store terms of usage).

    And on a completely different topic, I have not used any of your other plugins, so I cannot comment- but they look to be a great value for the number of features they provide. My only wish is that if you're using any open source derived content, attribute the authors- it's all they've asked for.
     
  46. baha

    baha

    Joined:
    Nov 2, 2009
    Posts:
    622
    Will have a talk with my colleague and will definitely do an attribution if that is the case and from what I see till now it is.
     
  47. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    Yeah the other package I bought used the same library and they were unable to fix it. Is this being looked into?
     
  48. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    So, I have just tried this package. It works with some relatively complex geometry, and I'm in no need to recalculate the results, which makes the delay is acceptable to me (a hole in a wall can be covered by glow/particles/whatever while the geometry is being generated anyway), so it works for the type of the game I have in mind.

    Now, I have encountered a serious issue with the normals/tangents, with them not being preserved properly from the source objects. Here are some screenshots with a more detailed description:



    Apart from that, I had a few questions.

    1. How should I go about applying subtraction operation repeatedly to the same mesh in a level? Let's say there is a big slab of concrete and a player wields a gun that carves tunnels in it (similar to depicted on a screenshot). What would be a good setup, scene hierarchy-wise, for that situation?

    2. What is the purpose of the Overwrite Mesh option? Surely it won't overwrite the source .fbx file, so what exactly is being overwritten there?

    3. How should I go about subtracting one operand (tunnel shape) against a scene comprised of multiple meshes? Let's say there are three buildings sequentially intersected by the tunnel mesh generated with the player shot. How should I organize the cutting in that case?

    4. Is it possible to run the calculation on a separate thread/routine (not sure what would be the right term) so that the player won't experience a complete halt of other gameplay systems while the result is being generated? I don't care if geometry generates for 5ms, two seconds or ten seconds, as the point of impact or the whole affected volume can be completely covered with outwards-facing glow, particle systems and other ways to conceal what's going on, but I don't want to encounter a situation where a player gets extreme performance drop whenever he shoots something.

    ▲ Update: That's what Smooth Translation option does, correct?

    5. Where are the resulting meshes stored? I'd like to implement a saving/loading system that will work without recreating every single shot ever fired and doing all calculations over, and that will require saving the results somewhere. I couldn't find that, as the inspector shows no mesh name and the project view highlighing system isn't picking up anything.

    ▲ Update: Oh, I see that the Save Prefab option outputs the mesh file: I can probably leverage that to save the state of the level.

    6. Are there any issues associated with creating the BooleanRT component on one of the operands instead of using a separate object? It would be easier to manage large multi-object levels without shuffling duplicates around, especially if I want one operand (for example, a building) to participate in many subsequent operations.

    Thanks in advance.

    __________________________________________

    [Update 2]: I think I have encountered a serious issue.

    The BooleanRT seems to generate quite a lot of completely unnecessary geometry around the cut. Is there anything that can be done to prevent it on the side of the scene setup, or it can only be fixed on your side by improving the code performing the operations? Take a look: the opening on the following screenshot is situated entirely within two polygons, yet tons of triangles are added on irrelevant surfaces all over the model:




    For comparison: same subtraction performed by SketchUp in a proper manner, without a single unnecessary edge created:



    Essentially I'm getting meshes containing more than 5000 polygons for shapes that could have been easily represented with under a thousand. The mesh from the screenshot above is merely 740 polygons, and even that is owing to curved tunnel shape, with the surface of the building using only 300 for the two intersections it gets. 5000 or even 8000 polygons I'm getting in the initial tests with BooleanRT aren't the end of the world for any modern PC, but thousands of unnecessary vertices being generated in irrelevant areas of the models have a pretty bad side effect: the mesh easily goes over 65k vertex limit after as little as 3-5 subtractions against a lowpoly tunnel. And the plugin doesn't seem to support multiple meshes per operand nor does it invoke the native Unity feature splitting such meshes into multiple pieces, so upon reaching this limit, whole thing fails completely, with the resulting mesh just disappearing. Here are some relevant error messages on that event:

    Code (csharp):
    1. Mesh.vertices is too large. A mesh may not have more than 65000 vertices.
    2. UnityEngine.Mesh:set_vertices(Vector3[])
    3.  
    4. Failed setting triangles. Some indices are referencing out of bounds vertices.
    5. UnityEngine.Mesh:SetTriangles(Int32[], Int32)
    6.  
    7. Mesh.uv is out of bounds. The supplied array needs to be the same size as the Mesh.vertices array.
    8. UnityEngine.Mesh:set_uv(Vector2[])
    Now, while multi-mesh operand support would be nice, I'd say the root of the problem, the reason why such a geometry appears so quickly in the first place, is the vertex spam depicted above.

    The problem is compounded when multiple subsequent subtractions occur, because even if a new tunnel goes through yet untouched surfaces of an object, those surfaces all over the model were already filled with unnecessary edges, thus forcing the new intersection to be even dirtier and higher in vertex count. The next intersection inevitably interferes with even more complex web of unnecessary edges, and so on. Obviously, that pushes the results to the vertex number limit even faster.

    As of now, this issue severely limits the applications of the product for destructible levels. I fully accept that performance requirements of a scene can rise as as the player adds more and more geometry to it as result of his actions, but it shouldn't break the system entirely or happen so quickly due to completely irrelevant surfaces being filled with new edges.

    I hope you will look into this problem.
     
    Last edited: Dec 11, 2013
  49. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    829
    When can I expect a reply about the issues outlined above? Or is this product no longer supported? In it's current state it's practically unusable.
     
  50. Leuthil

    Leuthil

    Joined:
    Jul 26, 2013
    Posts:
    97
    I take it these issues will never be resolved. If any one has a CSG operation asset that actually works let me know because every one I've tried so far from the Asset Store is using this open-source CSG.js library which clearly doesn't work with Unity and no one is able to fix it.