3D World

SIMULATE SMALL-SCALE LIQUIDS IN BIFROST

Utilise Bifrost’s powerful tools to create realistic small-scale liquid simulation­s in Maya

- Holly Watt Holly has eight years of experience as a freelance VFX artist, and is a lecturer at the University of Lincoln. instagram.com/hollywattv­fx

This tutorial will guide you step-by-step through the workflow of utilising Bifrost’s powerful tools to create a small-scale simulated liquid. Bifrost is well known for its use in creating large-scale simulation­s and it can often be overlooked when it comes to smaller, more detailed simulation­s.

The tutorial is aimed at complete beginners to Bifrost as well as those who have previously used it before for large-scale simulation­s. Bifrost is heavily dependent on the scene, so there is a focus on scale throughout the tutorial beginning with how to set up your scene to scale ready to add Bifrost emitters, colliders and killplanes. The next steps cover how to alter settings needed to convert Bifrost from using a metre scale to a cm scale. You will then go on to learn how to create a viscous honey liquid simulation, how to cache your simulation and finally mesh it to turn it from particles to geometry. The final steps cover adding your shaders and lighting to create a simple but striking final image.

Once you’ve completed this tutorial you will have created a detailed, realistic simulation of honey and will have a thorough understand­ing of the Bifrost workflow, able to apply your new knowledge to create other smallscale liquid simulation­s.

01 MODEL YOUR SCENE TO SCALE

Bifrost relies on accurate scale to create realistic simulation­s, so you need to make sure the scale of your geometry that the liquid interacts with is correct. Research the dimensions of your objects in real life; product listings on online stores is a good place to find accurate dimensions. A teaspoon is approximat­ely 11cm in length, so working with a scale of 1 Maya unit equals 1cm, scale your image planes to 11 units for the length before you begin modelling. If you choose to download a free 3D model be sure to scale it to 11 units in length.

02 LAYOUT THE SCENE

Now that you have your spoon geometry modelled to the correct scale, you can layout your scene. Duplicate your spoon so that you have at least two and position them one above the other. The liquid will drip from above the camera view onto the top spoon

and fill it before dripping to the next. Add some variation to the rotations of each spoon to allow the liquid to have some interestin­g movement when it is time to simulate; you can always tweak the positionin­g later.

03 CREATE A RENDER CAMERA

Create a camera that you will render from and position it so you can see both spoons in the view. It’s important to choose a lens that would work well in real life, so aim for something between 80-135mm for a close-up shot. At this point it is a good idea to set your image size in the render settings too; for test renders the settings were set to width 500 and height 750 (the final image size was increased but kept the same aspect ratio).

04 PLAYBACK SETTINGS

Before you begin to simulate there are a few preference­s that need to be set so Maya can simulate correctly. In Maya Preference­s go to the Time Slider settings and set your Playback Speed to ‘Play every frame’ and the Max Playback Speed to 24 or 25 fps x 1. This ensures that Maya doesn’t skip over any evaluation­s on frames (if this is left at the default of 24 fps x 1 then Maya will playback at this speed and won’t be able to calculate your simulation). Set your time slider to a length of around 300 frames.

05 ENABLE BACKGROUND PROCESSING

Before you create your Bifrost liquid it is useful to enable Bifrost to use background processing. Go to Bifrost Fluids in the Menu Bar and select Bifrost Options. Tick Enable Background Processing. Choose a Maximum RAM Usage about half of your computer’s RAM, and select a Disk Location with plenty of space. When you hit play Bifrost will cache your simulation in the background, allowing you to preview frames that have already been completed. The scratch cache will be deleted if you tweak a setting or close the scene.

06 CREATE THE BIFROST LIQUID

First you need to create a polygon sphere that will be used as the

emitter for our Bifrost particles; rename this emitter_geo. Scale this to the thickness you want the liquid to start as and position it above your spoon; 0.4 is the scale used here. With the sphere selected go to the FX context menu and select Bifrost Fluids and then Create Liquid. Maya will create a number of Bifrost objects in the Outliner. Hit play to check you can see the particles fall from the sphere. You may notice there are only a few particles.

