Coder Social home page Coder Social logo

sabrecsg's Introduction

SabreCSG

SabreCSG is a set of level design tools for building complex levels quickly inside Unity.

Using Constructive Solid Geometry techniques SabreCSG allows you to add and subtract brushes to create great levels without needing to understand 3D art packages.

Introduction Image 1 ADD AND SUBTRACT BRUSHES TOGETHER TO MAKE GREAT PLAY SPACES

Boolean brushes allow you to add and subtract arbitrary shapes together to rapidly create walls, rooms or carve out doors and windows. The brushes are used as a template for building the final geometry allowing you unprecedented flexibility for making minor tweaks or big changes simply by modifying the brushes.

POWERFUL BRUSH AND GEOMETRY TOOLS

SabreCSG comes equipped with a whole range of tools for editing brushes and geometry, from intuitive resize tools which let you quickly block out spaces to vertex and edge editing modes which let you go in and tweak in more detail, to advanced clipping tools allowing you to bevel or cut entire brushes in two.

Introduction Image 2
Introduction Image 3 APPLY MATERIALS AND EDIT UVs

With its surface tools, SabreCSG allows you to translate, rotate and scale surfaces, apply new materials, exclude faces from the final geometry for speed. And with newly upgraded features there’s a whole set of new helper functions to speed up your workflow.

SabreCSG was originally sold on the Unity Asset Store, but as of 14th October 2016 has been open sourced under the MIT License (see LICENSE for details). It is now maintained on this Github repository.

Core Features:

  • Boolean CSG algorithm supporting partial rebuilding.
  • Draw tools to rapidly create levels by drawing brushes directly.
  • Resize tools allow you to resize spaces intuitively.
  • Vertex tools to refine and add precision details.
  • Change materials or edit UVs with surface tools built for level design.
  • Clip planes allow you to bevel brushes or even split them in two.
  • Export built geometry to .OBJ for use in external 3D tools.
  • Vertex Colors - Apply vertex colors per face which are baked into the built meshes.
  • Experimental Code API - Experimental support for procedurally generating levels through code.

Documentation and videos on how to use SabreCSG are available at the SabreCSG Learn website or the wiki.

Download

Download SabreCSG

Installation Instructions

Documentation

Visit Wiki Pages

Join the Official SabreCSG Discord Server

Donations:

If you love SabreCSG and wish to say thanks then please feel free to make a donation. Your donations are a huge motivator to continue the development of SabreCSG.

paypal

sabrecsg's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sabrecsg's Issues

Playtesting obliterates edit mode

When you have a brush selected because you edited something, start playing the game, stop playing the game, edit mode is gone until you select another brush or alike. It's annoying and should be easy to fix.

[FEATURE REQUEST] Add runtime mode tools

I know there's a code API to make levels at runtime, but I suck at making things like handles for vertices, etc.

I'd like to request a 1:1 equivalent of SabreCSG tools that work at runtime (without Unity). My reasoning is that I want to add extensive level editing to my game. Thing that I have now works, but it isn't too good. I want players to make levels without the need to fight with assetbundles and so on, directly in the game. Therefore, runtime version of SabreCSG would greatly help achieve this.

Ability to serialize/deserialize resulting level data into arrays of basic types, so they can be then stored as part of custom binary data format I've developed for my game would be welcome.

Note that I am unable to do such port myself, otherwise I'd be doing it right now instead of talking.

Unity version compatibility

Hey this is a bit of a question / Request.

  1. Would it be possible to get the version of Unity that SabreCSG is compatible with listed at the top of the readme?

  2. What version of Unity is SabreCSG compatible with?

Thank you for your time,

HeadClot

Create UV Editor Window; or better curved UV algorithm.

Curved brushes are incredibly difficult to UV map seamlessly with the surface tools currently available in SabreCSG. AutoUV can't generate satisfying UVs. It would be nice to have a UV editor window that can deal with these types of scenarios or introduce another AutoUV that can handle curvature better.

image

uvreason1

uvreason2

Edit: Research Notes

License question about integration into the game

Hi im making a tycoon game where currently im using sabre to dynamically build walls on runtime
image

Since we have planned asset editor for the game (buildings, props, cars..) is it possible to integrate sabre toolset for runtime use in asset editor in game? I'm asking - does license allow me this?

Persisting built geometry including texture/material

