|Topic was automatically imported from the old Question2Answer platform.
I’m creating a city procedurally, for that I’m using CSG nodes in code to generate the houses, but right after I added the houses to the city, the game took forever to load.
I wanna know witch are the methods available to optimize the performance on my case.
Also, I heard that CSG nodes are just for prototyping because of the performance weight related to it, is that true?
why are you using CSG nodes? Why dont you use simple mesh instances?
You know, CSG nodes are for boolean operations on meshes!?
klaas | 2021-07-20 19:12
Hi, I first tried with MeshInstances, but I had problems with faces sharing the same space, now I’m using CSG nodes with union and subtract operations, witch makes a lot easier to program
JayJay99 | 2021-07-20 22:27
CSGs being a boolean operator means that every single frame they are updated (i.e, moved or in your case added to the scene), they all have to perform a calculation on how to intersect their geometry. The more you have, the worse it gets until your game won’t run anymore. In general, you can estimate their performance hit by updating them in the editor (because they lag the editor too).
But CSGs are more intended to be fully modelled (and calculated) in the editor — for now at least, there’s no way to fix that terrible performance aspect at runtime, as they weren’t designed with that use in mind.
You could maybe create them as a scene and instance the scene…? I’m not sure if that would still have a performance hit or not. And in using MeshInstance, maybe you could model with quads in places where you have geometry overlaps (so, more work but then you won’t have overlaps).
Yuminous | 2021-07-21 00:17
Make sure to use separate node trees for CSG operations. Don’t cram all CSG nodes under a single CSG node; only use boolean operations where you actually need them
Calinou | 2021-07-21 01:18