Learning Houdini

May 19, 2022

Learning Houdini

I’m learning houdini. I’ve heard it’s very intimidating and that it can be a lot, but I love the things you can do with it and want to be able to create them.

Notes

Watching a video for a little bit before diving in: https://www.youtube.com/watch?v=ysujwGvr2_8

noting that the layout for the nodes in their complex project is pretty unweildy. wondering what tools there are for managing this complexity. probably ways of grouping nodes together, but wondering about making composite transforms and saving to your own library. also wondering if there is a hybrid between node ui and file based structure.

Ok so there is this learn section of the sidefx website with various learning paths. https://www.sidefx.com/learn/

Seems like I will need to decide which route to go and which things I want to focus on. So it’s a good time to decide what I want from this.

I want to mainly work mathmatically / with noise and ops mostly. Less so on modeling since I think that will be harder for me and isn’t where I want to spend my time. I’m more concerned with procedurally generating things and animating them procedurally. I also want a good looking render in the end. Nice-to-haves later on might be stuff with simulation of fire, fluids, destruction but fine doing just geometry stuff for now. It would also be cool to bring in data that I can prepare in python or something. So say we get an image model producing some interesting visual that I use houdini to super charge. Another exciting prospect might be to drive some animation from audio data that I process in python before hand.

So out of the topics that they have in the learning houdini page (getting started, modeling, lighting and rendering, character rigging, pyro fx, fluids, destruction, …) I think it makes the most sense to do the getting startedm and lighting and rendering sections first. I think the first project should just be to get a simple render of like a cube or sphere moving around. And have realistic lighting and pretty colors.

This core essentials training seems promissing https://www.youtube.com/watch?v=0W4CJ0BdTRA&list=PL4XNGOsVprEqkgMtaxoDqi5yL-IL0yc0F

https://www.hipflask.how/

Notes on this video https://www.youtube.com/watch?v=0W4CJ0BdTRA

There are the tabs below the greate geometry bar. These are like the different workspace configurations. specialized for each step in the creation lifecycle

scene view. view and interact with the objects in the scene

on the left there are the selection and handle tools for directly interacting with stuff

on the right there are buttons for the display options

on the other views there are more specialized tools

The panes on the right hand side of the editor, they are configurable and you can create a new scene view in the pane for example. by default it has the nework view

you can drag panes over to different places

tool bars have black arrows on them that can be used to stow away the tools to clean up some space

if you click on the small arrows on the dividers in between panes you can collapse the whole pane. you can click the same arrow to regain that pane

you can also resize the panes by dragging the divider.

you can maximize a pane by clicking on the white rectangle in the top right of the pane or ctl + B

you can tear off a pane tab by clicking the down arrow next to the white rectangle. this will make a new window with just that pane

the same down arrow lets you split it horizontally or vertically

Notes on this video https://www.youtube.com/watch?v=ayPWWrVvIS4

At the bottom, there is the playbar

Below the play controls, you can open the global animation controls to set the framerate, duration. etc with the left most button (the one with the pane with a mouse on it)

At the top, above the three main panes we have shelves with a divider between them

each shelves have tabs with a collection of shelf tools.

there may be more tools than the shelf can hold in which case you can scroll over them to see the others.

there is a plus icon to add another shelf (there are more collections of tools that they have in the default shelves)

Above the shelves, there is the file, edit, etc menus

Next to the file, edit, render… menu, there is a selection box for the “desktops” menu which are layout presents. They are premade configurations for which panes and tools are available. The default is the build desktop, but there are others specifically suited to animation or the look or games etc. You can make some changes from an existing desktop and save it as a new one (desktop menu > save current desktop as) or even build one from the ground up.

To the right of the desktop dropdown, there is the radial menus dropdown which lets you set the toolset that comes up when you activate a radial menu in the viewport (hitting the “c” key). you can edit and customize these, but I don’t know if I see myself using them much just yet

On the right hand side fot he menu bar, there is the Takes menu (says Main in there by default). Takes are a way of saving sets of parameter settings. So you might have one take with lower quality dev settings and then another for final production quality.

Hmm the next video in the playlist is not the same video as on the site… that’s pretty annoying. Also I’m running into performance issues moving a cube around in the viewport. Going to install updates on my computer and restart

Had a day of houdini not starting and having to install updates, uninstall houdini, repair, and reinstall… Then also got a few random crashes, but I started watching a presentation about houdini used in some commercials. I saw a cool wavy grid and used it as insiration for a quick render that I made by myself!

