Open Henry00IS opened 6 years ago
Here is some recent news from Discord, why aren't you on our Discord yet?
I found a way to build convex terrain with planar polygons, I believe this mspaint.exe image is the key to success:
Imagine these are 4 convex brushes (top-down view). No matter how you move any of these 5 vertices up or down the faces will remain planar (imagine a quad that gets cracked into two triangles, that's non-planar and very bad for CSG and the tools).
As this solution is convex it means SabreCSG can cut holes into it with subtractive brushes, you can make caves and such unlike Unity's terrain system.
The convex terrain theory has been tested and does indeed work well:
(this uses the new subtractive brush fix PR)
Due to an ongoing discussion on Twitter and a quick proof of concept:
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.