How to update the scene in real time by frequently using Boolean intersection for 3D models #1595
-
|
Hello everyone, due to work requirements, I am working on an interesting feature: model polishing. In fact, it involves Boolean intersection of 3D models and real-time scene updates. Unfortunately, after Boolean calculation, some of the vertices and indexes obtained from the model are different. This makes it impossible for me to modify data on the old model and then call vertex ->dirty(). Should I frequently create new models and release the old models? Do you have any friends who can provide good advice? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
It's not possible to give any specific advice as the way you are doing things is both unusual and open ended. If it's possible could you avoid doing boolean intersections and just render the boolean scene with a combination multi-pass and shaders to do the boolean operations for you per frame. It might be possible to give you the rendering that is appropriate without actually modifying any data. Failing this then you likely need multiple copies of the data for the old data, if you still need to render it, and one for the new data. A vsg::Switch and per view node masks might be a way of separating the different code paths. But... we really know so little about what you are doing, why you are doing it, details how you are doing it, and what end result you are after. Giving advice that is really specific to your usage case is impossible. |
Beta Was this translation helpful? Give feedback.
Another approach that might be useful would be to use volume rendering.
Create a 3D image for the bone and render the an outer iso-surface. The 3D image could be stored as a ubyteArray3D, ushortArray3D or floatArray3D, with higher precision storage allowing for greater precision of placement out the iso-surface, but would require more memory. With a volume rendering approach you use a fragment shader that traces rays through the volume to find the iso-surface boundary. Alternatively you could just write a compute shader that walks the volume to generate an outer hull mesh, but this is more complex to implement that a simple fragment shader.
Then to modify the bone texture you'd run a comp…