The render exported into a file format called .exr which I hadn’t seen before. It took some searching but eventually found that it is a format made by ILM which is a bitmap format and preserves all detail and supports hdr. I couldn’t really find a converter for taking the .exr sequence and getting a video file but I guessed this was something DaVinci Resolve could handle and I was right!! I just dragged and dropped the files into the media section and voila!

wavyboi.mov

It’s not perfect but it has some charm! A camera moves in closer to a mysterious ondulating plane. The camera appears to be out of focus - I think I messed up the camera settings but it’s something!

Now watching some more tutorials on the houdini website. Seems like these videos are hit or miss but I’m going to try some more starting with this one https://www.sidefx.com/tutorials/h-in-5-part-02-your-first-node-tree/?collection=78

Noting some variables that are important but never really listed somewhere obvious

  • Cd (the color of points)
  • pscale
  • P

Moving on to this video: https://www.sidefx.com/tutorials/h-in-5-part-03-attributes/?collection=78

Ahh the good shit. Taking a look at the geometry spreadsheet. Looks really useful and should be good for seeing what attributes are available and debugging stuff.

You can toggle which types of things are shown (points, vertices, primitives)

You can middle mouse on a node to get a summary of the spreadsheet. (or click the i button when you mouse over)

Difference between a point and a vertex (houdini has both) is that a vertex is a datastructure that assigns a point to the corner of a polygon. As such, one point might have multiple vertices or multiple polygons.

Template point attributes are the mysterious pscale, Cd, P stuff!

https://www.sidefx.com/docs/houdini/model/attributes this has a bunch of them… probably worth reading this page over.

This video now https://www.sidefx.com/tutorials/h-in-5-part-04-rendering/?collection=78

With attribute randomize, there is a handy Two Values feature.

You can control click the camera icon from the right shelf at the top, you can create a camera at the location and orientation of the viewport.

You can lock the camera to the position of the viewport by clicking the lock next to the button in the top right of the viewport where you can also select which camera you are looking through. This would have been handy to know when I was setting up the camera keyframes from my wavy boi render.

We can set up the render resolution and also the focal length in the camera’s View settings.

For lighting, a simple environment light setup can be to use an HDR image. To do this, control click the environment light button on the top right shelf. Then in the light settings, for the environment map, choose a .hdr file. You can download these from the internet and store them somewhere you can find. You can increase the intensity of the background by using the light intensity slider.

You can create a new tab in the obeject viewer by hitting control t

With the new tab, set the dropdown as an out setting and drop in a mantra node. With it selected, go to the rendering tab, and use physically based renderng as the rendering engine.

Create another tab and make it a mat type.

created a classicshader node and set base color to white. think this will be because we want to use the color from the geometry.

then we can go back to the obj context where we can assign the material to the spheres.

Add a background plane by dropping down a grid node in the obj context. Double click into it, set the plane’s orientation to be in the xy axis. Then go back up and wire the grid to the camera so it is parented to the position of the camera. Then we can push it back behind the subject.

Can create another material for the background, this time setting the base color to be what you want the background to be. Tip: alt drag a node to create a copy

On the render page, you can click the camera button in the bttom section to take a screenshot of what is rendered so you can go make changes and compare to previous snapshots.

Putting a point light behind the balls looks pretty nice. You can set the background material to disable base reflections to get rid of the nasty spectral highlight and lower the exposure to make it softer.

To enable depth of field, select the camera and hit z while over the viewport with the transform tool selected. Then you drag the little cube to the center of focus and dial in the conesto narrow the depth of the field of focus. Then for the depth of field to actually show up in the render, go to out context and in mantra, check the box for depth of field.

To increase the render settings, in the sampling tab, increase pixel samples from 3x3 to something like 12x12. Can also adjust the noise level threshold. To get a sense of final quality you can switch the rendering mode from progressive (does the whole image at increasing quality over time) to turning that off and rendering each small swatch in full quality and getting to new sections over time. This can give you an idea of the final render quality without needing to wait for convergence.

This video has some tips on how to paint a density onto a surface which you can use to drive point scattering https://www.sidefx.com/tutorials/h-in-5-part-06-art-directing-your-scattered-spheres/?collection=78

For animating noise or anything really, you can shift click the number attribute and the keyframe editor will open. Then you can alt click the number to add a keyframe. Then it will give you a curve which you can change to tune the animation such as switching to linear. To switch to linear, click the curve then choose the linear icon.

When we scatter points onto a changing geometry and use point relaxing, this can cause a lot of jitter and be very slow since we are needing to do all those costly steps over the changing geo. Instead, we just want to move the points along the y axis.

VOPs

make a point vop to do some scripting over the points. allows you to do some more custom stuff. To access, double click into it and there are a different type of node which gives you access to the primitives directly. This lets you do specific math using the inputs available to you. It’s more low level than standard SOPs