07 EDIT THE MASTER VOXEL SIZE

Bifrost uses Master Voxel Size to determine the resolution of the simulation; a higher master voxel value means lower resolution but quicker simulation­s, and a lower master voxel value means a higher resolution (more particles) but a slower simulation. Ideally you want to keep the Master Voxel Size high for as long as possible, but for a small-scale scene you need to lower it early on to see more particles. Select your ‘bifrostliq­uidpropert­ies1’ in the Attribute Editor and set the Master Voxel Size to 0.3 for now.

08 CREATE YOUR COLLIDERS

The next step is to apply Bifrost collider properties to both of the spoons. Select your Bifrost liquid1 in the Outliner then select both spoons. Go to Bifrost Fluids and in the Add section select Collider. Maya will turn your spoons into colliders and add a ‘bifrostcol­liderprops­1’ object into the Outliner. To check that it’s working press play and watch to see the particles disperse as they hit the top spoon.

09 TURN ON CONTINUOUS EMISSION

Bifrost is currently only emitting particles from your sphere on Frame 1, but to create the shot you need a continuous supply of liquid. Select your Bifrost Emitterpro­ps1 in the Outliner. Then in the Attribute Editor under Properties turn on Continuous Emission. Now when you press play you will see a continuous stream of liquid emit from the sphere. Tweak the placement of the sphere geometry until you are happy with where the liquid hits the spoon when looking through the render camera.

10 ADD A KILLPLANE

With continuous emission turned on the number of particles is rising each frame and will eventually increase your simulation time by a large amount. Killplanes will kill any particles that pass through them. With your Bifrost liquid1 selected in the Outliner go to Bifrost Fluids in the menu and select Killplane under Add. Position the killplane under the second spoon just out of view of your render camera to kill any particles, as we don’t need to simulate them once we cannot see them from our camera.

11 CHANGE GRAVITY TO CENTIMETRE­S

Up until this point no settings have been altered so Bifrost assumes our scene is still in metres. The first step to adjusting this is to edit the gravity value. The default setting of gravity is 9.8m/s2, but as our scene is in centimetre­s we need to alter the value. In the Attribute Editor locate your ‘bifrostliq­uidpropert­iescontain­er1’ and change the gravity magnitude to 980.00 (9.8m/s2 = 980cm/s2).

12 ALTER THE LIQUID DENSITY SCALE

The next step is to alter the density of the liquid to reflect centimetre­s; by default Bifrost sets the Density to water which is 1,000kg/m3. To change this to a cm scale you need to set it to 1 for water. However, you are aiming to create honey for this simulation which is denser than water, so you will need to use a higher value for honey. To do this select your emitterpro­ps1 in the Attribute Editor and change the

Density from 1,000 to a value of around 1.55.

13 EDIT SURFACE TENSION

The final setting to address to alter the default Bifrost settings to centimetre­s is the surface tension of the liquid. By default it is turned off, so first enable it in the ‘bifrostliq­uidpropert­iescontain­er1’. The default value of 0.072 is the surface tension of water in metres, so to switch to cm scale the value needs to be 72. As with the density you are simulating honey for this tutorial so the value should resemble honey, which actually has a lower surface tension than water – use a value of 55.

14 SET THE LIQUID VISCOSITY

The next setting to adjust is the viscosity (thickness) of the liquid. The default value of 0 represents the viscosity of water for a scene scaled in metres. The viscosity value for water in cm scene scale is 1, but again you are simulating honey which is much more viscous than

water. In the Attribute Editor on the ‘bifrostliq­uidpropert­iescontain­er1’ tab change the Viscosity value to 8 (real-world viscosity of honey). The particles begin to behave like a thicker liquid, but the liquid is moving far too quickly.

15 INCREASE CALCULATIO­NS PER FRAME

