Brush-based CSG vs static mesh
Could you post links to the articles... I'm interested.
Isn't brush-based CSG a relic of the quake era and BSP based levels? I think most modern games use static meshes.
Brush based CSG is usually used at the content creation stage, and is converted into a static mesh during development, before the game even runs. It's just a different way to author content.
So you're comparing static meshes vs static meshes...
@[member='Hodgman'],
Sorry to bother you but you seem to have "been around the block"... am I misremembering things or was brush based CSG used in level editors like hammer and other BSP based engines?
am I misremembering things or was brush based CSG used in level editors like hammer and other BSP based engines?
Yes the Quake engines really popularized the CSG->BSP workflow, but even UE4 and Source still support CSG based mesh creation. There's also a bunch of CSG plugins for Unity, such as this.
It's a particularly good workflow for people who aren't experts at 3D modelling, but who want to quickly block out the shape of a level -- e.g. level designers :D
It's a particularly good workflow for people who aren't experts at 3D modelling, but who want to quickly block out the shape of a level -- e.g. level designers :D
Or programmers. My programmer-art CSG is way better than my programmer-art 3D modelling :D
Thanks everybody for your replies. They were very insightful.
Could you post links to the articles referred to in your original post? I'm still interested.
Could you post links to the articles referred to in your original post? I'm still interested.
Maybe its an Unreal specific thing, but their docs state: "Even though Static Meshes are better performance-wise, Geometry Brushes can occasionally be used without any serious impact as long as the geometry is simple."
Random forum posts, mostly Unreal related, seem to agree with the docs.
It would seem to me (intuitively anyway) that CSG would be faster for building a BSP since a brush will likely have fewer splitting planes than a complex mesh.
It would seem to me (intuitively anyway) that CSG would be faster for building a BSP since a brush will likely have fewer splitting planes than a complex mesh.
Maybe I'm misunderstanding you, but CSG in this day and age is surely being baked to static meshes, and not rendered via BSP tree.
Modern GPUs are really good at rendering static meshes.
It would seem to me (intuitively anyway) that CSG would be faster for building a BSP since a brush will likely have fewer splitting planes than a complex mesh.Maybe I'm misunderstanding you, but CSG in this day and age is surely being baked to static meshes, and not rendered via BSP tree.
Modern GPUs are really good at rendering static meshes.
What about for collision? Have BSP's been superceded?
that's very case by case dependent. Even mesh vs mesh.
What about for collision? Have BSP's been superceded?
Maybe I'm misunderstanding you, but CSG in this day and age is surely being baked to static meshes, and not rendered via BSP tree.It would seem to me (intuitively anyway) that CSG would be faster for building a BSP since a brush will likely have fewer splitting planes than a complex mesh.
Modern GPUs are really good at rendering static meshes.
Some low poly, huge level mesh, might be faster with BSP, a very complex mesh with smooth surfaces might generate an insanely huge bsp, while being super easy/fast to handle with an OBB or even grid based organization.
In most physics engines, you give it a static mesh and it converts it into some kind of internal format (perhaps, BSP, perhaps not) without you having to care :)
FWIW, in the Bullet physics engine, they use BVH.
If all your brushes are additive though, you can use the brushes directly as colliders, which actually has quite a few benefits over triangle soups!
If all your brushes are additive though, you can use the brushes directly as colliders, which actually has quite a few benefits over triangle soups!
Forgive me for my ignorance, I picked up Real-Time Collision Detection by Christer Ericson not that long ago and my expertise on the subject isn't quite there yet. Would you be able to elaborate on some of those benefits?
I'll take an educated guess: Triangles are more granular and would create more nodes in a BVH (e.g. a single triangle consumes one node) whereas brushes can be thought of as a node by themselves (e.g. all the triangles making up the brush consume only one node).
I don't know if it adds anything more than what everyone has already said, but here's a short article on the subject: What is the Difference Between Meshes vs Brushes in Unreal Engine 4? It's specific to Unreal but I think most of it applies in general.
Would you be able to elaborate on some of those benefits? I'll take an educated guess: Triangles are more granular and would create more nodes in a BVH (e.g. a single triangle consumes one node) whereas brushes can be thought of as a node by themselves (e.g. all the triangles making up the brush consume only one node).Sorry, I should've just mentioned at the time :lol:
Yeah, if the model is quite blocky or otherwise made up of primitive shapes, then a representation using primitive shapes will be more compact than a triangle mesh. The extreme of this would be if your model contains lots of perfect spheres -- a sphere primitive is a single entry in the tree and very easy to test for collisions against, while a trimesh requires a huge number of triangles to accurately represent a sphere.
Another benefit is that primitive shapes have a very well defined inside and outside. If you spawn an object deep inside a sphere, the physics engine knows that it's colliding with the sphere and should be pushed up to its surface. If you spawn an object deep inside a sphere-made-of-triangles, the physics engine has no way to know that the object is "inside" the sphere -- it only knows whether the object is touching the surface or not. In general this means that physics engines are better at resolving penetrating collisions when using solid primitive shapes than when using tri-meshes.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.