Search Unity

[RELEASED] Realtime CSG - level design for Unity

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

  1. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    Hello again,

    Any updates on a symmetry/mirror editing mode? I understand you're working on low-level stuff right now - do you think it will be possible to add this feature with the reworked version?

    Thanks.
     
  2. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    Hi,
    the low level stuff is one step towards making that possible. Unfortunately it's all taking much longer than I'd like, but it needs to be done. (I'm still working on it, don't worry!)
     
    julianr and tapawafo like this.
  3. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    Just a bit more visual update this time:
    optimize.gif
    As you can see all the useless vertices here are now successfully removed :)

    For more than a month I was trying to get to this point using a data structure called "half-edges", but at the end I came to the conclusion that the way this data structure worked just made it too easy for things to break down. I felt like I was playing a game of whack a mole! So I switched to something else and had immediate results in a just couple of days!

    Unfortunately switching to this other data structure meant that I need to rewrite smoothing across multiple brushes, so that's the next thing on my list.
     
    N00MKRAD, tapawafo and doq like this.
  4. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Good job, you are definitely killing SabreCSG when it comes to polycount.
    Sabre produced a S***load of polys, even compared to the current Realtime CSG version.
     
    logicalerror likes this.
  5. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    Another progress update:

    borders.PNG

    This is a debug view of all the edges that connect one brush to another, this is something I need to do in order to properly smooth normals between brushes ...
    I mean, it's kind of hard to smooth between edges if you don't know which edges lead to which edges, right?
    I still need to add some code to make sure all the vertices line up properly on those edges, split any edges when a vertex only exists on one side of the edge etc. but then it should be easy to finish the smoothing.
    After that I just need to test and fix anything that comes up and then I'll be able to release a new version
     
    doq, tapawafo and 2dgame like this.
  6. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    I'm considering moving to Unity 5.5 as the lowest supported version for Realtime-CSG , does anybody have a problem with this?

    The problem is that 2017.2 seems to have broken serialization which means realtime-CSG scene files from 5.4 won't load properly unless first saved in a later version.

    And this complicates things for me since the demo scene file is saved in 5.4
     
    tapawafo likes this.
  7. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    Unity 2017.2 added some classes that where named exactly like some classes in Realtime-CSG, and this created a naming conflict (it made it impossible for Unity to compile Realtime-CSG)

    I just released a hotfix that fixes that.

    Other than that, as mentioned in the previous message, Unity 2017.2 has a bug which fails to import any Realtime-CSG scene/prefab that was saved in 5.4.

    The work around is to load and save them in an in between version (5.5, 5.6 or 2017.1)
     
  8. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Hey @logicalerror - Got a few questions -

    1. Is there anyway currently to import maps from external editors? (Such as Hammer, Trench Broom 2, Jack Hammer, etc.)
    2. With the .FBX export for Real Time CSG does this export the materials and are the materials properly mapped as well on export?
     
  9. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    Hi @HeadClot88
    1. There's a hammer importer in the works, but I need to finish some stuff first before I feel comfortable releasing the importer. Here's a pretty old video that shows the result of an old version of that importer


    2. It exports the materials, but not all Unity versions (5.4 doesn't work, >2017.1 work) re-import it correctly somehow .. when re-importing it the Unity Meshes have the correct materials set,
    yet somehow it doesn't render it correctly ¯\_(ツ)_/¯
    The FBX exporter uses the text FBX file format, which is not supported by every DCC tool unfortunately ..
     
    HeadClot88 and julianr like this.
  10. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    You will eventually release the importer??

    That's F***ing awesome news.
     
  11. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
  12. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,212
    does that include .map format or is it .clx? can't remember its been a while and I think I used 3D Studio Creator.
     
    Last edited: Oct 17, 2017
  13. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    The importer currently only works on .vmf files
     
    julianr likes this.
  14. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    736
    Hey @logicalerror -

    A Few more questions -

    1. What work needs to be done in order to release the hammer Importer?
    2. Would it be possible to extend the map importer to work with .map files?
     
  15. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    1. There are some brushes that don't import correctly, it's rare and I know what the problem is, but I still need to fix it. Also, no support to import subdivision surfaces yet
    2. Depends on what .map format you're talking about .. there are a lot of types of .map files out there
     
  16. terrivellmann

    terrivellmann

    Joined:
    Mar 10, 2015
    Posts:
    23
    Just started playing with this, and following the Introduction to Realtime CSG video. Right at the start you start generating shapes on top of other shapes, but to me it always snaps to the grid instead. Am I missing something?
     
  17. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    Hi @terrivellmann , I just checked and it works fine on my end, so you'll have to give me more to go on :-/
    Can you maybe record a small video + create a non-public video & send me the link? (if it's not too much work?)

    Keep in mind that if, for example, you create new shape on the side of a cube, it'll snap to a grid that's aligned to that side of the cube. Could that be what you're experiencing? There's a button on the bottom of the grid that turns of snapping
     
  18. terrivellmann

    terrivellmann

    Joined:
    Mar 10, 2015
    Posts:
    23
  19. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    @terrivellmann Oh what the .. ? That looks weird, can you send me that scene file?
    The surface you're trying to create another brush on, is that a regular Unity mesh or other brushes?
    I'm also wondering, could it be related to using an isometric camera? can you try perspective?
     
  20. terrivellmann

    terrivellmann

    Joined:
    Mar 10, 2015
    Posts:
    23
    Those were other brushes, setting the scene view to perspective does work!
    Can you replicate it? Can still send you the scene file if needed
     
  21. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Hey there.

    I'm using the free version, and I keep getting "light leaks".


    You can see it on the shadows, there are ugly lines of light.

    Is that fixed in the paid version? I'm going to buy it soon, but this needs to be fixed.
     
  22. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    Hi @N00MKRAD , I'm working on a new version that will be done 'soon' that fixes a lot of the issues you're now seeing. However, part of the problem is probably because of the normal bias used in your light, set it to 0 and it should be a lot better. Using a normal bias can even cause these kind of artifacts on perfect meshes

    @terrivellmann I can reproduce it, it's clearly a bug and I'll fix this after the version I'm working on right now
     
    N00MKRAD likes this.
  23. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Damn, I only tried tweaking the bias, not normal bias.

    Works now, still looking forward to the update.
     
  24. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Looks really interesting! Not sure why I never looked into Realtime CSG before.

    Especially regarding the light leaking, a problem we have with our current solution...
     
  25. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    hippocoder likes this.
  26. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Thanks a lot :)
     
  27. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I notice some topology, working with spheres for example, can lead to some pretty dense spikes rather than a more spread approach. Is this something you have on your radar?
     
  28. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    @hippocoder I'm not sure what exactly you mean with "pretty dense spikes"? Can you describe what you mean or post a screenshot?
     
    Last edited: Nov 2, 2017
  29. LogicalError-Unity3D

    LogicalError-Unity3D

    Unity Technologies

    Joined:
    Aug 7, 2015
    Posts:
    58
    Finally managed to find some time to make the normal smoothing work with the new optimized mesh smoothing.gif

    (it didn't help that I had a team offsite for a week, during which time I had no time to work on this)

    I still need to do some testing, after that I can release the new version with the optimized mesh (finally)
     
    doq and tapawafo like this.
  30. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Btw, you have a Unity Technologies acc, is there a chance Realtime CSG or parts of it will be integrated into Unity?
     
    Regularry likes this.
  31. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    @N00MKRAD that would depend on other people at unity ;)
     
  32. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210
    Did you get to Unity because of Realtime CSG or for other reasons?
     
  33. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    @N00MKRAD I'm sure making realtime-CSG was one of the reasons that made Unity ask me to come work for them
     
    N00MKRAD likes this.
  34. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    The other reason was the ginger moustache that curls. Still, +1 my vote for including CSG style editing as a baseline Unity editor (and runtime) feature.
     
    xVergilx, Petethegoat and N00MKRAD like this.
  35. N00MKRAD

    N00MKRAD

    Joined:
    Dec 31, 2013
    Posts:
    210


    ...my lightmaps are all blocky (2017.2, PLM). High preset, 1024px.

    Is this a bug on RCSG's side?
     
  36. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    No that's not a RealtimeCSG bug, it has no control over the creation of lightmaps or their resolution (at least not yet)
     
  37. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    I released a beta of version 1.500 of Realtime CSG , you can find it here

    I touched a lot of code, so please make a backup before you try it.
    Also: please give me feedback how it works for you, if you see or do not see any issues in the generated mesh.
    There is an issue with the tangents (normals related) that I'm aware of, I'm going to work on that next
     
    Petethegoat and tapawafo like this.
  38. Petethegoat

    Petethegoat

    Joined:
    Jun 12, 2013
    Posts:
    39
    1.500 seems pretty good so far! I've had a few minor issues, one was some handle error that I ignored and haven't noticed since, but I have similar (as far as memory serves) errors when I create and extrude a concave polygon with the freedraw tool (in a brand new, empty model), and then try to chamfer any of the edges.

    Here's a selection of them, they appear to be consistently reproducible though. https://pastebin.com/raw/9wcq3Rp0
    And here's what my model looks like: https://i.imgur.com/SK7K0vF.png
    The selected face is the one created by the chamfer.

    The transform gizmo very obviously stops doing what I want it to do when this happens as well.

    The other issue I've noticed, that appears to be fairly harmless, is sometimes while Realtime CSG is disabled with ctrl-f3 the model will seem to ignore or incorrectly create certain brushes. Don't know what causes it, but it happens consistently while I'm working on the project. Enabling Realtime CSG again seems to recreate the brushes properly.
    None of the ideas I tried to reproduce it worked, but I'll let you know if I figure it out.
     
  39. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    @Petethegoat thanks! I fixed the handle error, I should be able to release this version some time today. I'll look at your other issues after that (+ other issues that have been mentioned in this thread)
     
    Petethegoat likes this.
  40. LogicalError-Unity3D

    LogicalError-Unity3D

    Unity Technologies

    Joined:
    Aug 7, 2015
    Posts:
    58
    Version 1.501 is out, it fixes the normal/tangent issues and the GetHandleSizes error issues
    normal_smoothing.gif

    Note that meshes are now nice and optimized:

    optimized.gif

    you can download it here: https://realtimecsg.com/updates/
     
  41. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    New update looks good!

    Do you have any updates on progress towards mirror/symmetry editing?

    Thanks.
     
  42. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    @matteumayo What I'm working towards is to make brushes separate from brush-components.
    That will make it much easier for me to do things like mirror/symmetry editing since right now I'd have to create new game-objects to create the mirrored brushes ..

    Creating the brushes as game-objects would force me to keep the mirror and the original synchronized & have to worry about dangling brushes in case something goes wrong, or what would happen if the user changes the brushes etc. etc.
    If I can create these brushes under the hood without needing to create gameobjects, then I can simplify everything *a lot*. But it requires me to rework a lot of code. In the end things will be faster and more flexible though.
     
    xVergilx and tapawafo like this.
  43. waxx

    waxx

    Joined:
    Apr 1, 2013
    Posts:
    48
    As far as I understand this is an editor plugin to design your levels. Can you do any boolean operations real-time in-game?
     
  44. LogicalError-Unity3D

    LogicalError-Unity3D

    Unity Technologies

    Joined:
    Aug 7, 2015
    Posts:
    58
    @waxx Right now there is no runtime support. It seems to be the most requested feature ;)
    Unfortunately I still have to do a lot of work before runtime support is possible, so not; yet I'm afraid.

    Version 1.502 has been released, fixing some trigger issues and adds visualization of hidden, culled, shadow casting and shadow receiving surfaces.

    This version can be found here , you will need your invoice to download the update.
    Note that it will take some time before this version will appear on the asset store
     
  45. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
    It turned out 1.502 was compiled the wrong way (which caused it to be slower and spam the user with warnings), so I released 1.503 that fixes this. Sorry for the inconvenience!
     
    HeadClot88 likes this.
  46. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
  47. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    207
  48. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    hi @logicalerror , I wonder if your tool is able to produce assets in a procedural or parametric way, think "houdini" or "archimatix", what I need is to assemble it in such a way that later I can reuse it to create multiple levels with similar designs, is that possible?
     
  49. LogicalError-Unity3D

    LogicalError-Unity3D

    Unity Technologies

    Joined:
    Aug 7, 2015
    Posts:
    58
    @Cleverlie currently realtime-CSG has the building blocks to create levels with, eventually my goal is to add parametric / procedural stuff on top of this, in fact me wanting to make that is the whole reason why I've started this project.
    Right now I need to finish some other things before I can work on that though .. so not just yet, sorry
     
    Petethegoat and Cleverlie like this.
  50. terrivellmann

    terrivellmann

    Joined:
    Mar 10, 2015
    Posts:
    23
    Hi!
    On the latest version, when I disable RealtimeCSG with Control F3 if will sometimes break the geometry when I hit play. Easy fix by enabing RealtimeCSG again but thought I'd report it.

    A question: can I create stairs that aren't filled? For example, here on this pic, the left one is what I can do but for the right one I need to edit the steps manually. Is there some trick to it?
    Also on the topic of stairs, it would be great it they stayed editable, so scaling them added/removed steps instead of actually scaling the geometry. Its one thing I usually end up editing a lot to get it just right.
     
    Petethegoat likes this.