You will notice that the current simulation is leaving gaps in the honey drip; this is due to the number of calculatio­ns that Bifrost is computing per frame being too few. To fix this go to the ‘bifrostliq­uidpropert­iescontain­er1’ and locate the Time Stepping settings. Change the Time Step Adaptivity to 0.5 (higher values mean more calculatio­ns per frame). Set the Max Time Steps to 16. Increasing both these values will result in more accuracy but longer simulation times; these settings will need to be increased later.

16 DISABLE LARGESCALE FEATURES

Now you have a basic simulation you can disable some features that

are useful for large-scale simulation­s only, such as waves. On the ‘bifrostliq­uidpropert­iescontain­er1’ set the droplet threshold to 1 (this disables Bifrost from splitting droplets of liquid from the main body of particles). Also disable Vorticity (this calculates the churning rotation of the liquid). Neither of these calculatio­ns are useful at this small scale or for the type of liquid, so by turning them off you don’t waste unnecessar­y time calculatin­g them.

17 DISABLE LARGE-SCALE ADAPTIVITY SETTINGS

By default Bifrost also has some adaptivity settings that allow it to skip some types of calculatio­ns when working on a large-scale simulation to speed up simulation times. But for this small-scale simulation it is useful to disable these adaptivity settings to provide more accurate calculatio­ns. On the ‘bifrostliq­uidpropert­iescontain­er1’ disable Spatial Adaptivity. Set the Interior Particle Density to 2 (these both disable Bifrost from using a lower resolution in the centre of a

liquid). And finally set the Erosion Factor to 0 (erodes the particles at the point of collision).

18 ADJUST THE COLLISION THICKNESS

Review your simulation; you may notice that it appears as if the particles are floating on the surface of the spoon. This is due to the collision thickness that Bifrost is using. To adjust this select ‘bifrostcol­liderprops­1’ in the Outliner. In the Attribute Editor adjust the Thickness value. Setting this to 0 adds no thickness to the surface but may result in particles passing through thin geometry. Try a value of around 0.5-0.75 for now, this can always be re-adjusted later.

19 SLOW DOWN THE LIQUID SPEED

Now that all of the initial settings have been addressed you will notice that your simulation is still far from looking and behaving like honey. It is moving far too quickly, which is due to the scale of the scene and the gravity value. In order to slow the liquid down the Transport Time Scale on the ‘bifrostliq­uidpropert­iescontain­er1’ can be used – change the value to a lower number to slow the speed of the particles down. You will notice that the liquid instantly begins to act more like honey as it folds over on itself.

20 ADD MORE DETAIL

Currently your simulation is still at a low quality with few particles, so there is a limit to how much detail can be simulated regardless of your liquid property settings. Now is a good time to lower the Master Voxel Size slightly before continuing to adjust any further settings. Be aware that altering this will slow down your simulation times considerab­ly – be prepared to wait a bit longer for feedback on any changes you make going forward, but the payoff is that your simulation will now start to take on a more accurate, honeylike appearance.

21 MAKE ARTISTIC ADJUSTMENT­S

Currently the simulation is using real-world values, however your

simulation­s only need to be based on reality, so spend some time doing some artistic adjustment­s by editing your Viscosity and Surface Tension values. Alter one value at a time, then re-simulate and playblast to check the results. Don’t forget to also think about adjusting your geometry; the positions of your spoons and also the size and position of your emitter will have an effect on the simulation too. In this example the first thing that was tweaked at this point was the size of the emitter to create a thinner drip of liquid.

22 REVISIT TIME AND DETAIL SETTINGS

You may wish to also revisit the Transport Time Scale and Master Voxel Size at this point to further tweak the simulation. It will become a bit of a balancing act between adjusting these settings and the Viscosity and Surface Tension until a point where you are happy enough with the simulation to move onto the caching to disk, meshing and rendering stages. As with the previous step, try adjusting one setting at a time and then reviewing its effect. This will be a slow process, but worth it to get the best simulation you can.

23 ENABLE BIFROST MESHING

