01. In this lesson we will create a basic Phoenix FD liquid simulation setup of pouring wine from the wine bottle into a glass. Fire up 3DS Max and open Liquid Basics 01.max file from the projects folder. The scene contains a dining area scene with a basic animation of bottle pouring wine into a glass. From the Layers Explorer turn off the layers for 'Table 001' and 'Table 002' assets while switching on the layer for 'Dummy Geometries'. This will isolate the non-render-able geometries of wine bottle and glass along with two other dummy emitter geometries.
02. Before starting the scene always make sure that the geometries that we are using for simulation does not have any hole or other polygonal errors. So in order to check that we will apply the ’STL Check’ modifier onto the geometry and turn on the ’Check’ option from its parameters. Similarly for successful fluid and geometry interactions we have to check the position of 'Polygon Normals' on the geometry, as a liquid will not enter a hollow geometry if the polygons are flipped. So in order to check that we have to apply an ’Edit Mesh’ modifier onto the geometry and turn on the ‘Show Normals’ option after enabling Face, Polygon or Element sub object.
03. ‘Scene Size’ is another very important factor for a successful Phoenix FD Simulation, so always make sure to build the scene in ‘Real World Scale Units’. For this scene we have used ‘Centimeters’ as our ‘Display Unit Scale’ while making sure to match each object as per its real world size. Open up ‘Units Setup’ dialogue box from ‘Customize’ menu and from ‘Display Unit Scale’ menu choose ‘Metric’ while choosing ‘Centimeters’ from the dropdown. Further dive inside ‘System Unit Setup’ and from ‘System Unit Scale’ set ‘1 Unit’ = ‘1.0 Centimeters’ from dropdown.
04. From the Phoenix FD toolbar select and drag the 'Create a Liquid Simulator' tool in order to create a Phoenix FD Liquid Simulator around the wine glass, while making sure that the sphere is inside. Since the simulation is going to be for small scale fluids, we have to reduce the size of the Voxels accordingly. Switch to its modify panel and from the Grid parameters rollout reduce the ‘Cell Size’ value to ‘0.15 cm’. Now in order to keep the size of the container appropriate to the wine glass and the emitter change the Grid X, Y and Z Size values to 70,70 and 210 respectively.
05. Click on 'Create a Liquid Source' icon in the toolbar and place the Liquid Source in the scene. From it’s modify panel add the Sphere Emitter into the Emitter Node list. Currently the ‘Emit Mode’ is set to ‘Surface Force’ which will make only the surface of the sphere object to emit the liquid. It’s ‘Outgoing Velocity’ value will help in setting up the pace of liquid getting emitted from the sphere object, so now in order to keep a low pace of our simulation we will reduce the ‘Outgoing Velocity’ value to ‘5.0’. Play the simulation from the ‘Start’ button under the ‘Simulation’ tab to check the result so far.
06. The last step will confirm that the sphere is emitting Liquid inside the Simulator. In the simulation so far we can notice that the edges of the pour are not even, which is because of the less steps of calculations between each frame. So from the 'Dynamics' rollout crank up the ‘Steps Per Frame’ value to higher values, which will help in fetching a more natural look for the pour but at the cost of more simulation time. So it would be great if we could find the lowest setting for Steps Per Frame for every effect that we make that gives us a closer result to any ideal value. Here we can set the ‘Steps Per Frame’ value to ‘8’ as it will serve the purpose for now.
07. Right now particles are hitting side boundaries of the container and disappearing, which means that our simulator is open from sides and needs to be closed. So in order to do that, open up the 'Grid' parameters rollout and from the 'Boundary Conditions' menu choose 'Jammed Both' option for all three axis. Rerun the simulation to conclude that particles are now colliding with each wall of the container. Further to improve fluid quality, increase the Strength value under the Dynamics > Surface Tension rollout to ‘0.1’ as it will help the fluid to retain its typical spherical shape without breaking apart to form droplets or tendrils.
08. Our simulation is currently overflowing the glass, so in order control the flow of liquid emitting out from the sphere we will animate the value of ‘Outgoing Velocity’ from the Liquid Source parameters. If we play the simulation we will notice that our glass is getting filled at around frame number ’30-40’ which means that we have to cut the flow of liquid around these frames. Click on Auto Key button and on frame number ‘25’ fill in a value of ‘5.0’ in the ‘Brush Effect’ parameter while decreasing it to ‘0.0’ at frame ‘30’. This will help in cutting down the liquid flow at around frame number 40 and as a result we will get a filled glass without any spill.
09. We will notice that a lot of liquid has been leaking out from the walls of glass, which we can easily rectify by increasing scale of the glass walls for our liquid to interact with. Liquid interaction in Phoenix FD requires the object walls to be at-least twice as big as the scale of the grid ‘Cell Size’. So in order to measure that, create a box geometry corresponding to size of two grid cells and scale up the glass walls as per it. We can always apply a Push modifier onto the geometry in order to increase the size of the walls of the geometry. But in this case we have the privilege to move down to the level of Editable Spline for the glass and modify the walls as per our requirement.
10. Render the result so far to view that the liquid is currently of a solid purple color. Open up the slate material editor and drag in a new V-Ray material while renaming the same to 'Wine'. Change its Diffuse color to a darker shade of Maroon (R,G,B - 45,0,0) while changing the Reflect and Refract color to White. Set the RGlossiness to 0.95 while keeping the Reflect Fresnel IOR value to 1.6. Turn on the ‘Show Background in Preview’ parameter from the right click menu of the material to visualize the material properly in the preview window. Apply this material onto the liquid simulator and render the scene to check the result of the material.
11. Currently the liquid resembles a lot like water as there is no color to it yet, so in order to add a maroon tint to the liquid we will add a shade of Red (R,G,B - 166,20,20) to the Fog Color while reducing the Fog Multiplier value to 0.005 for lesser fog strength along with the Fog Bias value to -2.0 in order to make the liquid look much thicker. Now in order to get a better refraction similar to a wine material, we will decrease the Refract IOR value to 1.3, crank up the Refract 'Max Depth' value to '20' and switch on the 'Abbe Number' option. As a last step change the 'BRDF' type to 'Phong' in order to lift the highlights of the material.
12. Further to enhance our simulation, turn on the 'Wetting' option to make liquid stick to the glass surface like wine. To prevent long visible tracks left from the wetting effect we will change the value of Consumed Liquid parameter to ‘0.01’, as a higher value can lead to disappearing of liquid particles while creating a single wet map particle. Now to set the drying speed of material, we will put in a value of ‘15’ seconds while also introducing some stickiness to the fluid by putting in a value of ’0.5’ in the Sticky Effect parameter.
13. We will now set up our material for wet map. The way it works is by using ‘Phoenix Particle Texture’ to pick up the Wet Map Particle Group which generates a procedural map, that map can be used to blend between dry and wet materials using V-Ray Blend Material. Open up Slate Material Editor and create a V-Ray Blend Material while piping in two variations of glass materials - one with default glass material values as Base material, while the other one with the properties similar to a wine material but with very little reflect and refract values which will serve as Coat 1.
14. Now we will create a Phoenix FD Particle Texture and set it as a Blend Map for V-Ray Blend Material. Under its parameters choose Phoenix Fd Liquid Container as Source Particle System in order to access the Wet Map Group from the Available Events List. Set the Blending Method to Biggest which looks for the particles with biggest contribution in determining end result. Also increase the blending radius around each wet particle by increasing the Blend Radius value to 1 cm, so that we can have smooth wet map. Assign this V-Ray Blend material onto the Wine Glass geometry and render to check the final result.
0 comments:
Post a Comment