sabresaurus / SabreCSG

Level design tools for Unity
MIT License
1.37k stars 137 forks source link

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

Closed Henry00IS closed 6 years ago

Henry00IS commented 6 years ago

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

gildedhipbone commented 6 years ago

I think it's an interesting idea, but I'm a bit confused - what's the difference between the proposed voxel engine and just using prefabbed brushes?

Henry00IS commented 6 years ago

Having a voxel editor to place prefabbed brushes would work, you are totally right. But it may not be very efficient to have that many CSG brushes in the scene. Your building and saving times would suffer because of it. The reason for this is that every single brush, let's say a voxel cube, stores its 6 polygons with Vertices/UVs/Normals/Colors/Material/Etc. There is a lot of unnecessary copy&pasted data. I would have to try it out in practice to determine whether it's a viable solution.

It's more efficient to store multiple voxels in a few game objects called chunks and they are just lists of points in space and what type of shape and material these points are like the aforementioned cube. This makes it a very lightweight solution. The one complication is removing polygons that cannot be seen (which CSG brushes would do). This is easy for cubes and I have a working example but not for custom shapes. Food for thought.

Henry00IS commented 6 years ago

This made me thinking, I think answer is literally right in front of our eyes! Simply have the voxels with chunks, store a reference to the brush prefab in each voxel instead of making an actual brush and when SabreCSG rebuilds I feed it all the voxels and pretend they are all ordinary brushes! Increased build times sure but with the power of CSG and a very lightweight storage solution! Thanks @gildedhipbone, rubber duck debugging is the best!

Still this discussion is open to debate for everyone that sees this. What do you think about SabreCSG+Voxels? Don't let my geek talk distract you.

pedro15 commented 6 years ago

Btw unity adquired Pro builder and now it's free :) i think sabre CSG to CSG stuff and Probuilder to level desing.

Henry00IS commented 6 years ago

My opinion is biased toward SabreCSG as I am a collaborator on the project, however, I tried ProBuilder with high hopes when I heard the news and wasn't satisfied as it's just a bad version of Blender inside of Unity. The modelling workflow, at least in my opinion, isn't optimal for rapid level design.

Let's take this simple room. If I had used the modelling workflow, unless you can prove me wrong with ProBuilder, it would have taken me much longer to edit the ceiling and cut a window out of the wall. ProBuilder even has a door generator because it's such a pain to do.

Quick level prototyping with SabreCSG

No cheating, the ceiling may look like it's an independent part but the final output is a single optimized mesh like you'd want at the end of the day:

Showing an image from inside the ceiling so you can see there are no extra polygons

Anyway this is off-topic. This discussion is open to debate for everyone that sees this. What do you think about SabreCSG+Voxels (or more)? Don't let our modelling talk distract you.

pedro15 commented 6 years ago

Yeah, but i think that depends on the user workflow. both tools are great.

gildedhipbone commented 6 years ago

On that note, though I don't use ProBuilder, I think it'd be great if we could make Polybrush play nicely with SabreCSG.

Henry00IS commented 6 years ago

Polybrush does appear to work, but you can't rebuild the CSG model as that will undo the changes. Am I missing something @gildedhipbone? How can it be improved? I don't have much experience with this add-on.

image

But the geometry changes make it very difficult to use Sabre's tools as the brushes tend to be inside of it making it hard to see (well and it will undo your modifications).

gildedhipbone commented 6 years ago

I had some issues getting Polybrush to work with SabreCSG, but perhaps it was simply user error on my end. I'll give it a try again and report back. I was mostly interested in seeing if the texture blend tools could be used with SabreCSG, but perhaps it makes more sense to integrate such features into SCSG itself instead.

Henry00IS commented 6 years ago

I'm closing this issue. Sabresaurus also mentioned that, while Voxels are awesome they don't really fit into the CSG level design workflow and it naturally lends itself to a different kind of tool. We will come up with other awesome ideas instead I'm sure. This topic already inspired me. Thanks for all the feedback everyone I really appreciated it and hope we will brainstorm again in the future.