I'm working in Unity3D and I want to remove sections from a mesh at runtime similar to the idea of bombs removing sections of walls. In 3D modelling software this is a pretty standard Boolean operation, but it doesn't seem to be standard (or simple to implement) in game engines.

wall+bomb wall-bomb

I know this is possible because of projects such as SabreCSG, MegaFiers, and the various C# implementations of CGS.js

Unfortunately, SabreCSG doesn't seem to be usable at runtime, MegaFiers costs €134, and the C# versions of CSG.js mostly lack documentation and leave a whole mess of unnecessary polygons that mess with performance.

There must be a better way. Do any of you wise folks know what that better way might be?

  • \$\begingroup\$ CSG is not particularly cheap to perform, so it is not a feature of most real-time engines. Why don't you just clean up the left over polygons left by C# versions of CSG.js, and learn about CSG / mesh modification in the process? Otherwise, perhaps voxel levels are a possibility. \$\endgroup\$ – Engineer Mar 4 '19 at 17:05
  • \$\begingroup\$ Any idea how to clean up those polygons via code, or where I should look to find out? \$\endgroup\$ – JLC Mar 4 '19 at 17:13
  • \$\begingroup\$ As I don't know what process creates them, it's hard to say how to clean them up. Generally though, if it's stuff like non-closed surfaces, there will be an algorithmic way to identify and remove those. Hard to offer more without seeing the leftover bits and pieces, sorry. Maybe update your question with screenshots? \$\endgroup\$ – Engineer Mar 4 '19 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.