The new Car RBD Rig tools in Houdini make setting up a working car simulation much easier. This tutorial will cover how to use these new tools to create realistic car driving simulations, as well as integrate them into a car crash impact using the RBD Bullet Solver.
Step 1 - Asset Prep
To start off with any RBD simulation we have to make sure the geometry we are using is prepared and ready to be simulated. In this case we have a model of a Crown Victoria Police Cruiser which needs to have its main parts grouped up and named, but also any severely interpenetrating parts cleaned up a bit.
Select all the parts that fit into general groups, such as the hood, trunk, wheels, body, etc. and adjust some points that are interpenetrating too much, or delete parts entirely if they are unneeded. Then, we can further group those into general sections using assemble nodes to set general groups using the prefix for the main body, small metal parts, glass, engine, interior, pipes and wheels.
Also set a placeholder name in this case @pname in order to deform the car later as the name attribute will be adjusted for use throughout the RBD sim. Finally, put down a rest so we can reference the original position later and a material node so we can test the textures as we go through the fracturing process.


Step 2 - Rigging and Animating the car
We will need some animation for the car in order to give it some motion before impact and the RBD Car Rig node will provide a suspension rig that we can use for a realistic car animation as well as constraints for the main simulation later. In the RBD Car Rig node, select the wheels and use the quick setup to get a RBD Bullet Solver that's ready to be used. Adjust the parameters in the Car Rig to better represent the type of vehicle we are trying to rig and get a more accurate simulation. The quick setup will also create attributes for a camera track that will follow the car with 3 different cameras that we can use for some car following shots.
We can now use this set up to animate the car. Set a speed for the car to reach and then drive the vehicle via steering keyframes or live inputs and make sure to cache out the Sim Points as well as the wheel constraints as they can be used later in the crash simulation. The RBD Follow Path can also be used to drive the car along a path, however we need the constraints to have suspension during the impact simulation. We can do this for both cars with them just heading towards one another using the same set up but an RBDXform to flip one of the cars around.

Step 2.5 - Cameras
Since we have used the RBD Car Rig for the animation we can now also use its camera track set up to create some more interesting camera shots. The main one is the side bumper cam that follows the cars motion. If you take a look at the 3 cameras there is one where the camera is following the car tightly in the cockpit, we can take this and edit its location to beside the back left wheel and it is ready to go since the RBD Car Rig quick setup already sets up the tracking to the car for us.
Step 3 - Fracturing the car
So the car is grouped and we have an animation for the car that will be used to drive the impact of the RBD Sim. Next step is to fracture the car in order to prepare it for constraints and destruction. Go through the main groups and fracture the metal geometry using Voronoi fractures but do make sure to uncheck the Create Interior Surfaces parameter as otherwise you will get strange Voronoi shapes due to the lack of thickness on parts of the model. Do this for each of the main groups of objects such as the body, bumper and windows, however for the inside of the car we can leave it as one large piece as it is not fracturing.


Assembly of the fractured pieces back to together
The wheels are not being fractured or breaking, so the proxies from the RBD Car Rig can simply be pulled in and packed alongside their respective Hi-res wheels. After fracturing and caching all the pieces, bring them back together to reassemble the car.
Note
Make sure the pieces are small enough that they provide a good amount of detail but not too small that they cause the sim to be extremely slow. Also make sure that the material should still apply to the fractured objects perfectly fine so make sure that's all in order.
Step 4 - Constraint Set Up
With the fractures done, it's time to set up constraints between all of the pieces. Start by building up the car's constraint system as it would be in a real car, starting with the large pieces such as the body/frame and adding sections one by one as the parts will all have to also be interconnected to hold rigid.

