Search Unity

  1. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  2. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Participate with students all over the world and build projects to teach people. Join now!
    Dismiss Notice
  5. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

[RELEASED] Realtime CSG - level design for Unity

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

  1. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    4,116
    When realtime support is implemented, will it also generate collision info? I know it's a ways off still but this could really fit into a project I've been itching to try if it does.
     
  2. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    do you mean runtime support? yes, when runtime support is implemented it'll also generate collision meshes, just like it does now in the editor
     
  3. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    To clarify, you can build stuff in the editor and everything you created in the editor will work at runtime. You just can't do any CSG operations at runtime, at least not yet. The meshes you build in the editor can, of course, still move around
     
  4. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    I realized it's been a while since I posted here, so let me show a couple of features that have been added during that time:


    It's possible to turn off texture locking for surfaces now, so that they stay in the same position in worldspace, when you move your brushes around




    It's now possible to modify the rotation pivot of brushes, while in rotation mode, which makes it easier to rotate a brush just the way you want to!


    Note that you'll need to set the pivot to pivot mode, otherwise it'll always be in the center and unmovable.



    And if you hold shift while dragging, you can snap your objects to the underlying geometry in exactly the same way as drag & drop works!

    Note that you still need to set up the objects to behave exactly like you want, just like with drag & dropping.
    Fortunately there is a tutorial about that here:
     
    doq, laurentlavigne and matteumayo like this.
  5. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    164
    Hello,

    First off, I just want to say thanks for the asset - it's a pleasure to work with.

    However, I seem to be getting a consistent crash when dragging or instantiating prefabs containing a CSGModel into my scene, even when the model's been exported into a UnityMesh. This is problematic, as I'm spawning many prefabs in runtime (using DunGen.)

    Strangely, it doesn't happen every time. It seems random. I'll drag this same prefab into the hierarchy, and sometimes it shows up just fine, and others it crashes Unity.

    Here's what it says in error.log:

    Code (CSharp):
    1. Unity Editor [version: [B]Unity 5.5.1f1[/B]_88d00a7498cd]
    2.  
    3. RealtimeCSG[1.344].dll caused an Access Violation (0xc0000005)
    4.   in module RealtimeCSG[1.344].dll at 0033:ecbaf234.
    5.  
    6. Error occurred at 2017-02-11_201208.
    7. C:\Program Files\Unity\Editor\Unity.exe, run by Owner.
    8. 74% memory in use.
    9. 8043 MB physical memory [2028 MB free].
    10. 16085 MB paging file [8932 MB free].
    11. 8388608 MB user address space [8386025 MB free].
    12. Read from location 00000040 caused an access violation.
    13.  

    The prefab in question is a simple CSG model. The selected/highlighted object in the hierarchy is the CSGModel object. The parent is simply an empty game object.



    Thanks.
     
  6. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Hi, thanks for reporting this
    When it crashes are you able to get a crash dump? Also, are you running on 64 bit or 32 bit windows?
     
  7. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    164
  8. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,013
    Any lofting and profile extrusion along a curve?
     
  9. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    It's planned, but haven't had time for it yet. It's relatively trivial with CSG though ..
    But dealing with the UI is not :(
     
    Last edited: Mar 14, 2017
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,013
    Alright I'll keep an eye out. Did you put the demo back online?
     
  11. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Yes, new evaluation version is up now :)
     
  12. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    60
    Hey @logicalerror,

    I just purchased RuntimeCSG looking to do some level design but I have a major issue with the asset. So far I have tinkered around with it and tried several different versions in totally clean projects but no matter what I do I can't get the editor with RuntimeCSG running faster than a slideshow (we're talking ~30fps). I'm pretty sure I must be the only person experiencing this because otherwise I'm sure I would have seen multiple 1 star reviews complaining about how this asset trashes your editor frame rate.

    I even did some profiling of the Unity editor and I'm definitely getting sub 30 FPS whenever I move the camera, and this is without any brushes or objects in the scene! DockArea.OnGUI() is crushing the CPU with 35ms of computation time (holy crap). Also, weirdly enough this seems to only occur when I rotate the scene view camera but not when I move the position of the camera (with WASD or the arrow keys). And this is all happening on a plenty-strong computer with a i5-3570k and GTX 1070 (also running Unity v5.5.2f1).

    Honestly I love the idea of the asset and would like to use it but the performance is abysmal and extremely distracting to my productivity. I hope there is some kind of fix because otherwise it's unusable for me.

    Thanks for your time!

    Edit: Just stumbled across the ability to turn off RealtimeCSG with Ctrl+F3 (which for the record is not in the documentation at all). Thankfully this is an option so you don't have to take a huge performance hit even when not using RealtimeCSG.
     
    Last edited: Mar 16, 2017
  13. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Hi PartyBoat, I'm actually surprised it works on 5.2.2 .. the minimum version is 5.3.5, I've never even tested it on 5.2.2 ...
    In fact I've been thinking about upping the minimum version to 5.4 since 5.3.5 is giving me so many headaches

    Is there a reason you haven't upgraded to a later version yet?
     
  14. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    60
    Whoops, meant v5.5.2f1. It's the latest non-beta version of Unity, so the version shouldn't be an issue.

    I've continued to mess around with RealtimeCSG since my last post and being able to turn it on and off certain makes my issue with the asset much less dramatic. However, I'd still like to know if this is expected performance or if something on my end is wacky.
     
  15. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Ok, taking a quick look w/ latest version + 5.5.2f1 and I didn't notice any slowness ..
    ... are you using the 32-bit or 64-bit version of Unity? What are your PC specs?
     
  16. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    60
    It's the 64bit version of Unity.

    Specs: i5-3570k, GTX 1070 (latest driver, 378.78), 16gb RAM, Windows 10 (w/ latest updates).
     
  17. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    There's a new version up which quite possibly solves your issues @PartyBoat , let me know if it does/doesn't!

    The new version also has some tweaks in the mesh editing area



    more tweaks are coming!
     
    matteumayo likes this.
  18. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Thanks :) Please try out the latest version, it should solve your issues
     
  19. PartyBoat

    PartyBoat

    Joined:
    Oct 21, 2012
    Posts:
    60
    Hey, thanks so far for all of the help. Right now I am pretty sure that the poor editor performance has nothing to do with RealtimeCSG and I am having a weird issue with either Unity or my hardware/software setup. This is because I get the same exact framerate issue any time anything is being drawn on top of the scene view. For example, when you click on a gameobject with a camera component you get the little camera preview window layered on top of the scene view and for me this drops the frame rate just as bad as when the RealtimeCSG window is shown.

    The weirdest part though is that my framerate still stays at +200fps when I move the camera (with the arrow/WASD keys), but it drops down to below 30fps when I rotate the camera with the mouse in any way. This is true for the camera preview window and RealtimeCSG. That's what makes me think there is something funky going on with Unity itself and the internal code having do do with the editor GUI. Although it doesn't seem like anyone else is reporting this problem so it could also be my setup.

    I even tried the latest version of RealtimeCSG on the beta of Unity 5.6 and it still didn't solve the issues, so unfortunately it probably won't be fixed with the new version of Unity.
     
  20. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    164
    Just wanted to chime in on my progress with the above crash:

    I'm pretty sure the problem lies in DunGen, not RealtimeCSG, or at most, a combination of the two. I was previously using the UnityMesh conversion for the CSG models, and then spawning prefabs with those models using DunGen. So I figured switching to FBX and removing the CSG scripts entirely would fix the issue.

    Unfortunately the behavior is exactly the same even with only the exported FBX models, meaning this is almost assuredly a bug in DunGen. I say unfortunately because I've never had issues like this with DunGen, so it'll likely be very difficult to find the cause. Time to troubleshoot!

    I do have one strange bug, but it's likely due to my use of the 5.6 beta, so take it with a grain of salt - I'll describe it here just to see if anyone knows a solution:

    CSG brushes, when moved on X or Z axis, seem to fly away with exponential movement, only when using the graphical axis arrows in Unity's movement tool. I'm currently working around this by using the 'Position' values on the Transform component on the brush object.
     
  21. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    @matteumayo thanks for the update! weird about the positional movement, is that on the latest version (1.364)?
     
  22. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    164
    @logicalerror

    This is using 1.357 - I'll update and let you know if it performs the same. It may also be a weird bug with a particular scene - I haven't tested any other scenes with 5.6 yet, so I'll do that too.
     
  23. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Version 1.366 has just been released!

    Scaling vertices in mesh mode now properly scale when unity is in local mode:




    You can now scale by dragging edges:



    Scale snapping can now be set in the bottom bar:



    When dragging an edge when the movement tool is selected it'll now move on the plane that intersects that edge
    (ie. an edge going in the Z direction will now default on moving on the XY plane)
    of course you can always select the edge and then use the unity movement gizmo to move it in any direction you want.



    You can now rotate vertices in edit mode:



    You can now extrude surface in direction of axis in global mode:



    Check it out!

    PS. the link to the post at the top also contains a little update on the source engine map file importer I'm working on




    I should note that this version can only be downloaded from the update site since it's only just been submitted to the asset store, you can download from the update site if you purchased realtime CSG..
    The evaluation version isn't updated yet, but I'll get to that soon
     
    Last edited: Apr 3, 2017
    matteumayo and 2dgame like this.
  24. matteumayo

    matteumayo

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

    I'm having trouble understanding the proper workflow for exporting, and actually loading my CSG models. The FBX option works fine, but when I make changes to the CSG, and then overwrite the FBX model in export, the models in my scene do not change to the new model, instead they simply say 'Missing Mesh' and I have to replace the new model into the spot of the old one.

    This is troublesome, so I'm trying to get the much simpler Unity Mesh export option working.

    However, I can't find any documentation or tutorials on how to do this properly, and my method isn't working.

    After performing Export > Unity Mesh in scene, I then apply the changes to the prefab of the CSG model. But when instantiating this prefab in-game, the Mesh Filter of the exported model has no mesh (missing.)

    Am I missing something here? Or is there no way to instantiate CSG models after export into Unity Mesh?

    Thanks.
     
  25. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Hi matteumayo, I think the FBX problem is because the link to the original FBX prefab is not created. So when you change the FBX file, it's not updated in the scene. This is a bug and I have a fix ready

    The second issue with the mesh export, that's a Unity issue, sort of.
    The mesh is stored in the scene, when you create a prefab from the model Unity doesn't put the mesh in the prefab, so it then then can't find it when you instantiate it..
    There are ways to actually attach the mesh to a prefab from code, so it's possible to work around it, but it's very unpractical..

    I suggest you wait until I upload the FBX fix (should be later today) and use FBX export instead, sorry for the inconvenience
     
    matteumayo likes this.
  26. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    doq and matteumayo like this.
  27. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Version 1.402 now has the ability to set the default material, which is used when you create, split or chamfer brushes!


    It also has some helpers to manually move or rotate selected brushes or create a clone that is moved/rotated:

     
    doq and matteumayo like this.
  28. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    164
    @logicalerror

    Wow, that clone feature looks amazing! Also, I had no idea how amazing chamfering would be - I end up using it all the time now. Thanks for the updates.

    I'd also like to mention, if you remember my post about strange, super fast movement of some brushes when translating in editor, I found it was due to the model (and brushes) being placed in a GameObject that was scaled up (5x), so it's easy to work around.

    Cheers!
     
  29. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Glad you like it :) I'll take a look at movement with scaled models, thanks for letting me know!
     
  30. JuliuszK

    JuliuszK

    Joined:
    Dec 22, 2014
    Posts:
    25
    Hi,
    I'm looking at your tool and this is the closest thing to what I'm looking for. And basically, what I'm trying to achieve is to build a run-time level editor (initially just extend the Unity Editor itself), that would export levels to the Dark Engine compatible format (Thief 1,2 and System Shock 2 games).
    My question is - are the features below possible already or do you think they would be possible with some code modification?:
    1) run-time brushes creation and CSG operations
    2) world starts solid, but we can use subtractive and additive brushes
    3) there are actually three mediums: solid, air and water. The CSG operations can be more complex, like for example 'Flood' - will replace air with water, but will leave solid untouched.
    4) the output geometry mesh is not combined, but rather stored as so called 'cells'. Each cell is a convex piece of a volume (filled with air or water). So, an empty room would be one cell, but if you place a pillar in the center, it would split the room into 4 convex cells. Alternatively, I could just create the cells in memory, while building the CSG model, but I'd need that information, as it is used for a number of systems, like navigation, sound propagation etc...
    5) UVs are stored as plane projections only (not UV vertices). So I can't stretch them any way I want.
    6) Editor and run-time API, so more complex structures can be scripted, using C# or UnityScript.
    7) Ability to customize the UI and potentially disable certain features, which would result in geometry incompatible with the Dark Engine.

    If your tool could do the above (with some customization on my side), that would be brilliant. It would save me tons of time!
     
  31. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    Hi @JuliuszK,
    I'll answer your questions one by one

    1. Realtime CSG is editor-only for now. It's definitly planned, but since runtime support is more dangerous to modify later on, I'd rather get the editor side as solid and complete as possible first, since making any changes in retrospect is always painful. At the very least I want to make sure the editor API is complete and solid first, since that would be the basis of the runtime API.

    2. On each model there is an option called "Inverted world" which makes the world solid by default.

    3. You can create multiple models that each create their own meshes, maybe this will be good enough for you? In the future I want to add functionality which allows you to determine how multiple models interact with each other. For instance, that a model gets it's geometry removed from another model or not, but not necessarily the other way around.

    4. I'm not entirely sure with what you mean "not combined"? You want each brush to be it's own mesh? That would be terrible for performance..

    5. Currently per vertex UVs are generated on the geometry using plane projections. Is that what you want, or do you mean you don't want that?

    6. There is already a very rudementary Editor API. I'm planning on extending on it. If you want to help shape it, then give me feedback on what you need API wise :)

    7. What kind of UI customizations are you talking about exactly? I'm not familiar with the ins and outs of the Dark Engine (just it's games :)), so I can't judge what UI elements you are referring to.
     
    Last edited: Apr 26, 2017
  32. JuliuszK

    JuliuszK

    Joined:
    Dec 22, 2014
    Posts:
    25
    Hi @logicalerror,
    Thanks a lot for your answers.

    Re. 1) I understand the priorities of getting the editor side of things working first. But do you have any even approximated time frame? Are you talking about another year of polishing the editor tools, before you even start working on the run-time version or may it happen in next three months or so?

    Re. 2) and 5) That sounds good. :)

    Re. 3) and 7) Let me elaborate a bit on the way CSG logic works in Dromed (the existing Dark Engine editor). There are three types of 'medium' brushes: solid, air, water, which replace whatever medium was before these brushes in place.
    And there are also 'operation brushes' such as: solid -> water, water -> air, water -> solid, air -> water ("flood") etc... - all combinations. Since the world starts solid, the playable area is represented by the insides of air and water brushes. So, all the brushes after CSG operations need kind of a tag - water or air. Then for each type of medium and operation brushes, a CSG operation table/list needs to be set up. For example:
    1) solid brush overlapping air brush - subtraction
    2) solid brush overlapping water brush - subtraction
    3) flood brush overlappign air brush - intersection
    4) flood brush overlapping water brush - union
    etc...
    Something along these lines.
    Not sure what system of brushes interaction you are thinking about. I understand the above may be very specific to this engine. So, that's why my question 7) came - if I was able to modify the UI, I would be able to provide a layer, that translates Dark Engine specific approach to the approach that your tool uses. Hope that makes sense...

    Re. 4) Yeah, true... I could keep the cells structure as abstract objects only, but somehow I need a connection between each polygon and the cell (and possibly brush) it belongs to. Not sure if Unity allows for a meta information on the polygons...

    Anyway - I'll give your tools a try. The videos look great. And I'll see if I could adapt it to my needs. I under
     
  33. JuliuszK

    JuliuszK

    Joined:
    Dec 22, 2014
    Posts:
    25
    Oh, and I have one more question:

    8) do you have any large scene management tools? Like when you build a city with multi-storey buildings and everything overlaps at some point in the viewports and it's hard to make out what's what. Dromed has so called area brushes, which when activated, hide everything else, so you can focus on working on a certain area only. They work as subtractive brushes placed first in the queue, so it's walls would result in surrrounding walls for the selected area. Again - this is a Dromed's approach and it's not the only way things could be done.

    Thanks,
    Juliusz
     
  34. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    199
    Just posting to say I'm liking this asset a lot so far. Didn't notice there was a forum thread here, that's good.

    Couple requests:

    I could use a UV stitching tool to combine some areas... (mainly if I start rounding, making things less planar by modeling or cutting whatever, there's not enough UV option to configure everything)

    Tube splines would be really cool, and possibly related, wall to wall segment splines.

    Really like what you've made so far though, the grid system and controls are superb and easy to work with without any setup or much additional training.
     
  35. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    @JuliuszK It's hard to say when I'll be in a position to add runtime support. It all depends on how much time I'll have .. I might be able to spend *a lot* more time on Realtime-CSG after a couple of months, but this is still not 100% certain.
    Sorry for being so vague :-/

    I think for no 3. and 7 you could do this by using multiple models for multiple mediums .. you could turn the models into triggers to detect when you go in/out of water/air etc.

    as for no. 8, realtime-CSG works in multi-scene setups and I've imported half-life 2 levels with 3000 brushes and everything worked just fine. (there are some unity related performance issues, like if you select hundreds of lights at the same time then unity slows to a crawl, but can't do anything about that)
    If you use a model for each area then you can simply hide/show the models you (don't) want to work with ... nobody has asked me to implement tools to improve the workflow with this, so I assume this works for people (unless told otherwise!)

    There's also wireframe mode that helps if you like to work with 3 orthographic (2d) windows and 1 3d window. If you click multiple times on the same spot it'll cycle through all the brushes behind the cursor.

    wireframe_mode.gif

    @adventurefan I'm glad you like it :)
    FYI: there's also a Realtime-CSG forum here and feature requests/bug reports can be created here :)
    When you're in the surface edit mode, you can 'smear' a texture from one surface to another by holding G and draging from one surface to another.

    I'm already working on extruding shapes along a spline, which would allow you to make tubes. Walls along splines are already possible using the Free-draw brush generator. If you create a shape and then double click on the edges or vertices you can turn those into splines. If you click multiple times you'll cycle between straight edges, continuous curves, and broken curves

    wall_curves.gif
    (I forgot to record that you can just extrude this shape up)
    I understand that this might not be the easiest way to build walls, but at least it already exists. Once extrusion along a spline is implemented it should also be easy to create a tool that allows you to create walls by basically drawing 'lines' with a thickness and a height
     
  36. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    342
    Thinking about buying this, but I have a couple of questions. Right now I use probuilder for whiteboxing, which works okay but not great. I like being able to manipulate individual verts if I need to, and I like that it's very easy to work with UVs, but boolean operations are non-functional so it takes forever to add doors and windows. So my questions:

    Can anybody who's used both this and probuilder talk a little bit about what RealtimeCSG is like to use?

    Can I move back and forth between this and other tools at all? It looks like there's an export, so presumably I could figure out a CSG -> Probuilder workflow if I wanted to, for example, use their UV editor. Can I convert my existing probuilder levels or .obj models to a format I can subtract from, or would I have to remake them? I know there's no way around boolean operations taking much longer on more complicated models, but everything I'm talking about has about the same polycount as a realtimeCSG model, it'd just be good to have the flexibility to use some of my existing tools and assets.

    Are there still no spheres and domes?

    What's the snapping system like? Can I do non-square/rotated grids? Can I use unity's surface and vertex snapping?

    Is the demo up-to-date, or are there major differences I should be aware of?
     
  37. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    199
    Booleans are very useful in this. You can do whatever you want with the substractive stuff, and change your mind later you can move or delete the subtractive element instantly.

    As for your current levels, I'm not sure but I suspect you can't convert stuff into this format.

    there are, and you can round things other ways in modeling.

    geometry-wise they're fine, but the UVs aren't good enough if you have PBR going on. but you can export whatever spherical objects in the end and spend 10 mins doing the UV how you like in blender or maya or whatever. tested that out and it's really not that hard to deal with. the majority of level geometry like rooms, frames, tunnels and stuff won't need it.
     
  38. JuliuszK

    JuliuszK

    Joined:
    Dec 22, 2014
    Posts:
    25
    @logicalerror - thanks for all the answers.
    I've been playing around with the trial version and the modelling capabilities are great. However, for my particular needs, I know it won't work straightaway (as I need to make it compatible with another engine - not Unity). So, could you just clarify, if the tools come with a source code, so I could customize it to my needs? Thanks.
     
  39. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    brisingre likes this.
  40. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    199
    nice!

    btw I decided to test csg with surforge today and the results are great.

    if you have surforge you can use real-time csg to model on it and just use one of the "extent id shaders" on your objects. it will bake em just fine and you can of course edit and change the models endlessly as usual.:)
     

    Attached Files:

  41. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    cool! thanks for letting me know :)
     
  42. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    118
    I'm using Surforge as well. Creating details with Realtime CSG is easy enough, but I'm wondering if it could be simpler. The way I do it, I have to create an object with the PolyLasso tool to get access to the Surforge's hidden shader, then create the csg object and export it to the Unity Mesh format, and drag the Surforge shader to the unity mesh.

    https://streamable.com/eq8uk
    Is there a more straightforward method?

    It would be awesome if we could get integration between Surforge and Realtime-CSG for adding details to surforge and for adding materials from surfage to RCSG without exporting to a 3rd party package to setup the uvs.

    Update: Another way to assign the shader is to go into Surforge->AddDetailTool->Materials and assign the Extent_Id0 material to the Unity Mesh. So you don't have to create a dummy polyLassoObject.
     
    Last edited: May 9, 2017
  43. JuliuszK

    JuliuszK

    Joined:
    Dec 22, 2014
    Posts:
    25
    I've got the plugin in the meantime anyway. I also came across your blog posts about your algorithm, so this was a way for saying 'thanks for sharing your knowledge', even if I don't get to use the Realtime CG in my projects directly.
    BTW. do you think doing this using C# only would be much slower?
     
  44. adventurefan

    adventurefan

    Joined:
    Jan 17, 2014
    Posts:
    199
    Well you can set the material on the generate tab or in surfaces tab for the CSG object, so if that's assigned you don't actually have to export. You can just keep working away with both tools the whole time.
     
    doq likes this.
  45. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    118
    Thanks for the tip! I tried it out https://streamable.com/q2o84, but seems that placing the material on a sphere is acting up.
    I'm not sure if it's related to the errors in the console.

    NullReferenceException: Object reference not set to an instance of an object
    RealtimeCSG.UndoGroup..ctor (RealtimeCSG.SelectedBrushSurface[] selectedBrushSurfaces, System.String name, Boolean reregisterMaterials, Boolean ignoreGroup) (at Assets/Plugins/RealtimeCSG/Editor/Scripts/Helpers/UndoGroup.cs:22)
    RealtimeCSG.MaterialDragOnSurfaceTool.DragExited (Boolean inSceneView) (at Assets/Plugins/RealtimeCSG/Editor/Scripts/EditorWindows/DragTools/MaterialDragOnSurfaceTool.cs:497)
    RealtimeCSG.SceneViewEventHandler.OnHandleDragAndDrop (Boolean inSceneView, UnityEngine.Transform transformInInspector, Nullable`1 selectionRect) (at Assets/Plugins/RealtimeCSG/Editor/Scripts/Managers/SceneViewEventHandler.cs:741)
    RealtimeCSG.SceneViewEventHandler.OnScene (UnityEditor.SceneView sceneView) (at Assets/Plugins/RealtimeCSG/Editor/Scripts/Managers/SceneViewEventHandler.cs:798)
    UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2397)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1715)
    UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1585)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    I recreated my project and the undo error went away. When I assign a different material to in the generate panel the undo error appears.
     
    Last edited: May 10, 2017
  46. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    118
    Is anyone else getting this odd behavior with intersecting spheres missing faces? https://streamable.com/fgclj I'm on 1.403 looks like I should upgrade.

    Update: Looks like 1.406 also has the issue with the spheres.
     
    Last edited: May 10, 2017
  47. logicalerror

    logicalerror

    Joined:
    Jan 2, 2013
    Posts:
    161
    @doq Can you sent me a scene with those spheres with triangles dissappearing? I can't reproduce this locally for some reason .. where those spheres created in an older version of Realtime-CSG?
    I can't reproduce the console error either, do you still have that in 1.406? I vaguely remember fixing something related to that recently

    Looks like the sphere always uses the wall material on one side .. didn't notice because I was testing .. using the wall material .. oops

    I'll fix that in the next version
     
  48. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    118
    Wow that's really strange. It's working fine now! https://streamable.com/m54ab

    I'm not sure what changed, but it's probably my system or setup (installed new harddrive and had a couple windows system updates and my system was acting a bit weird).

    I'm not getting any errors in the console even after switching the material either.

    But on another note, I noticed when trying to scale objects the scaling gizmo is the same as the rect transform gizmo. There's no easy way to uniformly transform an object in 1.406.

    Also, do you know why the sphere doesn't completely take to the surforge material?
     
    Last edited: May 10, 2017
  49. LogicalError-Unity3D

    LogicalError-Unity3D

    Unity Technologies

    Joined:
    Aug 7, 2015
    Posts:
    52
    @doq Well I did fix a bug related to the 'polygons dissapearing' thing recently, but it had to do with how the spheres where created. If you used spheres created in an old version the problem would still be there ..
    .. so maybe that's what happened? ¯\_(ツ)_/¯

    Ok, I didn't consider uniform scaling. I thought it wouldn't be important in practice.. I'll look into that

    What exactly do you mean with that the sphere "doesn't completely take" to the surforge material?
     
  50. doq

    doq

    Joined:
    Aug 17, 2015
    Posts:
    118
    In this video I posted https://streamable.com/m54ab you can see one side of the sphere has a "Wall" texture even though I've set the material to Surforge's Extent_Id0.

    Uniform scaling would be nice since there's no easy way to achieve given the current controls. It'd be nice to be able to shift-click on a side and have it scale along that axis uniformly. Shift-click a corner for two axes maybe have a center point appear for 3 axes scaling which would be useful for indicating a mode change. This shift to change behavior would be in line with what you have for chamfering edges and verts.
     
    Last edited: May 11, 2017