Search Unity

[RELEASED] Realtime CSG - level design for Unity

Discussion in 'Assets and Asset Store' started by LogicalError-Unity3D, Aug 24, 2016.

  1. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    @cjacobwade sorry for the late reply! Things have been super busy for me lately.
    Is there a way to use Unity's built-in rotate and scale tools for an entire brush without having to do additional selection
    I'm not sure what you mean with additional selection? In object mode, yes, with rotation the edge selection is the only way at the moment (sorry). As for scaling, you should be able to easily scale the entire brush in object mode when using the rect tool for instance ... no selection of vertices necessary

    Is there a way to vertex snap brushes to vertices on other brushes (as is the default when you hold V before clicking an object)?
    Sadly, no. Chisel (realtime-CSG's successor) is planned to have this though

    Is there a way to surface snap brushes to the surface behind your mouse position including other brushes (as is the default when you hold Ctrl + Shift before clicking an object)?
    I'm not entirely sure what you mean here? You already mentioned the ctrl+shift dragging, which is what I think of when you say "Is there a way to surface snap brushes to the surface behind your mouse position", so I'm not sure what you mean..


    Edit/Shortcuts doesn't exist in all versions, realtime CSG development started in 5.3 and still supports a lot of older versions. Hopefully at some point I can deprecate some older versions so I can remove some old stuff and replace it with new stuff.
    Chisel, realtime-CSG's successor that's in the work, will have 2019.1 as the base version and uses the shortcut manager


    @hippocoder yeah, 2020 is not yet supported since it's in alpha mode. The offset is likely because of sceneview.position returning a different window size than before, which has _never_ properly reflected the actual size of the sceneview area .. but you already know that since we talked about this on the discord :)
     
  2. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    82
    Is Chisel equivalent to Realtime CSG 2 with run time support and the other improvements that have been in the works for awhile?
     
  3. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    @PartyBoat yes, I've teamed up with the SabreCSG community, and we're working on an open source realtime-CSG successor called Chisel
    The link to the Chisel discord is here: https://discord.gg/zttNkPQ

    I've been working on a new CSG algorithm for a long time now, that will be part of Chisel. It's written in C# and can work at runtime and will work on any platform
     
  4. cjacobwade

    cjacobwade

    Joined:
    Jun 8, 2013
    Posts:
    6
    @logicalerror appreciate the response. Looking forward to Chisel!

    'Additional selection'
    Here I was referring to having to mouse over an edge as additional selection. Hopefully there can be an option to use the regular rotation tool in the future!

    Regarding scaling by using the Rect Tool
    I'm on 2019.1.14f1 and seeing when Realtime CSG is active the regular scale and rect tool aren't available (pressing the shortcuts has no effect).

    'Is there a way to surface snap brushes to the surface behind your mouse position'
    This is referring to the surface snapping you can do by holding Ctrl + Shift and dragging something around, which aligns the transform pivot to the surface under your mouse. It's similar to vert snapping but uses the object pivot instead of vert aligning.
     
  5. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    Stardog likes this.
  6. anton88pro

    anton88pro

    Joined:
    Jul 20, 2017
    Posts:
    39
    Hi!
    Why is it free now? Are you abandoning this asset development or is there still business model behind it?
    I was checking your asset for a long time now, so I was shocked when I didn't see the price tag these time. I'm happy of course, I can try it now, but also a bit worried.
     
  7. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,471
    If you read above... he is working on another project (Chisel) that will be better than RealtimeCSG in the future... until then people have this for free now. Can't see what business model is for it, its just being made free and open sourced so people can learn from it or contribute any fixes.. as his time is better invested in Chisel... no point in selling something you see less reason in fully supporting anymore. Think more asset developers should consider the same if they no longer have time for the asset (many do though actually)
     
  8. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    @anton88pro I'm still supporting Realtime-CSG, but not going to add more features to it (although I will keep accepting PRs on github). Like @Player7 mentioned, I'm working on it's successor Chisel which is also open source, together with the SabreCSG community.

    The plan is that there will be a path to import Realtime-CSG created content into Chisel.
    One of the reasons is that I've regretted some architectural decisions in Realtime-CSG & it was only possible to fix those by rewriting a very large chunk from scratch. At that point it made more sense to have this be a separate project, otherwise I'd have to maintain two code bases that at some point needed to converge.

    I made it open source because, frankly, I wanted help with these projects since they take a lot of my spare time and there's still so much more I still want to do on these tools that I never have time for.

    However, if anyone feels inclined to support my efforts (esp since I gave up my sales), I set up a github sponsor page here: https://github.com/sponsors/LogicalError
    Note that github will match any contribution in the first year :)
     
    anton88pro and Falagard like this.
  9. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    67
    Is there no way to instantiate a prefab of a CSG mesh at runtime? No matter how I try to do it, they always lose the reference to the mesh unless they were in the scene before the game starts for some reason.

    I'm using 2019.2.6f1.
     
  10. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    @Lork So I'm not entirely sure how much you know about how realtime CSG works, and I'm not sure what you mean with mesh (since different people might mean something different when they say "CSG Mesh")

    So just to make sure we're on the same page, let me explain:
    The model creates Unity meshes and puts them into meshrenderers that are hidden (but can be optionally shown with a property in the CSG Model called "Show Meshes")
    At build time all the models, brushes, operations are removed because realtime-csg doesn't work at runtime, only at editor time. But the MeshRenderers with the meshes remain.

    So if you knew all this, how are you referencing this mesh? and are you talking about a MeshRenderer or a Unity Mesh? or do you mean a reference to the gameobject holding a CSG model?
     
  11. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    67
    I'm talking about the generated mesh(es) that are used by the MeshRenderers, Colliders, etc. I've tried: the whole CSG model, the provisionally generated meshes (from the show meshes option) and the exported Unity mesh (I know the documentation says this method doesn't work with prefabs, but I had tried everything else I could think of).

    All three of these work if you save them as prefabs, place them in a scene before runtime and then hit play, but if you instead hit play first, then drop them into the scene or instantiate them via script, the references to the generated meshes are lost and the various components throw null reference exceptions.



    I've also tried exporting to an FBX file, and in that case the mesh survives, but the texturing doesn't.
     
  12. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    @Lork Are you using the asset store version, or the latest github version? There have been some prefab related fixes in the latest github version. Not sure if it might be related to some bugs I already fixed
     
  13. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    67
    I'm using the latest (as far as I know) github version.

    Edit: I'm able to reproduce it in an empty project with Unity 2019.2.13f1. Create a simple CSG model and save/export it as a prefab, then hit play and drag the prefab into the scene - the generated mesh will disappear from all the components that reference it.
     
    Last edited: Nov 26, 2019
  14. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    @Lork what happens when you open up that prefab in isolation mode & save it first?
     
  15. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    67
    That fixes it, thanks!
     
    logicalerror likes this.
  16. anton88pro

    anton88pro

    Joined:
    Jul 20, 2017
    Posts:
    39
    I got glitchy cylinders.
    Seems like whenever I create a cylinder with high amount of sides it makes a very glitchy looking mesh. The glitch look becomes even stronger when I try to use manipulation (like subtraction cylinder inside another cylinder or a box).
    I also don't want to have a cylinder with a small amount of sides, as it doesn't look smooth enough.
    I'm using Unity 2019.2.10f1
    I tried pressing "rebuild your CSG meshes" button, reopening Unity, but it didn't help.
    Screenshots are attached.
    ex1.png ex2.png ex3.png
     
  17. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    @anton88pro Hmm .. that looks like a quantization effect, I'm guessing your transformation position is a fairly high number?
    Can you send me that part of your scene so I can take a look at it? thanks
     
    Last edited: Dec 2, 2019
  18. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
  19. anton88pro

    anton88pro

    Joined:
    Jul 20, 2017
    Posts:
    39
    I've created new scene to test it and glitches are still here. Scene file:
    https://drive.google.com/open?id=1pbaDy_QwipcfmmtVHBnhqxgK0InLPOlF

    One more bug report. Here in the screenshot in two upper windows the CSG UI looks out of place. It gets back into right place, when the related window is focused again. Is there way to fix it? This bug is present in all of my scenes.
    Снимок экрана (942).png
     
  20. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    Hi @anton88pro I have a fix for the precision issues on the github repository of realtime-csg
    The other problem you mentioned was already fixed there
    I'll publish this version on the asset store after I've fixed a prefab related issue
     
    anton88pro likes this.
  21. nikitatishin5

    nikitatishin5

    Joined:
    Nov 10, 2019
    Posts:
    1
    Hello!
    I really apologize if I missed some details, but I won’t sleep peacefully if I don’t ask. Is it possible to use CSG during program execution? (My graduation project is dedicated to creating a digitalized VR simulator for a stamotologist, if I don’t find a way to “drill” then I’m done =))
     
  22. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    Hi @nikitatishin5 , realtime CSG is editor time only, sorry
    Chisel (realtime CSG's eventual successor) will have runtime support, but it's not ready to be used yet
     
  23. ZiadJ

    ZiadJ

    Joined:
    Sep 3, 2011
    Posts:
    58
    Is the editor dll open source? I'm asking because I couldn't find the code for RealtimeCSG[1_559].dll on github.
     
  24. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    204
    @ZiadJ It's open source, but I didn't open source the c++ dll. At least not yet
    The source code is hard to read, especially if you don't know how the whole algorithm works in the first place.
    I'm working on a managed version of a new algorithm that's easier to understand for Chisel, and I'll backport this to realtime CSG
     
  25. david_kay

    david_kay

    Joined:
    Jul 25, 2017
    Posts:
    14
    Hi there, I'm trying out the realtime CSG tool and I have stumbled upon this: the csg brushes can only be selected when there is no other object behind the brush. If there is another (non brush) object behind it will be selected instead. clicking multiple times will not help, it will toggle between mutliple non brush objects but the brush in front of them will never be selected. Any ideas what might be the problem? I'm using realtime csg from asset store on Unity 2019.2