Unified noise is useful. But note that time-dependent variables like setting the offset using the frame number must have their parameter promoted in order to work. You can promote a parameter by middle clicking.

For loops can let you repeatedly operate over a geometry. There is an op for a for loop and it wraps up some steps in the sop context.

There are also for each loops which you can use to iterate over input primitives. To get the iteration number, you need to click on the for loop begin node and then hit create meta import node which creates a node with the iteration number and the total number. To reference these numbers you use the default("../foreach_begin1_metadata1/", "iteration", 0) syntax. Though remember VOP as an option to use instead of foreach in many cases. Foreach will be much less performant than native nodes or VOPS.

Solvers are good for doing for loop-type behaviors but when you are doing so over the course of an animation. Instead of using a for loop which must be run on each frame resulting in n^2 work, you can use a Solver to take in the previous frame as input to the next frame.

To use one, drop in a solver node into the geo’s context and wire in the geo.

When double clicked into the solver, you get four input nodes which are the inputs that the solver node had and you also have a node which is the previous frame.

The reason you would pass in the geometry as an input to the solver would be for the base case. You are supposed to set down a switch node to check if it is the first frame (use the input) or not (use the prev frame).

VDB - volume representation

VDB from polygons converts a mesh into a volume which can be reconverted into a mesh

Smooth sdf can make it smoother

convert vdb brings back to mesh

you can get rid of some artifacts introduced by normal errors by using the attribute blur node.

on a solver, you can hit the reset simulation button (in the node details) to un-cache the result

there is a performance monitor tab in the north east pane where the node details usually are which you can use to measure which nodes are the slowest

POP networks are executed bottom to top.

Ok So I’ve been watching some more advanced videos about simulation of fire and liquids in houdini and it is all very cool, but I think I need to get back to the basics and play around with geometry and materials more. I also have been doing a lot of comparison shopping between the differnt rendering engine options. There are a few that are much better than the free renderer inside houdini (mantra) that enable rendering using the GPU instead of the CPU which I think is going to basically be essential if I want to produce anything of any complexity at home. The problem is they all cost several hundred dollars per year and I’m not totally sure if I’m going to make it worth it. I’ll also need to upgrade from the free version of houdini to the indie version which would be another $270/year. All of this to say that I have been distracted from my initial goals.

Originally I stated my main goals for houdini and they were to use its powerful procedural tools to generate and animate interesting 3d art which was visually interesting and beautiful. Simulations of fluids and fabrics are interesting and worth exploring, but only after I’ve put a dent into my goals.

With that said, I’m going to do some tinkering with the stuff I’ve learned. First… coming up with an idea…

I want to do some sort of growth. I’ve seen cool videos of infection setups, but that might be ambitious — I’m going to do this without looking at any outside resources so that I learn what I do and don’t know.

make a spiral out of the points from a line

@P.x = 1 * cos(@ptnum * 2 * PI / 50);
@P.y = 0.01 * @ptnum;
@P.z = 1 * sin(@ptnum * 2 * PI / 50);

Procrastinated a little bit watching this: https://www.artstation.com/artwork/OQZkk

Get back to this later ^

Also dope: https://www.artstation.com/artwork/v8AaY

Ok so getting into it. I’m going to try to make a procedural geometry generation setup in the next hour. First I will try to go about it using a for loop style and then I will adapt it to use a solver to be able to animate it.

The idea will be simple: basically start with a sphere, extrude the faces a random amout and generate further spheres. The “spheres” will have a varying number of rows/columns so their structure will be different. For example, when 3x3, the shape resembles conjoined 4 sided pyramids.

^ That idea didn’t really work very well, it ended up looking like a big meatball…

I’m struggling to wrap my head around keeping track of “objects”. There are operations to iterate over primitives, points, vertices, but I’m not sure how best to do something with the objects I copy to points…

Primitives seem to usually be faces.

I guess I could use a for loop instead of copy to points?

Found a lovely video by Deborah Fowler https://www.youtube.com/watch?v=tnGWKTe_ClE

In this video she details how to procedurally generate a wall of windows.

shes doing a curious thing using

float window = ch("../box1/sizex");
float wall = ch("../grid1/sizex");

actually thing she is just going to use the float size value of these to calculate how many windows to place but I wonder if you could leave off the /sizex and get a reference to the geometry object?? wonder what type that would be. Hope we find out!

Eh the video didn’t end up covering it. It just calculated where to place points and copied the windows to points.

Here is a VEX tutorial series https://www.youtube.com/watch?v=k4q1UQp4x6U&list=PLhyeWJ40aDkVmhEHlCKRvy10lNobG0KZT