I've been looking around, but can't find anything on the topic.
I need to be able to store a SabreCSG model to be loaded in at runtime (level instansing and such).
I know there is a way to build the geometry built in SabreCSG into a .obj file, however this strips away any textures previously applied to the model.
I have tried to create a prefab with the SabreCSG model in it, but whenever I pull it into a scene the model needs to be re-built. This is an issue since there is no run-time brush-building from what I've gathered. It also breaks any prefab instance, meaning that if I later update the prefab it will not reflect in the scene. Is there a way for us to be able to persist the full SabreCSG model including textures other than keeping it stored in a scene and loading that in?

Thanks!

ShapeEditorWindow.cs error

Hi.

I put the SabreCSG-master zip file content into assets folder and i am getting following errors. There is no sabrecsg object in the GameObject menu. I tested with Unity 5.6.5f1 and 2017.1.2f1.

Assets/SabreCSG-master/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs(990,49): error CS0117: UnityEngine.Screen' does not contain a definition for safeArea'

Assets/SabreCSG-master/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs(990,113): error CS0117: UnityEngine.Screen' does not contain a definition for safeArea'

Assets/SabreCSG-master/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs(1350,40): error CS0117: UnityEngine.Screen' does not contain a definition for safeArea'

Assets/SabreCSG-master/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs(1480,47): error CS0117: UnityEngine.Screen' does not contain a definition for safeArea'

Assets/SabreCSG-master/Scripts/Brushes/CompoundBrushes/Editor/ShapeEditorWindow.cs(1480,131): error CS0117: UnityEngine.Screen' does not contain a definition for safeArea'

Terrain / Displacement Editor

Due to an ongoing discussion on Twitter and a quick proof of concept:

Terrain using a single brush

This proof of concept only uses a single concave brush.

I am considering to actually go ahead and add displacement / terrain to SabreCSG.

Because I am using a single concave brush the CSG algorithm can't process it properly (although it does work well if a subtractive brush goes through the brush completely but it's better to use NoCSG). Optimize Geometry breaks the surface but I think it may be possible to exclude the brush from the optimization process (edit: confirmed, this is easy to do).

It may also be possible to, similar to the 2D Shape Editor, have multiple small convex brushes so that you are able to subtract it- or from it for special level design cases. Just to have the option.

Concave Brushes

I assume this happens because concave brushes are currently not supported.
test
I'm curious about the implementation of concave brushes. Is it a matter of automatically converting a shape like the above to a set of convex brushes?

Extrude Face puts the face in the wrong place when 2D Shape Editor Brushes not at origin

