Learn about deleting excess particles with a plane.
- [Instructor] Opening the chapter on optimization, we'll add a keel plane to delete any liquid that passes behind the camera. In this shot, we don't want the liquid to fill up the entire room, and we also don't want to unnecessarily calculate anything that the camera can't see. I've got the camera on a hidden layer. Go over to the Layer Editor, and enable Visibility for the camera layer. Let's look at this from the side. Go to the front panel, in it's menu, and choose Panels, Orthographic, Side, and then frame all the geometry in the view with the F hotkey.
We want to enable display of the camera's frustum. It's an icon that shows the camera's field of view. Go over to the Camera panel, and in the view menu, choose Select Camera, and open up the attribute editor. And in the frustum display controls, turn on the switch to display the frustum. In order to optimally place the keel plane, We'll need to play the animation and see where the camera moves and use the display of the frustum to determine the maximum Z extent of the camera's field of view.
But, if we play the animation now, the Bifrost simulation will calculate, so let's turn that off. Over in the Outliner, scroll down if you need to, and open up Bifrost Liquid one, Select Bifrost Liquid Container one, and in the attributes, in Container Attributes, turn off the Enable switch. And now we've just disabled the entire Bifrost simulation. In the timeline, we can press play and watch the animation, paying attention to where the frustum moves.
And as the camera tilts down, it looks like at about frame 180, the frustum reaches its greatest extent in world Z. I'll press stop and scrub through here, and just park it on frame 180. We're ready now to add the keel plane. With the Bifrost liquid container still selected, go into the Effects menu set, to the Bifrost Fluids menu, and choose Add Keel Plane. It's created the origin, over in the perspective view, I can right-click to give focus to that view and press the F keyboard shortcut to frame the selected keel plane.
Tumble around, and there it is. I've experimented already, and I know where I want this to be, so I'll just plug it's transform values in. Going back to the channel box, set Rotate X for the keel plane to zero, and Translate Z to 8.2. And now it's optimally positioned in order to remove any particle that comes up close to the camera lens. The keel plane's influence extends infinitely through 3D space.
It culls or removes any particle that touches the plane. And touching is defined as being closer than one voxel-width, as defined by master voxel size, in the liquid properties container. The keel plane is bi-directional and culls particles coming from either side. Let's put it on its own display layer, over in the Layer Editor, click the button on the far right, to create a new layer and have the selected object. Then double-click layer one, and let's rename it, and we'll call it Keel Plane Layer.
Press the Enter key, and click Save. We've got it where we want it, so we can prevent it from being moved by referencing the layer. Click the button on the far right a couple of times to see the R, and then let's also hide it, so we can do a Playlast. So turn off Visibility for the keel plane layer; also turn off visibility for the camera layer. We need to re-enable the simulation, re-select the Bifrost liquid container node, and in the channel box, we can re-enable it.
Click in the Enable field, and type in a numeral one, and press Enter, and now the simulation is re-enabled. Rewind the simulation, and set up the perspective view for a Playlast, so we can frame that up. And then maximize the view with the space bar. Go up into the Windows menu, and choose Playlast, Options, and these are, pretty much, the options I have from the end of the last chapter. Most importantly, I'm saving out to a file.
When you're ready, go ahead an click the Playlast button, and we can watch the progress in the view port, and once again, it will take quite a long time. It could take an hour or more. And when you're tired of waiting, you can hold down the Escape key, and that will cancel the Playlast, but you'll need to hold down the Escape key even longer, in order to also cancel the Bifrost simulation. Here's the result of our Playlast. We can see that any particle that comes near the keel plane is removed. Since the scene isn't filling up with as much liquid, this Playlast took a lot less time than the Playlast we created at the end of the previews chapter.
The simulation shows some issues with fast-moving particles passing through the colliders. We'll fix that by tuning time steps and transport steps in the following movies. That's one way to optimize Bifrost fluid calculations using a keel plane to cull any particle that touches the plane.
- Bifröst basics
- Analyzing the node structure
- Emitting from a polygon mesh
- Colliding with a polygon mesh
- Adding velocity, friction, and drag with motion fields
- Optimizing space and time accuracy
- Caching simulations
- Meshing and exporting liquids
- Render-time meshing in Arnold
- Applying channel data to Arnold shaders
- Generating foam from a liquid
- Rendering and shading foam in Arnold