mercoledì 3 ottobre 2012

Houdini - UV on particle fluids

Last week I did some research about the techniques to add UVs on particle fluid.
Apparently it might seem rather pointless to map a liquid (since the texture will mix by itself and become chaotic in a few moments), but if you have to simulate a viscous liquid, the motion of the particles will be slow and limited, allowing you achieve some nice and slowly "advecting" UVs.


First of all, we have to distinguish two main cases:

1. Dynamics has not been simulated yet. In this case, all you have to do is create UVs and transfer the corresponding attribute to the particles in SOP context BEFORE you run the simulation: in this way you'll simulate particles that store UV while advecting and, after the simulation, you'll be able to transfer the uv attribute from particles to the particle fluid surface.


2. You have already done the simulation (in Houdini or external software, like Real Flow). In this case, you have to add somehow the uv attribute to particles in the first frame and make it follow the dynamics.

So,
  • create the particle fluid surface in the first frame and lock the particle surface node;
  • create UVs on this locked node and promote the uv attribute from vertex to point;
  • still working in the first frame, transfer the uv attribute from the particle surface to simulated particles and lock the attrib transfer node (see the picture below);
  • make the particles with UV follow the original particles;
  • create a new particle surface node and make sure you transfer the uv attribute to it


Note: more particles you have, the more precise are the resulting UVs.

You can download a sample scene from here (password: valeriodinapoli).

1 commento: