Houdini Tutorial - Nodes: Attribute Nodes

December 12, 2018

This tutorial is a little bit different to our other releases. We've also dropped the tutorial numbering. We'll now be having "Houdini Tutorials" or "Houdini Quick Tutorials". This tutorial goes over a number of the 'attribute nodes' that we have access to. As you would expect, these nodes are used to affect attributes. This means that they work well with VEX and VOPs. This tutorial is mostly meant for beginners but the latter parts of the tutorial go over more obscure and/or less common nodes so there is something for even the more seasoned Houdini user. 

 

 

Creating the Sphere Intro

 

The sphere intro is an alteration of the attribute interpolation shown in the tutorial. There are a few minor tweaks to it. Firstly, there are a few attributes that are necessary to create and initialize before we copy points to the scattered points that we are interpolating. In a wrangle before the copy to points, enter the following code: 

 

float range = length(@P);
@pscale = range;
float fitRange = fit(range,0.7,1.5,0,1);
@emitint = chramp('emitramp',fitRange);
v@emitcolor = chramp('ramp',fitRange);
v@Cd = v@emitcolor;

 

The above code does a few things:

 

float range = length(@P);

@pscale = range;

 

Sets an @pscale value which is recognized by copy to points and defines the scale of the incoming point. This will control how big each copied geometry is. Length(@P) is a function that finds the distance of a vector. It uses the following formula:

 

 

This is the formula to find the magnitude of a vector. In this case, we are finding the magnitude of @P. This allows us to determine how far from the origin our @P is. Thus, by setting our @pscale equal to this value, our points that are further from the center of the sphere are given a larger @pscale value. Our further points will now be larger. 

 

float fitRange = fit(range,0.7,1.5,0,1); 

 

Creates a range for our points' magnitudes. I manually found the minimum and maximum range values by checking the @pscale values in the attribute inspector. It turned out to be 0.7 and 1.5 respectively. The fit() function fits values between a new minimum and maximum based on an existing minimum and maximum. We fit it between 0 and 1 to ensure that when we use the ramps, our values do not exceed the ramps' ranges.

 

@emitint = chramp('emitramp',fitRange);
v@emitcolor = chramp('ramp',fitRange);

 

Here we control the emission intensity (@emitint) which controls the brightness of our points. We use a ramp so that only the points with the highest magnitude are lit up.

 

Similarly, with our emission color, we use a ramp to control the colors of our points. The points with higher magnitudes are given color when they pass a certain threshold. 

Remember: you'll need to go into the parameter editor to change your ramp from float to color

 

Finally, we set our @Cd attribute to be equal to our @emitcolor. This allows our ramp to control diffuse color as well.

 

To get the attribute interpolate system used in the intro, you can download it here.

 

 

If you think we're awesome then go like our Facebook page

 

or subscribe to our YouTube Channel

 

If you would like us to recreate any movie effects or have any ideas of your own then please comment down below and we'll try our best to do it.

 

 We're open to criticism, feel free to tell us what you would like to have us do differently or more of.

 

 

 

 

 

 

 

 

Share on Facebook
Share on Twitter
Please reload

Related Posts
Please reload

Follow Us
  • Facebook - Black Circle
  • Twitter - Black Circle
  • YouTube - Black Circle
Support our Tutorials
Patreon_White.png
Search By Month
Please reload

Search By Tag
Please reload

Recent Posts
Please reload