I saw some uv related code in the pr, so does it mean that CSG2 added uv remapping on top of Manifold, and meshes with uv mappings would work correctly after booleans?
Yes:)
It seems every toMesh
call makes a new material here. Is it possible to make an option that makes toMesh
reuse existing material, instead of making new one every time? Maybe a material: BABYLON.Material | BABYLON.MultiMaterial | undefined
option
WoW. Kudos to you . After all this time, I didn’t think anyone would have the ‘guts’
to dig into this ‘blackhole’
… and then, come up with this
This is not an evolution, it’s a R-evolution. Pure force unleashed. Watch as X is coming
It’s gonna strike hard
ToMesh only creates a new material if it mixes different meshes with different materials. In that case it produce a new multi material
I think it’s so nice !
Sorry but I had to STRESS TEST this boolean with my Dude Walking on Snow
Here is the playground using this new CSG2
I had several issues :
- On load I have this error :
- If you load another playground for example this one from @Joe_Kerr , and copy my code inside, strangely, it works
- After running for a while (a full circle on my side) I hit this second bug :
But maybe it’s because the cube attached to the foot (hole) is used in a place where it doesn’t intersect the ground anymore…
Whatever, cool stuff !
RTFM?
Walking on Snow V3 (HARD boolean) | Babylon.js Playground
await BABYLON.InitializeCSG2Async();
Yeah this is really brute force lol. The mesh gets more complex until it becomes unusable
Your skills are commendable trooper, but remember, discretion is as vital as strength. You serve the Sith, not your own ego. Do not let your triumphs overshadow our mission or draw the ire of the Overlord. Next time, tread more carefully!
Ok, jokes aside, amazing optimization!
I attempted to update my old CSG sample to use the new CSG2. However, it seems that something is not working correctly. I would appreciate any advice.
CSG sample:
CSG2 sample:
So the only possible case is that all meshes in operations share the exactly same material, if not, a new material would be created every time toMesh
being called. Should there be a way if user knows what materials in use and want to reuse the material?
Also, I saw usages of uniqueId
of material, and there seems to be a limit of 65536, but uniqueId
is globally generated, a scene is very unlikely to have more than 65535 materials, but could have more than 65535 of all sums of meshes, instances, transformnodes, textures, what could happen in this case?
Assign materials to the boxes as well.
Thank you very much for your very helpful advice.
So for 65536: this is the range I’m reserving inside CSG2 not the other way around
For the material here is the PR:
Allow user to specify material for csg2 by deltakosh · Pull Request #15731 · BabylonJS/Babylon.js
Does this mean if I have meshes which material has a uniqueId
greater than 65535, nothing would break if I put it into CSG2?
A nice optimisation would be to split the ground into separate meshes into grid of certain size, so that number of vertices for boolean does not just grow indefinitely.
this complicates it a bit, as you may have 1,2,3,4 meshes that need to be used to do the boolean, depending if steps bounding box is inside single cell, or on intersection of multiple cells.