Heres a 30second video showing the problem (its easy for me to reproduce)
http://somup.com/cFe2fpVBu1
( its unlisted so anyone who has the link can see it but it won't be in the youtube search results)

Briefly summarizing the video: When I do the "extrude face" function it works on default cubes, but trying to extrude face on a shape made by the 2d shape editor has a problem: the extruded face is placed near the origin and not on the original face where it should be.

The problem seems to only happens if the Shape Editor Brush is not located at 0,0,0
Heres another video showing me narrowing down the problem space
http://somup.com/cFe2f8VBui

How can I help?

Weird wireframe behavior based on far away brush

So I just downloaded SabreCSG like half an hour ago and started playing around. It's been many years since I've used a level editor so it's kind of fun to relearn it.

Anyway I came across an odd issue, this is a screenshot of some mesh in a 'doorway'.

image

The black triangle is caused by overlapping faces from what I can surmise. This is the wireframe

image

The wall/corridor intersect is crated by having a large box with 2 smaller boxes. This is the entire end wall in wireframe

image

I was very confused by the circular wireframe until it struck me that it may be defined by a brush that's no where near it, and that turned out to be true.
In the following screenshot I've moved the camera back even further so it's as sort looking into the room it was inside before.

image

image

As you can see the circular wireframe makes sense for this doorway but for some reason the same structure is repeated on the next wall.
To clarify, I'm hollowing out a large cube to create an interior scene, this may be why it's acting out..?
Cause the same pattern is repeated on the wall at the very front of the cube as well even though that's it's even further away from the cyllindrical remove brush.

image

I'd be happy to upload the scene too if that's necessary.

Playmode editor support

More of a question about the viability rather than a feature request. Is it possible to port the editing tools to work at runtime? Probably with some prefab to place in a scene that handles the editing controls.

I'm happy to try and build this myself, but was wondering if there were any immediate gotchas or issues that would make it too impractical.

How to enable/disable (or hide/show) mesh at runtime

I'm stuck at trying to get a reference to the generated GameObject in Start()

I've got several CSG objects in the scene and I want to keep autobuild switched on. I can't get the mesh by name as it's always called "MeshGroup". I can't find a method or property that returns the generated mesh. Do I need to use events/callbacks or am I missing something obvious?

See-through pixels in triangle seams and lighting artifacts

I have been encountering this issue every time I create a dark environment. The triangulation seams are all slightly separated (I guess?) allowing very thin dynamic light to shine through as well as the skybox to be seen through thousands of flashing bright pixels.

seethroughpixels

I made a script that causes the player to "breathe" by slightly moving the camera up and down over time, it makes this extremely noticeable. I am actually looking into this problem myself I just figured I should start a discussion here as it may require the author's CSG knowledge to figure this out. ;)

Support for heavily scaled brushes.

I'm trying to import a level from another engine that uses CSG. The imported brushes are scaled, rotated and pivoted to oblivion (including root CSGModel). Support for this would be fantastic.

Compiler error in Unity 2017.1.0f3

Assets/SabreCSG-master/Scripts/Core/CSG/Polygon.cs(168,36): error CS0029: Cannot implicitly convert type `void' to `UnityEngine.Plane?'

I'd guess that:

cachedPlane = cachedPlane.Value.Flip();

could just be:

cachedPlane.Value.Flip();

Have better names than "AppliedBrush"

I am probably going to be adding some automatic naming:

Cube Brush
Cylinder Brush
Shape Editor Brush

As long as you don't modify them I want them to appear more obviously than:

AppliedBrush
AppliedBrush (1)
AppliedBrush
AppliedBrush (1)
AppliedBrush (2)

It would even be possible to have blue/red/purple preview icons of the type in the hierarchy instead of just the + - and square. What do you think?

Brush moves erroneously when set to non-one scale

Great addon! I've been using it for a bit, but ran into something today that caused a lot of head scratching until I finally figured out what I had done wrong. Every time I grabbed a few brushes to move them with the resize bounds tool, they moved both faces on the edited axis to an unexpected position.

Repro steps:

  1. Click cube to place a cube.
  2. Set scale to 5, 5, 5
  3. Grab bounds resize handles -- now moving the brush causes it to re-center

Suggestion:

If non-one scale is not supported, then could just display a warning to user when they attempt to set a non-one scale and reset it back to a proper value.

Support for Vertex Snapping

Whenever I have edge cases (get it?) like this:

image

I wish I could just use the same vertex snapping Unity provides while holding V. It would be a miracle and make the workflow so much easier. Is it possible to add support for this?

Curved Staircase shifts position after changing settings

By default a primitive brush builder will retain its bounds while changing the settings. That was a problem with my curved staircases as it changes dimensions like crazy and if it keeps the original bounds it will just get squashed and it's a mess. PrimitiveBrushInspector/ResetPolygonsKeepScale():92

Now I just reset the brush and apply the new geometry, that's great, but every time you move the curved staircase around with the bounds tool and change the settings again it will move around in unexpected ways. I think it may be resetting the pivot position but I am not entirely sure.

Can you give me some advice on how to fix this behavior? PrimitiveBrushInspector/ResetPolygons():82

This is no reason to ignore the pull request, it's just annoying to the end user when you make edits later and it keeps flying away from you slightly and you have to align it again.

My desired end-result would be freezing the translation in place. So it would become ResetPolygonsKeepTranslation().

Built CSG Model Disappearing

First off, this issue only occurs when the user is being a bit daft. However, it still may happen in the rush of editing and could ruin an entire CSG model.

This is how I've been re-created the problem. Draw a shape on a surface without extruding it.
layer 4
Draw another shape overlapping the first one.
layer 5
Extrude.
layer 6
The extruded shape isn't converted to level geometry. The following error message pops up:
"Polygon splutting has resulted in two zero area polygons. This is unhandled. UnityEngine.Debug:LogError(Object)"
layer 7
Realizing one has made a mistake, the natural inclination is to undo the action. This causes the entire CSG model to lose it's level geometry. From this point it's no longer possible to select any of the brushes in the hierarchy.
layer 8
Re-doing doesn't help.
layer 9
The only fix I've discovered is to remove the conflicting shape(s) and move the remaining brushes to a new CSG model.

[Request] This wire-frame bug should be a feature!

When you reload scripts while in edit mode the blue and orange faces disappear and you are left with a very clear wire-frame that makes it much easier to see what you are doing. I personally prefer this over the current system:

Bug mode:
image

Current mode:
image

Bug mode:
image

Current mode:
image

In my opinion this should at least be a checkbox in the preferences window.

Draw/Extrusion Behavior

I have some thoughts on how extrusion behavior is currently implemented. I hope they make sense! If not, tell me and I'll try to clarify.

First off, drawing on surfaces generally works quite well, but I think there's room for improvement:

  1. If "Auto Rebuild" is enabled, rebuild the model while extruding a shape. Besides enhancing the WYSIWYG aspect of SCSG, this would increase visibility when brushes are hidden. On that note...
  2. The wireframe shape preview disappears behind/into built geometry. It would be preferable if it stayed visible at all times.
  3. If extruding "into" a surface, automatically make the shape/brush subtract.
  4. Finally, automatically select the newly created brush.

Couple of words on extruding faces:

  1. Like when drawing shapes, allow the user to set the direction and extent of the extrusion simply by moving the mouse.
  2. Rebuild while extruding (if "Auto Rebuild" is enabled).
  3. If extruding into a surface, automatically subtract.

Feature Request: Guide Lines

screenshot 2018-05-02 21 50 00

These red lines along the edges of a brush when you are moving it in Trenchbroom are horrendously useful when aligning geometry. Would be awesome to get them in SabreCSG!

Random Holes in faces

OFten when I use csg I will get holes in the face of a model, while I can't explain the problem I do have examples such as this wall:
image
image

But more often than not I'll get this problem from using the subtraction brush to hollow out a cylinder
image

Here's the error message I get with the cylinder example
Zero normal found, this leads to invalid polyhedron-point tests UnityEngine.Debug:LogError(Object) Sabresaurus.SabreCSG.PolygonFactory:ConstructPolygon(List1, Boolean) (at Assets/SabreCSG-master/Scripts/Core/PolygonFactory.cs:331)
Sabresaurus.SabreCSG.PolygonFactory:SplitPolygonsByPlane(List1, Plane, Boolean, List1&, List1&) (at Assets/SabreCSG-master/Scripts/Core/PolygonFactory.cs:113) Sabresaurus.SabreCSG.BrushChunk:SplitByPlane(Plane, BrushChunk&, BrushChunk&) (at Assets/SabreCSG-master/Scripts/Core/CSG/BrushChunk.cs:272) Sabresaurus.SabreCSG.BrushBuilder:SplitAndRemove(LinkedList1, BrushCache, Int32[]) (at Assets/SabreCSG-master/Scripts/Core/BuildEngine/BrushBuilder.cs:465)
Sabresaurus.SabreCSG.BrushBuilder:Build(BrushCache, Int32, BrushCache[], Boolean) (at Assets/SabreCSG-master/Scripts/Core/BuildEngine/BrushBuilder.cs:55)
Sabresaurus.SabreCSG.CSGFactory:CoreBuild(Object) (at Assets/SabreCSG-master/Scripts/Core/BuildEngine/CSGFactory.cs:266)
Sabresaurus.SabreCSG.CSGFactory:Build(List1, CSGBuildSettings, BuildContext, Transform, MaterialMeshDictionary, List1, Boolean, Boolean, Action1, Action2, Action2, Boolean) (at Assets/SabreCSG-master/Scripts/Core/BuildEngine/CSGFactory.cs:100) Sabresaurus.SabreCSG.CSGModelBase:Build(Boolean, Boolean) (at Assets/SabreCSG-master/Scripts/CSGModelBase.cs:196) Sabresaurus.SabreCSG.CSGModel:Build(Boolean, Boolean) (at Assets/SabreCSG-master/Scripts/CSGModel.cs:213) Sabresaurus.SabreCSG.Toolbar:OnBottomToolbarGUI(Int32) (at Assets/SabreCSG-master/Scripts/UI/Toolbar.cs:295) UnityEditor.DockArea:OnGUI()

Shouldn't compound brush variables be public for Runtime CSG?

I have never tried using the Runtime CSG library before but one thing that always seemed odd is that we made all of the compound brush variables private like this:

        [SerializeField]
        float stepDepth = 0.2f;
        [SerializeField]
	float stepHeight = 0.1f;
        [SerializeField]
        float stepDepthSpacing = 0f;
        [SerializeField]
        float stepHeightSpacing = 0f;
        ...

Doesn't that make it extremely difficult if not nearly impossible to use compound brushes?
Should we make them public or add properties for them?

Grid Performance

This is perhaps only apparent to users on weak setups (like mine), but having the grid enabled is noticeably taxing. This problem is exacerbated when decreasing the grid scale.

I don't know how badly this would break things, but would it be possible to handle the grid rendering with a shader?

Clicking on a face, make it´s texture distorted and shows the error

Clicking on a face, make it´s texture distorted and shows the error:

IndexOutOfRangeException: Array index is out of range.
Sabresaurus.SabreCSG.SurfaceEditor.TransformUVs (Sabresaurus.SabreCSG.Polygon polygon, Sabresaurus.SabreCSG.UVTransformation transformationMethod, Sabresaurus.SabreCSG.TransformData transformData, Boolean recordUndo) (at Assets/SabreCSG-master/Scripts/Tools/SurfaceEditor.cs:1037)
Sabresaurus.SabreCSG.SurfaceEditor.TransformUVs (Sabresaurus.SabreCSG.UVTransformation transformationMethod, Sabresaurus.SabreCSG.TransformData transformData, Boolean recordUndo) (at Assets/SabreCSG-master/Scripts/Tools/SurfaceEditor.cs:985)
Sabresaurus.SabreCSG.SurfaceEditor.OnMouseDragTranslate (UnityEditor.SceneView sceneView, UnityEngine.Event e) (at Assets/SabreCSG-master/Scripts/Tools/SurfaceEditor.cs:391)
Sabresaurus.SabreCSG.SurfaceEditor.OnMouseDrag (UnityEditor.SceneView sceneView, UnityEngine.Event e) (at Assets/SabreCSG-master/Scripts/Tools/SurfaceEditor.cs:280)
Sabresaurus.SabreCSG.SurfaceEditor.OnSceneGUI (UnityEditor.SceneView sceneView, UnityEngine.Event e) (at Assets/SabreCSG-master/Scripts/Tools/SurfaceEditor.cs:108)
Sabresaurus.SabreCSG.CSGModel.OnSceneGUI (UnityEditor.SceneView sceneView) (at Assets/SabreCSG-master/Scripts/CSGModel.cs:506)
UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2075)
UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1405)
UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1242)
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)