Here is a geometry one, https://www.youtube.com/watch?v=uYC-tBtCtLA

maybe it will be useful

holy shit this seems like a bad way to do things

Entagma geometry with VEX tutorial

https://www.youtube.com/watch?v=bR0V4bADRxY

useful link listing all VEX functions https://www.sidefx.com/docs/houdini/vex/functions/index.html

write down thoughts about renderers and how the karma one came in clutch

I was doing a lot of looking into renderers because using mantra was a pretty bad experience. It was very far from interactive and would take several minutes of rendering to get a poor quality render per frame. This would rule out animations because it takes hours and hours to get anything and the quality is not good. So I started looking into the different options including arnold and redshift. Redshift seemed like the way to go although there is a fair bit of setup and it also costs several hundred dollars per year so was debating if I would bit the bullet on this after I got back from vacation. Additionally, since I am using the free version of houdini, I couldn’t render at a resolution greater than 720p which is sad because no matter how much effort I put into the shot, it wouldn’t really be useable (also means that mantra would be even worse for high resoltution). And if I bought a fancy renderer, I would likely also need to purchase a license for houdini. And the renderer put ugly watermarks on top of the render in the highlights.

I was figuring I would need to shell out $600 for the setup in order to really be competitive but then I started looking into the keynote presentation for the new houdini version. They talked about the new karma renderer which looked to be gpu accelerated and interactive. I swapped it in for a render and was blown away. I was now able to render out the same scenes which took hours with my cpu’s at full usage in seconds silently. What’s more, I was able to export in 4k! A 4k render of the scene with something like 50x the light bounces took less time than the grainy 720p shot mantra did! So sick! They will probably limit the free version resolution after it is out of alpha but oh my is it nice right now. This would at least cut the cost to only paying for houdini rather than also redshift.

write down resolve issues with the exr files and figuring it out

I was having a tough time getting my renders to look right when coming from the exr format that the houdini renders gave me. When I brought the images into resolve, they looked quite different than in the render view in houdini and when I used an online viewer, they looked different again. This problem inspired me to get to know resolve’s coloring tools better and I watched a tutorial from black magic that was one of the best tutorials I have ever seen. It gave me a great sense for what to do and how to manage the colors in the image and I feel so baller knowing what I need to do to make the images coming out of houdini look dope.

I’m in Florence, Italy right now having just left Montepulciano and Rome. While in Rome, I was amazed at all of the architecture and how impressive columns can be. When standing in awe near the larger ones, I was struck by how impressive they feel even though their structure is fairly simple and familiar. We have columns everywhere and they never really evoked the feelings I got standing next to the massive imposing columns in Rome. Their sheer scale alone transformed the experience of the object. This is something that I want to establish in my work. I want to learn how to properly set things up so that is possible to achieve a sense of scale digitally and convey the power and strength of my objects.

I also found the Altare Della Patria incredible. More than anything else I have seen, I found this structure to be incredible. The immense scale, the attention to detail, the use of impressive columns, the way that the building dwarves the viewer with its expansive steps and mountain of marble. I would like to produce a feeling similar in digital form.

I started with creating the simplest element - the column. With my limited houdini experience, my plan was to use tube as the column and then use a circle to define a set of points upon which to copy some thinner tubes that I could use to cut out the shape of the grooves you find on certain styles of columns that I like. The approach worked pretty well and I was able to use a boolean node to do the cutting out. Next I started creating more shapes for accents to the column which all were placed procedurally based on the parameters of the others. There are a few parameters which I would like to be able to dial in later on when placing them in the final scene and ideally I would like to be able to make many different types of columns by playing with the parameters. So I started looking into houdini digital assets which allow you to roll up your network of nodes into a node which you can use elsewhere. You can save these digital assets and use them in other projects and can access them in the tab menu! very cool!

https://www.youtube.com/watch?v=WYU-MdpA9qc&list=PLXNFA1EysfYnnm2-UZmxrd-MWC7LTWEVl&index=2

