Today, I continued doing what I am supposed to do. Below is the playblast of the cracking only:
While, I was still working on it, Mr Ron dropped by in the late morning, he told me he had an awesome idea, that will put all the research I did for the past 1 month plus to waste.
First, he created a foreach node after the point node to fuse up the points for each piece of the pre-fractured geometry.
It is repeated for both sides. Then a merge node is used. After that the groups are cleaned up and renamed to a matching naming convention for both left and right piece.
The clean node removes all the existing groups, connectivity creates a new attribute and connects the similar data type together. Partition node creates a new group based on the new attribute created earlier. Then after making sure the groups and primitive numbers are correct, We proceed on.
Before that, Mr Ron told me that, previously I used the facet node to clean up the pre-fractured pieces, which does the job, but that in turns increased the number of points which is not desired. Mr Ron told me that there is another node that I could use which does the same job but does not increase point numbers is the vertex node.
Under the vertex node, the last option is switched on to "Cusp Normal" and there is a slider for tweaking. However, due to some display issues, the sliders needs to be reset first before it will work. The way to reset it is to drag it to 0 first before dragging it on to the value desired.
However, there will be some black "stuff " on the object itself after using the node, but it is alright, just some display issues. The render looks perfectly fine.
This is how the display looks:
And the render:
(It is super low resolution, but you know what I mean though)
Mr Ron then told me what will happen next, which will blow my mind away, before he proceeds on. He told me that instead of using all the vopsop, copy loop and stuffs. He said that instancing would be a much better option.
How it will go about is that, the low resolution terrain will be used for the dynamic simulation, then from the dopnetwork, he will export out the data as points. Then he will instance the high resolution pieces onto the points and it can be rendered from there. This way, the whole simulation will be so so fast and the render fast too.
Firstly, since the initial simulation was done, he brought the whole thing into dops. As this was a test for proof of concept, Mr Ron just created a random fit expression for the velocity option under the rbdfracturedobject. This is how it looks with that expression alone:
Then a rbdsolver is used followed by a gravity node. Then after that, a dopimport node is used to import back the fracturing data as points data.
It looks like this in the viewport:
After that, We proceeded on to create the high resolution pieces that will be used for instancing. After changing the resolution of the terrain above, Everything else is the same thing. Until after the merge node,
A null is used to lock the position of the terrain, to not let it move.
Then a delete node is used to delete everything but a piece of the pre-fractured geometry. A expression is used to allow the delete node to change the piece of geometry it keeps per frame. That will result in a animation of pieces of pre-fractured geometry moving around.
Below is how it looks:
And how it look when it plays:
After that we ropped out the bgeo sequence of that. Then Mr Ron created a instance node on the scene level. Inside, a dopimport node is used to import the point data from the dop network. Then a material node is used. What it does is assign the shader to the terrain itself. But actually, a delay load shader is needed in this case. The "file" parameter from the delayed load shader is extracted out, and the bgeo sequence of each piece is assigned to it.
The expression used in this case is $HIP/high/high.$ID.bgeo
It looks like a simple root file, but what the $ID does is shown below:
The number at the end of the dopobject is the same as the id number of each piece. Hence $ID is used to represent the instanced dopobject for each piece.
The overall result is shown below:
Although it is quite difficult to see here, but it works. And I didn't even need to turn on the geo1 node which contains everything.
No comments:
Post a Comment