In the Attribute Editor locate the liquidshap­e1 tab and under Bifrost Meshing tick Enable; this will give you a preview of your mesh in the viewport. You can also turn off display particles on the same tab to help you see the mesh better. The settings you need will depend on your simulation settings, but pay particular attention to the surface radius, kernel factor and resolution factor when adjusting these settings for your mesh. Make sure to do some quick test renders to check that the shape of the liquid renders well, as it will appear different in the render to the viewport.

24 FIX MESHING ISSUES

If you are seeing issues with the mesh such as stepping or faceting, it can be caused by the simulation not having enough detail. To fix these types of issues you may need to increase the number of Min Time Steps on the

‘bi frost liquid properties container 1’ to force Bifrost to add more substep calculatio­ns per frame. Check your mesh again and if there are still issues you can also try increasing the Max Time Steps too; the values you need will be based on your individual simulation, but be aware that higher values will slow down the simulation.

25 CACHE TO DISK

Once you are happy with the simulation and mesh settings you can create a cache that is saved to disk rather than just the temporary scratch cache. Under the Bifrost Menu locate Compute and Cache to Disk and open up its settings window. Make sure to choose a good location with plenty of space. The default settings for cache format and compressio­n format are generally sufficient. You can choose to output just the simulation and then cache the mesh separate or both at the same time. Make sure your bifrostliq­uid is selected and then hit Create.

26 READ IN A CACHE

Once your cache has completed Bifrost will automatica­lly read it in and you can review it, however if you did decide to tweak further settings after caching then you can disable the current cache on the ‘bi frost liquid properties container 1’ tab in the Attribute Editor. You can also load different versions of your cache here if you wanted to compare different simulation settings. Before moving onto the rendering stage ensure you have your final cache loaded for both the liquid and mesh cache.

27 ADD THE LIGHTING

Now is a good time to create some lighting if you haven’t already. You can choose to use whatever lighting you want to create the desired look. This example uses a basic studio setup of a backdrop with a three-point lighting setup. An additional rim light was added to highlight the initial drip against the black backdrop. Continuing on you will be completing the final lookdev by jumping back and forth between tweaking your shaders and your lighting, just like a normal workflow.

28 CREATE THE SHADERS

You will need to create your spoon and honey shaders at this stage. Your honey shader is applied to the bi frost liquid 1 mesh in the Outliner; this example uses an a is ta nd a rd surface with the preset honey applied, however you can use any renderer you choose. If using Arnold on the ‘bi frost liquid 1 mesh shape’ of the mesh, uncheck Opaque in the Arnold section. For the shader set the IOR to that of honey between 1.484-1.504. Use the transmissi­on settings to fine-tune the look of your honey shader until you are happy.

29 READY TO RENDER

Now that you’re ready to render your simulation you will need to set your final render settings correctly. As you are using a transparen­t liquid, it is important that you pay particular attention to setting the Ray Depth values high enough to allow for the transmissi­on of light through your liquid. Ensure you’ve set everything from the name to the resolution, and then batch render. You’ve now completed the workflow of creating a small-scale liquid through to its final render. •

 ??  ??
 ??  ??
 ??  ?? 01
01
 ??  ?? 02
02
 ??  ??
 ??  ?? 06
06
 ??  ?? 03
03
 ??  ?? 09
09
 ??  ?? 08
08
 ??  ?? 07
07
 ??  ?? 05
05
 ??  ?? 04
04
 ??  ?? 10
10
 ??  ?? 12
12
 ??  ?? 11
11
 ??  ?? 15
15
 ??  ?? 16
16
 ??  ?? 17
17
 ??  ?? 13
13
 ??  ??
 ??  ?? 20
20
 ??  ?? 18
18
 ??  ?? 19
19
 ??  ?? 21
21
 ??  ?? 22
22
 ??  ?? 23
23
 ??  ?? 25
25
 ??  ?? 24
24
 ??  ?? 28
28
 ??  ?? 27
27
 ??  ?? 29
29
 ??  ?? 26
26

Newspapers in English

Newspapers from Australia