How to do Flip Morph in Houdini -- Part 1 (+ projects)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there i am Sadjad Rabiee and welcome to this  tutorial in this tutorial i will talk about three   different methods of flip morphing working with  suction force which is one of the simplest way   of doing flip morphing working with target force  which is a little more complicated but the good   thing about this method is it's useful for both  pyrographic simulation and flip simulation and   at the end of the tutorial i will talk about how  we can create custom force in houdini to control   philly particles directly and also we will see  the difference between two different color model   or color systems rgb color model and rv color  model or red yellow and blue color model which   is useful in art we will see how we can convert  rgb color model to the RYB color model and how RYB   is giving us much more interesting result in terms  of blending primary colors so let's jump into the   houdini and begin it okay as i said one of the  simpler way for doing flip morphing is using   suction fluid or suction first very quickly i want  to show you how you can use suction first to do   a simple liquid morphing i'm going to create  a simple sphere push it up only along y axis I want to use flip Fluid from the object oh don't forget to select your object and click  on the flip fluid object the points are not so   visible press d in the display options geometry  you can increase point size to 10 and maybe   we need to have dark background yes that's better  and we have a very simple dynamic network for FLIP   we could have collision objects i would like to  use ground plane control-click on the ground plane that's good before adding suction fluid in our   AUTODOP network we need to have target  object for doing that i want to use font SOP   here write something here, for example,  "JK", suction force is working with the   VDB volumes so we need to have some thickness  on this object we could use polyextrude SOP and set distance to 0.5 and also don't forget  to turn on "output back" option that's good   let me increase the size a little bit and i think we need to push it up because it's  inside the ground plane yes and transform here   translate y set it to 1.5 that's good now target select suction fluid select your target object  press enter select philip object enter again   as you see such and fluid created two different  nodes for us anti-gravity and suction force   suction force is responsible for computing the  force for us and antigravity is responsible for   disabling this gravity and the points which are  inside of the target object once they are inside   we want to keep them there so we don't have  we don't need to have any gravity for those   points and in the sanction first  if you go to the code tab you can   see vex expression here which is one of the  best features of the section first because   you can you can change the code based on your  need you can customize section first based on   your project and do whatever you like we have  same thing for anti-gravity here as well and   about how anti-gravity is working is just creating  another force with the same amplitude or magnitude   of the gravity force but in the opposite direction  and that's why some of the parameters of the   anti-gravity are linked to the gravity force here  about six chain force we have few parameters here   volumes up it's pointing to the target object in  the target object we have new new node here as   well it's just for converting your object to  the vtb as i said before oh it's not so good   in the volume tab you can decrease  wax cell size for example 0.025 in the AUTODOP network we have inside distance  outside distance the inside distance is just   distance threshold for the points which are inside  the target object and outside distance of course   is for the points which are outside of the target  object you have suction strength its amplitude or   magnitude of your force and let's see what we have  right now okay some of the points are falling down   that's maybe because those points are  far away from target object based on   this distance and of course maybe we don't  have enough function suction strength as well   so i'm going to increase outside distance  and adding more function strength yeah that's better we need to  have more points let's try 0.03 okay now i want to do something more interesting  for you instead of using static text here   i would like to use expression let's start with $F now we have frame number  but it's not good for suction force because   the number is changing per each frame and suction  force doesn't have enough time to show that number   to us so we could change the expression to  change the number only per each 25 frames,   for example, we could have dollar sign  f divided by 25 but don't forget to   put it inside the backtick because  it's an expression and we need to   have the result of the expression as the  output of the found inside the viewport at frame 24 we have 0.9 and in  frame 25 we have the same thing for   frame 49 1.9 and then two but  we want to just keep the first   number the very first number for doing  that you could use the floor function here we go In frame 24 we have 0 25 it's 1 49 and 50  and the same for the rest of the frames   go back to the autodop network it's good but the number is not so  visible because the fluid is so thick   to fix that you have a couple of options  there is a simple trick here as well you   can decrease the particle radius scale here  to for example 1.1 but don't go below 1. and here you can play with inside and outside  distance um let's see what we have right now okay that's better than before but if you want to   make it a little thinner you can  decrease the inside distance as well okay that's good I would like to take a flipbook and it was a very simple method to morph  your flip fluid to the different numbers let's go to the other subject we have another method to do flip morphing uh   which is using the target force if you create the  up network we have a gas target force working with   gas target force is little harder than suction  first because you need to have some other nodes   as well but the good thing about this node is  it's working with both pyro simulation and flip   simulation so it's good to know about this node  too to add those notes the simpler way is using   a tool inside the shelf if you are working with  houdini 19 some of the shelf tools are not here   by default and you need to add container tools  and legacy pyro effects because the pyrex which   we have here is the sparse solver but we need to  have the regular pyrosolver for using this node if i want to show you here for example   if you create the smoke the type is the  PyroSolver sparse and the object is sparse as well so I'm going to use the smoke here inside the  legacy pyrex we need to have source click on smog we have the regular pyro solver and  then you need to have target object in the container, tools select attract fluid   press enter select your container and press  enter you have three different options for   attraction volume surface or attract to  the points I am going to use the volume one as you see the attract fluid  created some notes here let me play and see what we have right now okay if you are getting an error  on the target force you could just   copy this note here and use the  second one I think it's a bug now it's working it's attracting  toward the target object and let me very quickly uh tell you what these  nodes are doing the first one is responsible for   visualizing the target force in the viewport  of this red volume the second one is creating   the gold field based on the density because  for target force we need to have goal field and here we are reading density information  from the target source if you go to the target   source we have some new nodes here as well  tutorials converted to the points we are   creating density and temperature attributes but  the temperature is not useful for target force   adding some noise and finally  convert those nodes to volume we are reading density from  target object and copy density   to the goal field which we created here and in  the target force we are reading density goal and   computing the target first we have a couple  of options to control target force here if you wanted to use target force with sparse  solver not regular pyrosolver you just need to   copy and paste these red nodes in  your sparse solver network and but   honestly you need just to copy these  notes and this part is not necessary   it's just about reading the gold field and density  and blur the gold field based on these parameters   but it's not required for FLIP or spar  solver you can keep it but it's not necessary   so i'm just going to copy these notes and  now you can remove AUTODOP network pyro and this one is target yeah  let me rename it to target okay now inside the PYRO Solver control-click  on the smoke we have sparse smoke   paste those nodes here and connect it to the  direction or second input of the pyruvate solver okay we need to rename it here  as well it was target yeah now we have target force for pyro sparse solver   right now entire smoke is  attracting toward the target   I'm going to do something here set this point  to zero the value of this point to the zero now   only a small portion of the smoke  is addicting toward the target force you can control it by minimum and maximum distance okay now what about flip simulation again  we need to keep these red nodes ctrl-c i'm gonna create sphere in the particle  flows again fill the fluid from object instead of increasing the size of the points  inside the viewport you can use guides in the flip   fluid object particles visualization to spheres  so you can control the scale very simply here   okay now paste those nodes here you must  connect the output to the volume velocity   input of the flip solver because target force  is manipulating the volume velocity not particle   velocity and if you play you would have couple  of error because for flip simulation you need to   do some more extra works to make it work  and in the first stage inside the target   you must have vdb version of the torus the regular  FOG vdb so you can use the vdb from polygons fill interior and i guess that's it inside the AUTODOP network in the match target  we have a surface instead of density density is   useful for pyro simulation in flip  simulation we don't have density field   at all if you wanted to visualize surface field in  the viewport you can select your flip fluid object   visualization turn on surface go to the  second frame and here is your surface field   so we are creating goal based on surface and  here we are copying a goal to the surface   sorry here we are reading surface from target  force from target object and copy to the goal   field which we created here and don't forget  to change density here to surface as well in   the target force in the fields we don't have  density we have surface and i guess that's it oh and don't forget to turn on liquid  mode because we have FLIP solver i think target object is so far away and the  target force for flip is only working when   it is close enough to your target object great yeah and and you can play  with these parameters of course if some portion of your flip is falling down and that's it if you wanted to improve  the jiggly motion of your flip points you   can very simply use the pop drag force and  connect it to the second input or partition   velocity of the flip solver because of course pop  drag is only working with the particles the good   thing about the flip solver is you can manipulate  particle velocity and volume velocity separately nice maybe we need to have more particles okay now let's see how we can create this  project we target force i'm going to use   the same setup which we make just now inside the target object we need to have  another geometry as numbers so again   i'm going to use font same expression  as before $F sorry floor($F)   divided by 40 because i want to  change the number per each 40 frames and ctrl-enter okay set the font size to 4 it should be towards toward  y-axis so i'm going to drop down transforms up   minus 90 degree around x-axis and of course we  need to have polyextrude as well polyextrude set distance to 0.5 turn on  output back convert it to vdb decreased wax cell size um yeah that should be enough and let's check  the stimulation uh i would like to change the   particles inside the viewport from  sphere to point turn it back to particles okay it's working we need to have grind playing ctrl tweak and put the target object down let's  turn it back to zero zero and zero hide the plane in the viewport let's increase the number of particles  and 0.025 or maybe 3 could be enough and do a simple flipbook   but before doing that let's change some  of the parameters of the target force um now we have very intense target force for entire full particles  but i would like to have some remaining particles   when the number is changing to different  one so let me decrease the force scale 25 minus two for a minimum distance and five  for maximum at a point here put it down yeah as you see some of the  points have less target force here is the flipbook working very well if you want to have more particles around the  number you can use viscosity and not too much but   just a little bit so in the flip solver  value motion viscosity you need to turn   this option on and turn viscosity by attribute  on the rest should be fine and don't forget   to select your flip object in the initial data  don't forget to add viscosity attribute option but also this one the simple array could be using  these and this button here make viscosity it's   turning on all of these options automatically  for you now we should have viscosity   as you see and some particles are sticking to  the ground plane but the thing is most of them   are completely stopped on the ground  play i want to have a little motion   on those area for doing that you can turn on sleep  on collision by default uh all of them all of   the viscose particles are sticking to the ground  plane or any collision object but with this option   we could let them slide on the ground  plane or collision objects so i   I'm gonna turn this option on  and set the slide scale to 0.2 as you see they are sliding on the ground plane   let's do another flipbook and  see what we have right now you can see these remaining  particles in my render as well   for example this part and  you are sliding on the ground okay i think the simulation  part at this stage is good   now let's go to the next part and see how we  can add these colors to your flip simulation to apply color to the particles  you can simply use pop color da the blue color you are watching in the viewport  is coming from visualization part of the flip   fluid object if you go to the guide and set this  parameter to none you don't have any blue color   and here let's say i would  like to have red particles but this color is the same for entire  simulation i would like to have different color   every on every 40 frame based on noise pattern for doing that i've used sop solver in my project  sop solver is a great tool in the dynamic network   if you go inside it you have geometry network  so you have access to all of the sop nodes here   you are reading information from  a dynamic network at this point   you can manipulate or edit those information  by any sop node and then send it back to your   simulation in this case let's say i would like  to change the color of the points i'm going to   use the color shape the regular colors up let's  turn it off for now and i want to change the color   per each 40 frame set it to random from attribute  by changing the seed you will have different color   but i want to do something to change the  seed only on every 40 frame for doing that   we need to use same expression  as what we had before here so on every 40 frame we have different color but it's not what we want you want to have some noise pattern as well  we need to change the color only on those   noisy pattern area you need to go to the target object here i'm going to use the  actual geometry of the number   uh i later on i want to apply a noise pattern to  the points but right now we don't have any points   on the surface it's just completely flat there  is just one primitive to fix that problem you   can use remesh up if you need to have more points  you can decrease target size here let's say 0.1 then point vop let's call it noise drop down until you ask noise  position to p result to the Cd   but the output of the anti-aliased noise is  not between 0 and 1 so you need to clamp it   to 0 and 1 the parameters maybe 10 amplitude  and increase frequency to 3 3 and 3. that's good the pattern is almost same for all  of the numbers because we are not changing the   offset so promote offset by middle click  and here again i'm using this x version you have different number per each 40 frame   maybe it's better to multiply  by some big number maybe 30. okay now if we have different noise  on every 40 frames in the next part   i need to remove black points  with simple and blast node based on Cd attribute the red value of the Cd   if the red value is less than 0.1 just  remove that point and don't forget to   set group type to the points because  Cd attribute is stored on the points and as you see we have some unuseful points they  don't have any polygons to remove those points you   can simply use the add in the polygons turn on  remove and use points and let's call it cd mask inside the AUTODOP network sub solver you  can grab that object here with object merge Cd mask connect color to this object  and now at this part we have   flip particles and here we have the um object  which is coming from the target of target network okay now i want to transfer color  from this part to the flip particles   so we need to use the transfer attribute first input second input we just  want to transfer Cd point attribute   right now the distance threshold is  too much let's say we need to have 0.95 if you want to have smoother or softer edge  you can increase blend with a little bit that's good but we want to transfer color  from this part to the flip particles   only on every 40 frame not for entire frame  range so for doing that you can use switch first input second input okay   if select input is zero it means that we are  reading actual three particles but if it's one we are updating the color of the flame particles  so let's write some simple expression here $F%40 . on every 40 frame we have zero let's say  for example at frame 39 it's 39 but at frame   40 it's zero at frame 79 it's 39 again and  at frame 80 it's zero but we want to have uh   one per each frame so for doing that you  can use for example condition statement if   the result of this expression  is equal to zero it's one let's test it at frame 39 it's zero at frame  40 it's one and again 79 it's zero 80 it's one let's check the simulation the color of the points are white because at  the beginning we are not updating the color   of the points we could use pop color  here to apply some default color only   at the beginning of the simulation we don't  want to use pop color for entire frame range   because after first frame of the simulation we  are updating the color of the particles with this   part not with pop color for doing that  you can play with the activation option   here if it's one it means that we are using  this node in this simulation if it's zero   you're disabling the pop color so let's  say the start frame is one copy parameter paste relative reference and if frame number is  equal to start frame the current frame is equal to   start frame it is one but at the beginning  of the simulation we are not uh computing the   this part of the dynamic network it's happening  on the next frame after first frame which   in this case is frame two so  just add one to start frame   like that now we have default color which  is red and after frame 39 we should have   okay there is a problem let's go inside sub solver okay and oh i forgot to use double equal sign here working very well but we don't have any color  blending for example the red points here are   staying red even when the neighbor points are pink  but in this project we should have some kind of   the color blending as well for doing that you can  simply use attribute blur SOP inside SOP solver   so drop down attribute blur we want to  blur cd attribute and let's say two as   a blurring iteration and don't forget to  set influence type to proximity because   right now we don't have any polygons or edge  between each points in this case you need to   use proximity the first one is useful when you  have polygons and age and something like that and let me do a quick flipbook the flipbook is done and here is the result it's very good and it is exactly what  we wanted we have blending color as well but the problem right now is we  don't have any control over the color   per each number it's just uh using the  random function as color if you want to   have more control over the color for example  you want to have red when the number is true   or you want to have green when the  number is three you can use point one let's call it color picture inside it drop down switch note pro mod switcher  middle click and let's call it color index okay   input 1 promote this parameter the type should  be color and let's promote the first 10 input what switch node is doing is just selecting  one of these inputs as an output or result   based on switcher number for example if switcher  number is zero we are using input one if it's one   if it's for example let's say five we are using  input number six because it's starting from zero   not starting from one and uh of course if it's  nine it means that we are reading input ten   as a result and don't forget to select all  of these inputs and set the type to color and we have different color inputs here   let's define some color for example  red for the first one green blue yellow something like that and if color index is  zero it's using red 1 2 5 and 9 for 10.   now we are using that expression  here again floor($F/40) so   at frame 39 it's zero we are using red at frame  40 it's one we are using the next and at frame 80 we have blue and same for the rest so  i'm gonna use this note instead of color and i would suggest you to  use output note here because   sometimes you might forget to set  display flag to the last note of your   network for example let's say display flag is at  this point on that case sub solver is computing   your network from this point not from the  end of your network but if you are using   output node you guarantee that and sop solver  is computing your entire network from endpoint let's do another flipbook okay so far so good i think that's  good and we could go to the next part now it's time to cash out our simulation to  the disk uh before doing that i would like to   increase the number of flip points let's try 0.01 inside flip mesh we have fluid compress  node don't forget to add Cd attribute here   because we already generated Cd  attribute in the dynamic network   if we want to keep this attribute after fluid  compress we should make sure that we have cd here   i already saved my simulation  to the disk just let me load it and if you wanted to check the particle of  your flip you can use surface preview here we have particle fluid surface the polygon version  of your flip if you check it frame by frame you   should see that we have some flickering issues  usually to fix those flickers using the spherical   method is giving you a better result rather than  using the average positions so i'm going to use   a spherical and it's better to have some smooth  as well if you check it yes we have less flickers okay that's good now it's time to start to  work on lighting shading and rendering for   the rendering part i would like to use  Solaris and render my project with karma   just let me organize these  nodes in the object level we have flip mesh we have ground the ground plane  we have here is useful for   dynamic i can use this as well  but i prefer to use another one okay and let's change the interface to solarize we could use stage network here and also  we could use lab network here as well i'm going to use scene import to import all  of the objects inside the Solaris network   and of course you can use sub import as  well i prefer to use this method i want   to make everything so simple in this  tutorial you can import all of your   object nodes from this network inside  Solaris with just this single node   in the object i'm going to choose FLIP hilip mesh  and of course grant now we have both of them here and don't forget to turn this option off because  and the flip setup already created a shader for us   the liquid the basic liquid shader and it's  assigned to flip mesh if you check it here   but i would like to create my own shaders inside  the Solaris so if you check usd graph here we have   basic liquid which is coming from the regular  material network but if i turn off this option   i don't have that shader here anymore we need to  have camera control click on the camera like the   viewport maybe this camera angle  we need to have environment light   control click we need to have spotlight change  the direction of spotlight somewhere here and if you want to see a rendered version of your  project you can change the perspective to karma so   far so good for the skylight environment flight or  doom light you can use HDRI texture here i'm going   to use the one which is installed with houdini  in the HDRI directory i'm going to use this one and spotlight seems good we have some nice shadow here yeah for now let's keep it as it  is okay what about shader to create   our shaders we need to use material library note  inside it i am going to use a principal shader   one for flip simulation let's call  it liquid and another one for grant to assign those shaders to the corresponding  object you can use material assign or assign   material ctrl click on this button here  for the ground i want to use ground shader   add another one ctrl click for  the flip mesh i would like to use   liquid now inside material library and also if you  check these three here we have our materials here   and the shaders sorry and the  objects okay for the ground i   want to assign grid texture in the textures tab  turn this option on and we have grid texture here "grid.rat" press accept now we have three   i think specular of the ground is a little  harsh let me decrease it a little bit   in the reflectivity set it to 0.5 0.25 a little  more roughness would be nice okay that's good   let's turn off the light icon inside the  render view by using this button okay okay by default principal shader should  use the color attribute from flip mesh as   a base color but right now it's just using  the base color and it's completely gray   i think that's because inside flip mesh i forgot  to add Cd in the particle fluid surface as well   so if you want to keep cd attribute on  your mesh you need to add cd here too okay now it's working but i would like to make it transparent  in transparency set transparency to 1 we have use point color here too  but instead of using this option i prefer to import Cd attribute by using  bind node because on that case i can do some   customization on the Cd attribute before sending  it to the shader so let's do that but the thing is   by default if you are for example working with  mantra what you need to do is just reading cd   attribute by bind note and connect it to the base  color like that but it's not working like that   in the Solaris is let's change the type to vector  because if you check hoodini help it's mentioning   that some of the attributes are converting to the  different attributes when you're working with the   Solaris for example p is going to be points or n  is normal and for the Cd it's going to be display   color so we need to use "display  color" instead of Cd let's do that because it's completely transparent the base  color is not visible let me make it opaque   okay now we are reading see the attribute by this  node and with this method we can something on the   cd attribute before sending it to the shader  for example i can use color correction node maybe less saturation something like that okay  for transparency we need one   and i need to connect the output of this  node to the transmission color as well now we have some color in our liquid  some parts are completely black   because the shadow in those area is black to  fix that problem we have two different methods   we can use Caustics inside the geometry  and shading of the Karma node just turn   this option on or we have the option here  inside the material as well if you go   to the opacity we have fake Caustics i believe  this method is a little faster than working   with the Caustics parameter inside the Karma so  i'm going to use this one now everything is good let me play more with the shader i'm going  to change the distance of the transmission   set it to 0.3 that's much better but delete  the remaining liquid on the floor is not   looking very well let me  take another snapshot here you can see your snapshot by clicking on this  button here like that yeah as you see the liquid   is so unrealistic on this area and we have some  weird specular as well if you check my render we   have much better look of liquid on this area okay  what i did was uh flattening the flip mesh on this   area so let's do that go to the object network  flip mesh i'm going to import ground object that's good and we have flip mesh point VOP let's call it flatten second input to the ground to flatten the mesh on this area we could use x y  z distance so i'm going to drop down XYZ distance   note position to the position of the flip mesh  input a second input of the 0.1 which is ground and it's giving us some information of nearest  primitive of the ground to the current point   if we want to extract some attribute from the  second input we could use primitive attribute node frame to prim uv to prem uv   i would like to read p attribute and of course  connect five to the second input which is grind okay right now if you connect the output of  premium to the p you can see the entire flip mesh   is flatted on the ground but i want to do flatten  only on this area because the liquid the remaining   liquid on the floor is so thick on this area  and we don't want to touch anything on this area   so for doing that we can use  the distance of the XYZ Distance so if the distance of the current point  let's suppose we are talking about this   one if the distance is more than a  certain amount we don't want to do   anything on this point but if the distance  is less than a certain amount we want to   do flatten on that point for doing that  we can use the fit range to change the   range of the distance connect the output of  the feet to cd just for visualization purpose okay for now let me disconnect   this line you can control the range by source  max if you want to have more control over over   the distance you can use ramp attribute  and of course the type should be float to have more smoother result  set interpolation to sphiline that seems good now we want to do flatten  only on the white area so we must use   the output of the ram for flattening operation  and also the flatten should be happening only   towards y-axis we don't care about z or x axis  of the point so i'm going to use vector to flow and float to vector x to x z to z  another vector to float for premium uv okay i'm going to use mix vop the first input should be the original y  position of the points the second input is the new flattened position of the points which is  this node and you can connect the output of the   ram to the bias and the output should be here  okay it's working let me disconnect this line now we have flattened liquid only  on this area not entirely mesh let's go back to Solaris network i think we have yeah we have some  intersection with the ground as well   it's making some artifacts in rendering  and to fix that problem we can push   the ground plane up a little bit at this  point so i'm going to use transform shop   and use a small Y number here 0.01 for example  if you check side view we have some offset now go back to Solaris network the  result is a little better and also   we need to do something inside the shader as  well what i did in this project was besides   the flatten i was using opacity as well for  this area we don't need to have full opacity so we must control the opacity inside the  shader for this area right now we don't have   any attribute to control opacity so let's come  back to the flip mesh we could use the output   of the ram to control opacity if you check  the output is something like that right so connect this to p i'm going to use bind export to  create my custom attribute the name is edge mask inside the shader you can import that attribute with bind because  it's a custom attribute there is no need to rename   it to something else same as what we did here  for the Cd no need for that connect the output to   opacity opacity scale but the result  is the opposite and we need to   invert the edge mask for doing that  you can use the complement node okay that's what we want do another snapshot double click okay that's good but if you go to the  flip mesh we are using same ramp for both   flatten operation as well as controlling  opacity which is not good because if you   for example if you are happy about the flatten  and you are not happy about the opacity if you   change the ramp you are going to change both of  them to fix that problem you can use another run   separately for opacity so here you can remove  edge mask at this point copy this node and   we are not going to change the position of the  points because we did that already with this node   we need just to have oh sorry xyz distance and just for visualization  let's connect it to the cd   yeah now we have to different ramp i  can control this round only for opacity let's call it edge mask and  don't forget to create edge mask maybe it's so transparent go back here you can visualize edge mask with this method as well open this window and click on edge mask it's creating visualizer automatically  for you inside the viewport let's play with feet here okay check the render again oh that was too much there is a problem i think it's  coming from xyz distance because   for example on this part we have  some kind of line let's check it maybe that's because we are changing the  actual position of the points here and   at this point we are reading that  flattened version of the points   as the input of the xyz distance instead of that  i'm going to connect it to the actual flip mesh if it makes sense yes we have different results so let's  do that separately here is the flattened   version here we are creating edge mask i'm  going to use attribute create attribute copy and copy only edge mask from  this side to the other side now let's play with the ramp yeah it's better so far so good we could have some more sharper specular and maybe  a little more saturation on the cut in the color   and inside the solar is material library increased  saturation here and maybe a little darker for specular we could decrease reflectivity because the roughness in the specular here is  affecting the transparency as well the refraction   i mean and instead of that we can use the code  and we have separate roughness for the coat to have very sharp coat we could  use a small number like 0.5 and also it's good to use normal sop at this  point as well to make sure the normal directions   are good because we did some change  in the position of the points here   and we need to update the direction of the  points normal based on the new position right now we are using just one single shader for  flip which is liquid but if you check my project   i have three different shader at  the beginning i have liquid shader   at this number i'm using metal shader  and later on for example at number 8   i have plastic shader of its subsurface  scattering so how we can do that   let's say we have three different shader metal  liquid and plastic we can have just one single   principal shader and by changing some of its  parameters we can turn it to metal liquid or   plastic but also there is another way we can have  three different principal shader per each one and then by using mix swap we can  decide which shader we want to use   in this tutorial i'm going to show you both  of the methods actually i'm going to use   one single principal shader for both liquid  and plastic and another one for metal   i think uh using different principle shader  per each one will be much more simpler   to implement because if you want to use  just one single principal shader for   three different material it will be so complicated  to implement you need to take care of many   parameters of that principle shader but as i  said let's do both methods in this tutorial   before doing anything in the material library  we need to prepare two more point attribute from   simulation the first one is sss attribute to  drive plastic shader and the other one will be   metal attribute to drive metal shader so let's do  that inside dynamic network inside the sub solver in the sop solver we have color picture  i'm going to use and this node for   to create metal and sss attribute as well so  here is another one let's call it sss-picker and the type of those attribute is float  so inside it select all of these inputs and change the type to float  let's call switcher to sss   index and we need to create that attribute  here bind export let's call it sss and make a copy of this node it's for metal metal index the name of attribute  is metal i think that's it okay be careful about these  numbers because as i said the switcher is starting from number  zero so number zero means input one   so if we have zero it means that we are using  number one but what actually we are seeing the   viewport in the flip simulation  is number one so number one is 1   is number zero is one number one is to fix that  problem and we can subtract this expression by one   and same for metal picker  or metal selector or maybe and same for color feature okay so um with this x version input number one  will be number one in the viewport as well uh   i want to use plastic shader only for number two for the metal shade there i'm going to use  metal shader only for number three and 4 zero means a regular liquid shader one  means a plastic shader and here for the   metal one means a metal shader and zero  means either a plastic or liquid shader okay connect it here and add  those attributes name here in the flip mesh don't forget to  add those attributes sss and metal then save it to the disk the simulation is done let's test it to make  sure those attributes are working correctly at this point, we have sss and metal okay just  drop down attribute wrangle temporary @Cd=@sss so number zero is liquid number one is liquid two but number two will be plastic for the metal number 3 and 4 will be metal so it's working and here we  also need to add sss and metal let's go to the shader first let's start with plastic  shader i'm going to import sss the brighter is better okay uh one means plastic right so  we need to connect it to sss we are using subsurface scattering  but once uh it is plastic we don't need   transparency anymore so i'm going to invert sss and then use it to control transparency now we have subsurface scattering  and also we need to connect   the color of the points to ss color as well in the subsurface scattering section   with Karma usually we are getting  good results with random walk now let's go for metal shader  another principal shader and let's assign it to this object temporary turn off point color and make it a little darker set metallic to one okay that's good call it metal now we need mix layer layer mix not mix the first input will be this  shader the second one will be metal and to control the alpha we  need to use metal attribute here is for example flip shader okay at the beginning we have regular transparent on liquid shader and for number two we have subsurface scattering shader  which is driving by this attribute and for number three and four we have metal  shader which is driving by this attribute and also we need to we might  need to connect edge mask to opacity input of metal as well for this area okay so far so good i think that's what we wanted  i'm going to um do some snapshot and show you the   result okay it's done uh for example for frame  one we have liquid for frame two we have plastic   frame three it's metal metal again and for number  five it's going to be liquid again just one thing   i should mention that is if you remember to test  this shader i drag this shader in the render view   to assign it to my flip mesh and with this method  Solaris is creating a new assigned material   at this point but i want to do this with my  own assigned materials so just remove this one and here for flip mesh we need  to select flip shader that's it to render your project to the disk  you need to drop down karma note and   pointed somewhere in your disk the camera is  correct for the resolution we can for example use 1920 by 1080 and here we could increase  pixel samples if you check our flipbook specifically for subsurface scattering, we need  to have more samples it's too noisy so here if   you change convergence mode to distributed  we can increase and samples specifically for   subsurface scattering for example i can increase  it uh maybe 16 and we don't have any volume and we   could decrease reflection samples and refraction  a little bit just to make a render faster but for   final render you can use more numbers here  and same for diffuse maybe two for tests   okay and then uh press render to disk the render  is done when i was checking it i noticed that we   have some problem here uh for example here when  it's turning to plastic shader we have some   visible noise on this area and also when the  color or shader is changing to the different one it's affecting the remaining liquid on  the floor as well if you check this frame   for example this part is going to be green on  the next frame which is not good and same for   this part so i made couple of change  in my setup to fix those problems   the first one is inside the AUTODOP network  for the floor changing color on the floor   what i did was just grouping the points  above the ground by using group expression   if the position of the points uh is more than  0.1 we are putting it inside the top group   and then inside the attribute transfer we are  transferring color and sss and metal attributes   only to those points not all of them so it's not  affecting the remaining particles on the floor and also to fix the problem on  this area to make it more smoother   what i did was inside the flip mesh network  i've used attribute blur to blur subsurface   scattering and metal attribute and putting  three as a blurring iteration and that's it and here is the render of the project with those  changes as you see we have better result and it's pretty much close to what i did before of course i did some pre-comp in  this version inside nuke software uh the setup for this project is almost same as  uh what i did during this tutorial of course i put   the project of this one at the description below  as well it's good for you to take a look at to   both of the project and see what's what's  the difference between these two project   it's mostly about just the parameters the  different pattern of the noise a little   bit maybe difference inside the shader and the  lighting source but the most important thing is   for this version i was using Mantra so  it's good for you to see how you can   rebuild everything with Mantra as well and  if you wanted to keep going with the Karma   you can keep going with this project  which i built for this tutorial and there is a still small problem at  the beginning as you see the liquid   is completely black that's because  at the beginning we don't have any   color attribute or Cd attribute if you go  inside the flip mesh network at the beginning here we don't have any Cd attribute  and if you go to the next frame we have Cd the attribute then probably uh we did  something wrong here when using the pop color   but it's not so important because very simply  you can add a Cd attribute just for the first   frame for example by using a regular color sop  and a switch not for example red color or white   color based on the color of the simulation  at the beginning which is red in this case   and okay that's it for now let's go  for the other subject of this project   if you check this project more closely  at the beginning we have yellow color   and then we are injecting the blue color to  the flip simulation and the blending result   between blue and yellow is green but  it's not like that when you are working   usually when you are working with any 3d  software because in most of the 3d softwares   we are using rgb color system or color model what  we need here is using ryb or red yellow blue color   model or color systems so you need to  convert your rgb color system to the ryb   and if i want to show you the difference between  these two color systems and in the left side we   have rgb and the right side we have ryb there is  two different between these two color models the   first one is about the primary colors here  the primary colors are red blue and green   and the secondary colors are magenta cyan and  yellow and in the right side the primary colors   are red blue and yellow so here yellow is one of  the primary colors but here the green is one of   the primary color and here the secondary colors  are purple green and orange the other difference   between these two color system is here the color  model is additive which means that if you want to   create other secondary colors you need to add  primally colors for example for magenta we need to   add red color to blue color or for the  cyan we need to add blue and green color   but here the color model is subtractive which  means to have for example purple we need to   subtract red and blue and for the green we need to  subtract blue and yellow and same for the orange   and also as you see the subtraction  of all of the primary colors   is black but here the addition of the primary  colors is white if you search around the   internet you will find lots of free source codes  with different programming language to convert   rgb color to the into the ryb or in the opposite  way and what i did was choosing one of those   source codes and translate it to the VEX code so  i can use that vex code in my project i already   put that vex code inside the digital asset and  if you download the project of this tutorial you   will have access to that digital asset as well  and feel free to use it in your own projects to install that digital asset in your project you  need to go to the assets install asset library and   then install ryb_rgb.hda after that you will have  two new nodes in the VOP network if you drop down   point one and under JK you will have rgb to ryb  and of course RYB2RGB and and if you wanted to see   how i build this digital asset you can  just dive inside it and you will have   full access to the vex code of digital asset if  you wanted to know how this operation is working to test this project i've built a very simple  rgb color wheel and here is rgb color wheel   the one we are seeing the viewport and after  that i converted the RGB to RYB color model   and here is the result of the RYB color and wheel  you can check that here as well at the left side   we have rgb color wheel the primary colors  are red blue and green and the blending result   of blue and green will be cyan same as  what we have here red blue and green   and here is the scion in the right side we have  RYB color wheel the primary colors of course are   red blue and yellow the blending result of  the blue and yellow will be green same as here   red blue and yellow and here is the green and of  course you can turn it back to rgb color system   by using another node ryb2rgb for example and  inside it instead of this node you can use ryb2rgb and the result will be exactly  same as what we have at this point let's come back to the project again  here is the project of this version i've used   rgb to RYB node here after reading  the simulation file from the disk we have blue color we have yellow color and  of course we have green color just be careful   because if you check the colors before this note  we have green color and blue color the green color   you are watching inside the viewport is not the  actual color because as i said houdini is using   rgb color system in both viewport and event the ui  if you go inside AUTODOP network inside SOP solver   here we have green color the value is zero one  and zero but we are going to use ryb color system   later on so the primary color will be red yellow  and blue not red green and blue so the one here   is referring to the yellow color not green color  so the color the green color here will be yellow okay that's the end of the first part of  this tutorial in the next video i will   talk about this project and i will show you  how you can create custom force to control   free particles directly thanks for watching  this video and see you in the next tutorial
Info
Channel: Sadjad Rabiee
Views: 29,023
Rating: undefined out of 5
Keywords: Houdini, Flip, Morph, Liquid, Fluid, Blending, Color, RYB, RGB, Mixing, Particle, Dynamic, SImulation, Water, SuctionForce, TargetForce, VDB, Mantra, Counter, CG, CGI, FX, VFX, Motion, Graphic, Mograph, HoudiniFX, هودینی, آموزش, جلوه های ویژه, موشن گرافیک, مورف, مایعات, آب, پارتیکل, شبیه سازی, تلفیق, داینامیک, Flip Solver, Tutorial, Training, Color Model, Color System, Color Blending, Suction Fluid, Flip Fluids, Karma, Solaris, houdini fx, morphing, houdini morph, flip morph, liquid morph, water morph, blend shape
Id: rs1Ig5bK0E8
Channel Id: undefined
Length: 100min 27sec (6027 seconds)
Published: Mon May 30 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.