My beautiful network - ah so clean.
We will be using the SOP level RBD Constraints from Rules node and RBD Constraint Properties node to quickly and easily set up the systems within and between the fractures. Ensure for deforming metal parts start as Glue constraints to hold pieces together until impact and then enable Constraint Switching to Soft as we want the constraints to hold pieces together after the impact so they can deform and bend at the hinges.
Certain constraints from a constraint group may need to be adjusted so in that case simply split them off the constraint stream and edit them to be stronger/weaker. In this case the hood, wipers, glass and engine constraints need to be adjusted to get a more accurate look. Merge them back after, just make sure to check the geometry spreadsheet to ensure the changes are working.
For the wheels and suspension, we will be using the constraints set up by the RBD Car Rig. However, they will need a proxy body for the wheel constraints to connect to. Make sure to name the proxy body “body” as that is the object name the wheel constraints are searching for, merge it into the network and connect it to a stable central point. In this case the interior is a good option as it is not deforming and is already centralized to the car. If the vehicle model has a chassis that's also a good option however since the model is missing that the interior is suitable for this as it is not deforming and will provide a solid central foundation for the proxy body to be held to.
Notes
- The constraint values for the Soft constraints and Glue constraints can take some time to figure out, but using some wedging and TOPs you can dial them in fairly quickly. There are a lot of values we have to tweak however the Soft constraint ones are the most important as they will determine how the metal deforms.
- Make sure to select Hinges for the connection types between the same piece as we want the metal to be able to fold along the edges it shares.
- Make sure to turn down the number of constraints per piece being generated as we do not need multiple constraints for the same pieces, it will just weigh down the simulation.
4.5 - RBD Configure and Constraint Tweaks
Next up is the RBD Configure. Here we can adjust the density of each of the parts to help the sim look more realistic. There are already some presets we can use and for other parts we can just manually adjust the pieces to suit the needs of the sim. Also, some parts of the model still have intersecting parts even after some of the clean up since it would ruin the look of the car, and this will cause problems during the simulation. So, certain collision groups will have to be set as to not collide with each other so that the simulation stays stable. Also, the proxy body for the wheels should not collide with anything as it is simply there to act as an object for the wheels to connect to so remember to make it ignore all collisions. Finally, adjust the Active and Animated parameters to switch on the actual simulation a few frames before impact.

Animated to Active visualization
It is now time to transfer the animation and wheel constraints from the RBD Car Rig over to the fractured cars as we want to keep the momentum and state of the wheels from the animation the same for fluidity. Make sure to set the cars to the first frame of the RBD Car Rig sim animation and rename them to the same results coming from the RBD Car Rig node, which in this case is a piece named “Body” and 4 wheels named “Wheel_Back/Front_Left/Right”. To do this we can use our place holder name @pname to transform the cars using a Transform Pieces and keep our original names unchanged.

Wheel Constraint edit setup
Finally, the wheel constraints, merge them in from the earlier RBD Car Rig cache directly into the constraint stream, and we're good to go as they are already tuned, named and transformed for the vehicle! We can also adjust these constraints during the sim to have control over the motors and behavior of the wheels. In this case, we want no spinning after impact so, @targetw will slow down the motors acting as a brake so they do not try to turn, and the @maxtwist will lock the rotation down on the wheels immediately so they stop spinning at all. Find the frame to “lock” the wheels on and set @targetw to 0 and then also the @maxtwist to 0 as well to enforce this. We should now have a fractured animated car with the constraint setup matching the animation as well as wheel constraints we have full control over.
Since we need 2 cars to impact, do the same set up for the animation transfer but transfer the animation from the second car instead. RBD Pack then up and when RBD Unpacking, turn on Enforce Unique Name Attribute per Instance this will ensure no duplicates in the constraints and RBD geometry exist before we go into the simulation by adding unique suffixes to each car’s RBD geometry.
Step 5 - Full Impact
We are almost done with all the set up for the simulation, next up is just tweaking some settings for stability and constraints. Drop down a RBD BULLET SOLVER node and start off with upping the Bullet World Scale in order to help with stabilizing some smaller pieces of geometry. As for substeps 10 Bullet Substeps ended up being a good number in this scenario as at higher substeps I found a lot more instability while at the same time at this lower number the simulation was fairly stable.
We will also be using constraint switching for the deformation process instead of plasticity. After a glue constraint is broken by an impact and switched to a soft constraint, the solver will allow it to act as a soft constraint for a short period of time before locking it back to an unbreakable glue, hence deforming the metal. This can be done in the RBD Bullet Solver's Constraint Tab using some simple vex.
Note
Due to using constraint switching for the metal deformation the 2 cars impacting each other may get stuck inside of each other as parts from each car will deform and then lock up while inside one another. In order to fix this, we can set the cars to not collide with each other by modifying the collision groups and ignore each other after a certain frame. It can be a bit tricky to find which frame to switch on.


