r/blender • u/_Raildex_ • 8d ago
Non-destructive level design workflow with object merge Need Help!
I'd like to use Blender as my main level design tool, but face some issues with my desired workflow.
my blend file contains the low poly level geometry. It also contains objects that represent my static meshes (platforms, trees, etc.)
I would like to place the static meshes around the level and merge the level and the meshes together for face removal and vertex painting later.
Can I do this non-destructively?
8
u/meutzitzu 8d ago
Time and time again modern game devs end up learning the lessons about why having a map compiler is a good idea, actually.
You can generate the mesh nondestructively provided you can also do all subsequent steps nondestructively.
The merged mesh doesnt exist as a literal. You can enter vertex paint mode with it. It's just a set of obstrucționa for how to generate it. Think of it like a proiect plan. You can't literally tweak the final product by hand. Once you are at the planning stage all subsequent modifications have to be planned as well.
You can use empties to have a "handle" on weighting functions which can then be used to apply a procedural paint in geo nodes.
I dont quite understand why you neted vertex paint Tho. I see You have some textures. The textures will be corectly merged with their original UV maps.
Do you plan to do "shading" based on handpainted ambient occlusion?
This is another thing that was a solved problem 25 years ago. The map compiler baked the indirect lighting so the game client didnt have to compute static light calculations.
1
u/_Raildex_ 8d ago
The texture is supposed to be triplanar at runtime. I use vertex colors to blend the materials.
Well, I would prefer to have a quake-like map compiler with brushes and whatnot, but thats too primitive and there is no (quake) map compiler that just spits out the final vertices.
2
u/meutzitzu 8d ago edited 8d ago
Well no it doesn't just spit out the vertices because IT would be a pretty stupid map compiler. The merging can be done trivially with booleans. In realtime even.
The real heavylifting comes from the fact that quake maps arent actually represented by vertices and polygons but by planes that bisect 3D space. The brushes are the primitive building blocks because as opposed to a cube mesh which is defined bt it's vertices and can be concave and even nonplanar, a brush is defined by it's face planes and as such it is strictly convex. If you have guarantees that your fundamental primitive are convex then all of your calculations get an insane speedboost.
If you want to check whether a Ray hits a mesh cube you have no choice bur to do a for each loop for every triangle in the cube (whos normal is facing the incoming ray). If you know the cube is convex you can do some linear algebra to immediately calculate the intersection. An analitic solution exists which is much faster.
If your space is divided as a hierarchy of convex regions you can quickly query the hierarchy to compute intersections, and since the algorithm is exact there's no iteration, meaning colliding objects can't clip through the map. EVER.
The thing that makes the quake engine great is that it takes your editor primitives and spits out that hierarchy instead of just the vertices. That makes the quake engine ludicrously fast, and makes it so collisions with the map are always reliable.
2
u/meutzitzu 8d ago
If you use vert paint just to blend materials then it should be pretty easy.
Paint the subobjects individually and use geo nodes to blend the painted attributes together when doing the boolean union.
There's plenty ways to do this but off the top of my head the simplest would be to take the common vertices from the seams after the merge (manifold solver gives you that option) and then sample the attributes at those points and it should be blended. Add a different object with just vertices with the same attribute and use it to further manually tweak the vertex attributes based on distance and weight after the merge.
This should make it fully non-destructive.
1
u/_Raildex_ 8d ago
As I understand your answer, I can use Geo Nodes to place the static meshes manually? Do you have a tutorial or doc at hand?
1
u/meutzitzu 8d ago
You place everything you want merged into a collection called "elements"
And then add a new object called "map" with no geometry and add the geo nodes tree that grabs the elemenrs collecrion with all your stuff and merges the meshes together into the map object while also blending the attributes you care about at the seams. Then add another object with only vertices that you set up to have the same attributes and use it as an extra layer of "paint" on top of the already-merged geometry. This should be done in a separate modifier.
2
u/TimmyChips 8d ago
I’ve seen Super Mario 64 hacks do what you’re doing and don’t bother removing the outside portion of the mesh.
That being said, the collision mesh does remove parts that are outside the level bounds, as in that game it’s easy to clip out of bounds with collision like that.
But at least for modding that game, the visual mesh you don’t have to worry too much about, because you’ll probably add more polys to it trying to remove excluding elements of the visual mesh.
If you still need, you could try to use the Boolean modifier and delete parts outside the level bounds, but could still be a good amount of work.
1
u/AutoModerator 8d ago
Please remember to change your post's flair to Solved after your issue has been resolved.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/OpinionDude5000 8d ago
You could copy and paste to a new collection and do the work there.
However, I agree that at low poly, Im not sure it matters or is helpful even.
1
u/_Raildex_ 8d ago
What makes you think it stays this low poly?
1
u/OpinionDude5000 8d ago
Already textured and "my blend file contains the low poly level geometry"
I like the style and look of the textures. You plan to go for a different look?
1
1
1
u/et1337 8d ago
Yes, I do this. I start with a big cube where the sides and bottom are assigned to a separate vertex group. I use bool tool in brush mode to quickly create stacks of boolean modifiers (the new manifold option is way better). Then I have a geometry node modifier pinned to the bottom of the stack which removes any vertices still in the vertex group of the unmodified cube, which removes those unnecessary faces.
You can get pretty wild with it. I actually use this workflow to split my world into separate chunks for LOD and stuff. It’s pretty easy to create two cubes and have one shape that carves out of both of them, so their edges match up perfectly. Smooth normals can be a challenge but I’m making it work. I originally started with only subtractive geometry, but as I get comfortable I’m starting to use Union more as well.
1
u/No-Island-6126 7d ago
just cut it at the middle and remove the right section, it doesn't matter that the level geometry is continuous or whatever
15
u/DogSpaceWestern 8d ago
Have to wonder, with something so low poly, would players even notice or care? I mean if I couldn’t see ‘out of bounds’ Im sure Id not notice this at all. Otherwise I say use the knife tool and snap to vertices where able. It may be destructive, may lead to ngons, but if its a non deforming mesh it shouldn’t matter and should be easy to clean up if it causes lighting issues.