I’m in Venice doing some more work on the columns. I’ve done some work to turn the setup into an HDA which lets me use it as a node in the project which is pretty sweet. I have set configurations for the important knobs like the number of grooves that get cut into the column, their size, and how many cords are in the bundle on the capital. I had some tough challenges in trying to get some of the pieces mostly right. Such as the ring at the foot which subtly tapers out so that it is more of a natural transition into the pedestal. One of the trickiest things was the bundle of cables at the capital. These were tricky because I didn’t know / remember how to extrude out a polygon along a curve. I spent a lot of time going through all of the polygon and fusing related nodes and trying to copy circles and toruses onto curves and points, but couldn’t find the thing that did the trick. Eventually I found this video https://www.youtube.com/watch?v=ZEu5NQahvTw which has a section on the “Sweep” node! and I knew that this is what I was after. There was also the challenge of placing the cords in the circle such that they had the correct spacing and where I could control both how many cords were in the group as well as how thick they were. I had to find a bit of math to find the formula for the distance from the center to the vertices on a regular polygon to be able to space them correctly. But even still they had some gaps which I realized are due to low poly count on the rings which were being paired up edge to edge (farther than vertex to vertex). With increased polly count it isn’t too noticeable.

here is the progress so far:

I’m now at the marco polo airport in Venice. I’ve decided to start reading through the houdini docs. Starting with the Working with Objects section.

At a starbucks in prague — we are waiting to go to another work cafe which requires reservations but while here, I am watching this video https://www.youtube.com/watch?v=cAXVb3pBwFI which is showing some cool techniques for applying noise and other operations to volumes. Specifically there is a very cool one with turbulent noise which I think could be a good one for weathering / causing distress to the columns to age them nicely. Combine that with some different internal materials and it could be dope. Also seems like it could be cool for when I make a hogwarts or something.

Yesterday at a beer garden in prague, Marsela and I were chatting over a flight of beers and I started to vocalize some of what I have been mulling over in terms of life trajectory and career in the next few years. I see learning houdini as a good starting point towards at least three very interesting futures. 1 - becoming a pro vfx artist working on more technical stuff at a weta type place, 2 - getting more experience with gpu computing for application in ML and future hardware specific to AI, 3 - bringing AI and LLM’s to gaming to create new full world experiences. Each of these is pretty exciting to me and have a common requisite of some graphics background.

Back to that video, at 7:50ish he explains how to do a copy to points while also varying a random attribute allowing for unique copies rather than exact copies. More nice patterns for a couple minutes there after but allowing you to generate different variations. Turns out copy to points looks for a variant attribute (Piece attribute).

In this video https://www.youtube.com/watch?v=W9ggbLr6wNY&list=PLkb7MHt0xUF0oz6CDgTplh_dVbfjXGeLy&index=16 he uses a different method for getting variations. This one is perhaps the more scalable version as it writes them to disk.

I was working in Prague on making some stone walls. We went to a work cafe which required reservations and there wasn’t any space so we went to a nearby starbucks for a couple hours until our reservation time. I ran into a number of challenges with just not really knowing how to accomplish a low level basic task such as to get normals on a curve so that the stones would face the correct direction or how to get the variant mapping to work so that I could generate and use many different variations of stones. I was very frustrated how I couldn’t find a resource to explain these sort of fundamental capabilities. The docs for some of the nodes didn’t give me enough information to understand what was going on and youtube tutorial videos just tell you all the buttons to press to do their exact setup which isn’t helpful for generalization.

Now I’m in a Starbucks in Amsterdam. I didn’t work on this stuff since Prague because we only had one full day here, but we are checked out and waiting for our train to paris and I have been reading some of the node docs and also headed over to the learning section on the houdini site and there’s actually a brick wall tutorial that was posted two days ago! Its basically exactly what I was trying to accomplish in Prague so it will be really nice to see how he approaches a problem that I put some effort into. So far I watched the intro and in video 02 he mentions the exact trick for giving normals to curves based on their tangent using the polyframe node! I think? this is what I had done randomly trying stuff but maybe not.

Here is the brick wall tutorial series: https://www.youtube.com/watch?v=J2Tf_OIy9CA&list=PLNbgmFvU__fiPhyUWHHzZ2Nv5ieM_bOdB&index=2

https://fspy.io/

Modeling hogwarts

kind of a pain to model things in houdini but probably means I’m approaching it wrong.

Tried doing a block out but even doing that is a pain… can’t easily copy paste unless you keep very organized. Hard to work from high level down. Seems like work in houdini begins low level.

The strat might be to first break down what each of the components are in the building and then to start building them one by one. Will also probably want to be creating digital assets along the way.

Something like the entire hogwarts castle may be too complex for a beginner. Maybe a room or greenhouse would be a better place to start.

It would be great to create a tool that makes it easier to describe constraints relative to other objects such as “have the same origin as this object” or “set origin to the right bound of a box”. So that it is not necessary to do the math in each node.

Annoying things that I have questions about

  • combining multiple flat polygons or curves as in with greenhouse trusses and holes
  • dividing polygons into a uniform grid as in the case of the windows on a surface
  • edge loops

Match size is my best friend in the whole wide world

Progress pic

Material Properties Notes