Houdini: Rendering water droplets on an animated object (using an alembic from Maya)
I was really struggling with this over the weekend, but I think I've figured it out. I guess being sick today was something of a blessing in disguise, as I was forced to create an alembic from scratch (due to not being on the animation lab machines) and gain a better understanding of how this works.
This is going to look like an absolute abomination for now, but I'll have something better-looking up once I actually work with the real object. We'll see if what I did applies to the more complicated alembic from the animation team, too, but it should.
Yeah, it looks kind of creepy, but we can see that these are clearly water droplets. I just haven't art directed it much because it's a test scene. I have only default lights/materials/etc.
First off, we can just create an easy test alembic in Maya:
I have keyed this sphere at frames 1 and 3. So at frame 1, it will be at (0, 0, 0), and at frame 2, it will be at (0, 0.5, 0). It will stay like that for the rest of the animation. Exciting, eh? Right now, there's no need to complicate anything.
Remember that to animate and key a frame in Maya, you simply move the slider to the select frame, adjust the Transform's XYZ attributes as desired, and then hit S on your keyboard. You want to key frame 1 no matter what, so the animation knows what to do at the beginning. Or at least, I couldn't get it working without doing that.
Then, hit the play button at the lower RH corner to make sure it jumps up, and then just stays there. It does. Here is the playblast in gif format:
Pretty lame but hey. It's all we need. Then, go to Cache -> Alembic Cache -> Export All to Alembic, and choose a destination.
Next, our Houdini steps:
1. Open up Houdini. Import the Alembic by going to File -> Import -> Alembic Scene.
Make sure to fill the Object Path section with the actual pSphereShape.
You will see an Alembic archive show up in OBJ as follows:
Go inside the node until you get to the inside of the pSphereShape node:
2. You won't see the unpack node -- you will have to add it yourself. If you don't add this unpack node, you will experience weird behavior. All you have to do is TAB in an Unpack SOP at this level:
Then wire it up and adjust visibility.
3. Go up a level:
Click on Source Particle Emitter:
And you should see this:
A source_particles node.
4. Go ahead and give that a glass texture. Also drag in Iron for the Material Palette.
Ok, now this will render as glass. But it won't render as a sphere yet, which we need to make bubbles.
5. So, create a Primitive node inside of the sphere object like so, check Particle Render Type, and ensure that the type is set to Spheres:
Nice. Now we need to actually mess with the sim so the particles stay stuck to the sphere as it animates.
6. Go inside the Auto DOP Network. Don't worry about the env light and camera yet.
7. On the POP Source node, Attributes tab, change the initial state to Stopped. Otherwise, the bubbles will fly all over the place.
8. On the Birth tab of the POP Source Node, change the Constant Activation to only be 1 at the first frame. This way, it won't keep spawning more bubbles. I also upped the constant birth rate to 18000 so the bubbles would be less sparsely scattered throughout the sphere.
9. Next, add a Camera node and place it wherever you think is best. Remember that you can lock the camera in order to move its position. Add the Iron texture to the sphere using its Render tab.
15. Sit, wait, and contemplate the loneliness and ephemerality of this mortal existence as the rendering process slows down your computer significantly.
16. And there's our final render. It's a bit jittery but it works:
And there it is! The water droplets stay stuck to the sphere as it animates.
Comments
Post a Comment