LogicalError / realtime-CSG-for-unity

Realtime-CSG, CSG level editor for Unity
https://realtimecsg.com
MIT License
732 stars 76 forks source link

Split models by operations? #383

Open ElgenTidwell opened 1 year ago

ElgenTidwell commented 1 year ago

I've been using realtime csg a lot recently (great tool, good work!) but I do have a serious suggestion. My use case for realtime-csg is for large levels (I'm too used to hammer to try and think of a different way of designing) and I do worry about performance.

As I think it should be standard practice, I split similar parts of my level into operations. I was thinking that maybe one way that large levels could be hugely be optimized is to optionally be able to split the built meshes by operations as well, so that when you bake occlusion for your level you can use occlusion on the csg meshes.

In this case, if you had a large building with several floors, if you split your floors into operations (and maybe even more splitting but this is a hypothetical) and only visible floors would be rendered. I think it could probably just be implemented by generating the meshes using the same algorithms and whatnot as normal, but the triangles for each brush are organized by which operation "owns" them, and split them after generation

nukeandbeans commented 10 months ago

This would require a lot of back-end changes with the native code (that actually does the CSG and data generation), which i don't know enough about to implement, along with a lot of rewrite for the managed side. This isn't the first time this has been brought up, and it'd most definitely be nice to have! It's normally suggested to just create a new CSGModel for each part of your level that you want to be separate. This is planned to be a native feature of Chisel in the future.