saber

Dark lighting on scene load

There is a bug between SabreCSG and Unity with its continuous building of lighting, when this is switched off (as SabreCSG does when you create a CSG Model to prevent small edits causing rebakes all the time) then the lighting comes in too dark for some reason on reloading the scene, this is an issue outside of SabreCSG (e.g. see this thread and this thread)

You can turn "auto generate" back on in the lighting window which may be okay depending on your level/lighting set up, or alternatively hit the Generate Lighting button on a scene load.

In the second link helgewl mentions a solution which could help and remove the need for SabreCSG to turn off auto lighting

Alternatively we could cache the state of auto lighting when the user turns on Auto Rebuild, turn it off, then restore it when SabreCSG or Auto Rebuild is disabled

Shadow on fulll effect area

A shadow could appear on a full effect area.
bug1_sabrecsg

This could be fixed by enabling the Shadow area to be Two-Sided, but changing it manually would be quite a hassle.

An option to choose the Shadow Type of the Mesh would be wonderful.

Polygon splitting csg slowdown

Similar to #8, I'm receiving a ton of errors when placing halved cylinders of different sizes in subtract mod next to each other.

Polygon splitting has resulted in two zero area polygons. This is unhandled.
UnityEngine.Debug:LogError(Object)
Sabresaurus.SabreCSG.PolygonFactory:SplitCoplanarPolygonsByPlane(List`1, Plane, List`1&, List`1&) (at Assets/SabreCSG/Scripts/Core/PolygonFactory.cs:200)
Sabresaurus.SabreCSG.TriangulationNode:.ctor(List`1, List`1) (at Assets/SabreCSG/Scripts/Core/BuildEngine/TriangulationNode.cs:24)
Sabresaurus.SabreCSG.TriangulationNode:.ctor(List`1, List`1) (at Assets/SabreCSG/Scripts/Core/BuildEngine/TriangulationNode.cs:53)
Sabresaurus.SabreCSG.TriangulationNode:.ctor(List`1, List`1) (at Assets/SabreCSG/Scripts/Core/BuildEngine/TriangulationNode.cs:53)
Sabresaurus.SabreCSG.TriangulationNode:.ctor(List`1, List`1) (at Assets/SabreCSG/Scripts/Core/BuildEngine/TriangulationNode.cs:53)
Sabresaurus.SabreCSG.TriangulationNode:.ctor(List`1, List`1) (at Assets/SabreCSG/Scripts/Core/BuildEngine/TriangulationNode.cs:53)
Sabresaurus.SabreCSG.TriangulationNode:.ctor(List`1, List`1) (at Assets/SabreCSG/Scripts/Core/BuildEngine/TriangulationNode.cs:53)
Sabresaurus.SabreCSG.TriangulationNode:.ctor(List`1, List`1) (at Assets/SabreCSG/Scripts/Core/BuildEngine/TriangulationNode.cs:52)
Sabresaurus.SabreCSG.Optimizer:CalculateConvexHulls(List`1) (at Assets/SabreCSG/Scripts/Core/BuildEngine/Optimizer.cs:196)
Sabresaurus.SabreCSG.BrushCache:OptimizeCollision(BrushCache) (at Assets/SabreCSG/Scripts/Core/BuildEngine/BrushCache.cs:554)
Sabresaurus.SabreCSG.CSGFactory:CoreBuild(Object) (at Assets/SabreCSG/Scripts/Core/BuildEngine/CSGFactory.cs:430)
Sabresaurus.SabreCSG.CSGFactory:Build(List`1, CSGBuildSettings, BuildContext, Transform, MaterialMeshDictionary, List`1, Boolean, Boolean, Action`1, Action`2, Action`2, Boolean) (at Assets/SabreCSG/Scripts/Core/BuildEngine/CSGFactory.cs:100)
Sabresaurus.SabreCSG.CSGModelBase:Build(Boolean, Boolean) (at Assets/SabreCSG/Scripts/CSGModelBase.cs:196)
Sabresaurus.SabreCSG.CSGModel:Build(Boolean, Boolean) (at Assets/SabreCSG/Scripts/CSGModel.cs:213)
Sabresaurus.SabreCSG.CSGModel:OnEditorUpdate() (at Assets/SabreCSG/Scripts/CSGModel.cs:1180)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

This also results in the CSG model's performance dropping drastically when using Auto Rebuild. I'm assuming I'm messing up, but I'm new to Unity and can't figure out what I'm doing wrong 😒

Experimental: Introduction + Applied Brush visibility while paused

Hi all, I'm new to sabreCSG but it's clearly the tool for outputting rock-solid CSG operations. I've been playing around and I'll definitely be using it to create a randomly generated map in my game. I've written 2D CSG in the past and would love to help with SabreCSG's development, but I've never contributed to any open-source projects before. If anyone could point me in the right direction that'd be appreciated. For now I could help produce examples for the experimental API until I'm more familiar. I'm working on something that I'd be happy to submit as an example but I don't see the other two in the branch.

Also Is it possible to render subtraction brushes (or any brushes) while paused? It seems the AppliedBrush objects still exist after calling build, but you can't see the mesh or shape they represent at all. Enabling/disabling components on the right is prohibited. I have no experience scripting for the unity editor or I'd take a look at it myself.

🎥 Please contribute a SabreCSG 2D Shape Editor tutorial video!

If you wish to contribute a SabreCSG 2D Shape Editor Tutorial please do so and post a link to the YouTube video in this issue! We will feature it in the wiki in several places for all to see.

Here are some suggestions that could be covered in the tutorial:

This is just a suggestion, feel free to do what you think is best. If you wish to make a small series, go ahead. As we sadly don't get paid I don't have the right to tell you what to do anyway.

You can use this wiki page for more information.

To anyone interested, thank you so much, I can't wait to see what you come up with! :)
If you have any questions please feel free to ask me here.

[Request] Group Brushes Using Shortcut + Selection Behavior

It's possible to group brushes by creating an empty GameObject and inserting the brushes as children. Could this be handled automatically? E.g. select the brushes you wish to group, press Ctrl+G and a parent GameObject is created.

Also, it would be convenient if selecting a parent GameOject selected all the children. And/or, if there was a option to select the entire group when clicking a child. Is this feasible? Perhaps it would make more sense to group brushes using some specific Sabre CSG object instead.

The Tilemap overlay conflicts with the Sabre UI

Unity added 2D tilemaps in version 2017.2. When you have a tilemap in your scene, it displays a little popup in the bottom left corner. This popup allows you to view the tilemap in isolation from the rest of the scene so it's not obstructed by any other elements.

Anyway, the Tilemap popup often ends up on top of the Sabre UI:

Screenshot showing Unity's tilemap popup on top of the Sabre UI

When this happens, I can't click on anything in Sabre. It's not just the area under the tilemap popup that's affected; nothing works, not even the tabs in the top right. The presence of the tilemap popup appears to block all mouse events to the UI layers below it.

There's a workaround for this: deselect your applied brush and select it again. When you do that, it puts the Sabre UI back on top, allowing you to interact with it. But as soon as you deselect your brush, the tilemap popup gets back on top.

[Feature Request] Hide (Not Exclude) Faces

I often exclude faces for visibility purposes when editing, but this affects the lighting in some cases. Would it be possible to add an option to hide rather than exclude faces, allowing them to still create shadows? (Apologies if I've missed something obvious)

Support for EditorXR

...would be astonishing.

However I'm sure it's not trivial. I thought it would be worth leaving this here as a placeholder as I'm not going to be the only person dreaming of level design with a headset on.

I'm going to wait for a few more examples of custom additions to EditorXR to surface to see how complex it is to add in support. So far I've only found two (neither of which are actively being updated):

https://github.com/ajcampbell1333/unity3d-editorvr-hierarchymode

https://github.com/peteyhayman/Zodiac

Allow CSG Operations on Groups

From the discussion in #58.

image
I have this L-shaped brush. As you can see, I created it by subtracting one brush with another. I've grouped the two brushes and I'd like to be able to treat them as a single brush.

In this case I'd like to use this particular group to subtract L-shaped holes in a wall - in other words, I'd like to be able to set the group to subtract, I guess essentially "inverting" the childrens' current mode (while hiding this from the user!).
image

image

Is SabreCSG as "level design tools" limited to just CSG? Voxels.

We have Constructive Solid Geometry and that's incredible, but is SabreCSG limited to just being a CSG tool or can it develop further and provide more level design tools?

For example, what if we introduce SabreCSG Voxel Inside® with a voxel engine alongside CSG? You could combine both to create an even more powerful tool. YuME - Yuponic Map Editor uses small tile prefabs instead of just cubes to easily create detailed worlds. We could transform CSG models into one or more voxels allowing you to rapidly create new tiles without ever leaving the editor (and/or have a dedicated 3D Shape Editor).

As we tend to stay on the grid with CSG brushes, voxels would nearly always align perfectly and there are ways to have multiple grids and voxel sizes to cover all cases. I would love to hear some opinions.

SabreCSG Voxels - Yes I already have some WIP

Add a button to fix the shiny matte ugliness.

You often get this very ugly matte shine:

image

The problem is the reflection probe, making the reflection probe black will cause all metals to be black which is not what you want, in the "MaterialMesh" settings you can disable reflection probes:

image

To get the result you'd want:

image

But SabreCSG forgets this setting after every rebuild. Perhaps this should be the default- or have a checkbox in the CSG Model settings that's like:

Common Fixes
[ ] The world is shiny and weird

As I am not sure everyone will immediately realize it's the reflection probe causing this, like me, and even exposing the reflection probe settings in the CSG Model may then not help anyone figure it out at first.

[Request]Example how Materials can be changed in the script

I would like to see an example how I can change material with my own script. I'm thinking of creating some predefined "blocks" and then randomly changing the material to some existing material that I have given in a list.
And I want to decide which faces I will replace with the new material.

Does someone have some experience of doing such a thing with SabreCSG? Thanks.

New group brushes jump to 0,0,0 on first movement

When you create a new group brush by pressing G and then use the bounds tool the group will jump to 0,0,0. After this occurs once, the group will work as expected from there on out. You can undo the jump. This happens because the bounds are unknown at the creation of the group brush (Awake()) but are set once invalidated for the first time. The code that prevents resizing the group on invalidate will mess up and jump to 0,0,0.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.