Collision group and ignore set up
There are some important attributes to override in this simulation as we have adjusted them upstream to change after a certain frame. In the properties tab add in collisiongroup and collisionignore to let the cars separate after impact as well as make sure to add target and max_twist to the overridden attributes in the constraints tab for stopping the wheels. Finally, it is time to simulate!
It will take some time in order to achieve the final look we are happy with, so be patient and set up some wedges in order to dial in the look. Don't be afraid to test out what each parameter does and how it influences the final look, as having a strong understanding of how each parameter influences the simulation is very important.
Step 6 - Post Processing
The next step is to deform the original model to match the simulated RBD vehicle as the Hi-Res from the simulation isn't exactly what we are looking for. We will be using the proxy geometry from the RBD simulation in order to pointDeform the original unfractured animated cars, however since the wheels and broken glass are not being point deformed blast them off the original model and vice versa for the simulated Hi-Res as we will use those instead. Make sure to promote the pname to points on the original model as this will be the attribute used for the point deform as well.

Viewport d
Our sim is only running from about halfway through the shot that means the cache doesn't exist for the first half of the shot. Instead, we will use the animated cars geometry up until the impact frame and then just switch to the simulated geo. Therefore, we will have 2 streams of network that we can switch between and ensure that the naming of the parts stays consistent to make assigning materials easier in Solaris.
Next let’s set up the RBDCarDeform node to give our wheels a nice squish, drop down the node for each of the cars before the impact and the deforming cars, and select the wheels and they should be deforming whereas before they were slightly penetrating the ground, we can also slightly transform them down, if wanted, to give us more realistic feeling contact with the road. All they need is a time shifted version of the wheels and then select the wheels in the RBDCarDeform node. As for the animated wheels we can just transform them down a bit to keep the connection solid with the ground after the deformation.
Clean up any pieces of debris that are unwanted, compute velocity for motion blur using a Trail node and set up some names for when we bring it into Solaris. Since this shot has 2 parts, one before the cars crash and one after we have to make sure to switch between the two cars a frame or 2 before impact, it should be seamless because the simulation is driven by the animation. For the original animated cars unpack them and make sure to do a name from groups so they are easier to handle in Solaris.
Motion Blur Tip
Since the wheels have a high velocity as well as a high angular velocity there is an important setting to turn on the Trail node for computing velocity. Set Velocity Approximation to Central Difference instead of the default Backwards Difference. This will compute the velocity by checking the difference between the previous frame and next frame rather than just the previous frame, which will help solve the strange motion blur you would get otherwise.


Step 7 - Dust
Now that the main impact is done let's add some secondaries, beginning with dust using a pyro sim. We need points that can rasterize before we can sim the dust, so start by taking the deformed cars and scattering some points on the front quarter of the car using attribpaint. Set up a mask from the bumper to just behind the wheel well, the only areas affected by the impact. Then we can just transfer velocity values to these points using the attribTransfer node so that they will have some of the car's motion imparted onto them. These can then be fed into a POP Sim in order to source some points that we can use to source pyro from. Since it is an impact, we can animate from high er to lower the time scale to allow the particles to shoot out quickly and then slow down drastically as the smoke should expand extremely fast but then linger. This will help add some force to the crash. Set @density and @pscale to @nage fit from 0-1 as we need density to rasterize later and so that they dissipate after a short amount of time.
Add some velocity noise to the points and disturbance/turbulence in order to break up the dust cloud shapes a bit and adjust the look. Finally, we will need a VDB collider of the cars as well so we can just take the proxy and do a VDBfromPolygons and plug that into the pyro sim.
Pyro Sim Optimization
Remember to cull unneeded fields as well as turn on some post processing settings in the pyrosolver as at 0.007 voxel size the simulation can get quite heavy. Make sure to turn on Convert to VDB and Use 16bit Float to reduce the weight of the simulation but also the Cull Mask Volume for Vel. Overall this will reduce the size of the simulation by a large margin.

Step 8 - Road Marks

Step 9 - Rendering
For the final step we will be rendering in Karma, specifically XPU, so bring in the cars, dust, particles and road to the stage and let's set up materials and lights. The naming setups from before should make linking materials to objects straight forward and since the car comes with materials, we only have to set up some materials for the glass and secondaries. We can simply assign materials to the cars from original texture and then use the provided one for the road, and set up some basic materials for the smoke and other parts. For the lights we can set up materials that are emissive and assign them to the headlight and taillights. For the Road material, jump inside and drop down a switch which is driven by the Colour attribute pulled using a mtlxGeomPropColor node. Now that everything has materials we can add in some lights, some render passes and finally that is all.
Thank you for reading and I hope you found this tutorial helpful!
コメント
knockflakes 3 週間, 4 日 前 |
WOW! That`s amazing!!! Thank you so much for this great tutorial! And of course for the scene file! Once again, that`s amazing
MugoStudio 10 時間, 24 分 前 |
Great example! Can't wait to disect it with more simple vehicles.
Please log in to leave a comment.