Houdini 20.0 Nodes Geometry nodes

Attribute Randomize geometry node

Generates random attribute values of various distributions.

On this page
Since 14.0

Overview

This node generates random values to create or modify an attribute.

Turn on the Visualize as Points toggle to preview the probability distribution as a generated point cloud whose positions are drawn from the distribution.

Parameters

Group

The subset of geometry whose attribute should be modified.

This can be a point, vertex, primitive, or edge group. If necessary, it will be expanded to a point, vertex, or primitive group, depending on the value of Attribute Class. If the input geometry doesn’t have the specified attribute, geometry elements outside the group will get the value zero.

Group Type

The type of group that Group specifies.

If Guess from Group is specified and the group type is ambiguous, the guess is made that Group specifies a point group.

Attribute Class

The type of elements for which to create or modify the attribute specified by, Attribute Name.

Attribute Name

The name of the attribute to create or modify.

It will be added to the type of elements specified by Attribute Class.

Operation

Specifies how to modify existing attribute values. If the attribute doesn’t already exist, this should be Set Value.

Set Value means that the generated value will be written over the existing attribute value. Add Value means that the generated value will be added to the existing attribute value. Minimum/Maximum means that the final attribute value will be the minimum/maximum of the generated value and the existing attribute value. Multiply means that the existing attribute value will be multiplied by the generated value.

Global Scale

Scales the generated value just before applying the operation specified by Operation.

Distribution

Distribution

Overall type of probability distribution from which values are generated.

Constant Value

The generated values will all be the specified value, instead of being random.

Two Values

The generated values will either be Value A or Value B, depending on Probability of Value B.

Uniform (Continuous)

The generated values will be between Min Value and Max Value, with equal probability for all values in that range.

Uniform (Discrete)

The generated values will be between Min Value and Max Value (inclusive), landing only on values that are some multiple of Step Size greater than Min Value.

Direction or Orientation

The generated values will be unit vectors (i.e. length 1) with the specified number of Dimensions. The samples will be uniform random unit vectors, within any Cone Angle of Direction, unless Bias Toward Direction is used.

Note

For 4 Dimensions that Cone Angle is the maximum quaternion rotation angle away from Direction, which is twice the Euclidean cone angle of the unit 4D hypersphere being sampled.

Inside Sphere

The generated values will be vectors with length less than 1, i.e. inside the unit sphere, with the specified number of Dimensions. The samples will be uniform random unit vectors, within any Cone Angle of Direction, unless Bias Toward Direction is used.

Normal (Gaussian)

The generated values will be drawn from the normal distribution whose mean/median is given by Middle Value, and whose standard deviation is given by Scale Around Middle.

In multiple Dimensions, this distribution is naturally isotropic, i.e. rotationally symmetrical.

Exponential

The generated values will be drawn from the exponential distribution whose median is given by Middle Value. The mean and the standard deviation are equal to the median divided by ln(2).

Log-Normal

The generated values will be drawn from the log-normal distribution whose median is given by Middle Value, and whose standard deviation is given by Spread Around Middle. This distribution is useful for generating random scales, because its values are strictly positive, and it tapers off toward zero, helping avoid scales that are too small or negative.

The parameter μ, of the underlying normal distribution is ln(median). The parameter σ, of the underlying normal distribution is sqrt(log(0.5*(1 + sqrt(1 + 4*(stddev*stddev)/(median*median))))).

Cauchy-Lorentz

The generated values will be drawn from the Cauchy distribution whose median is given by Middle Value, and whose scale parameter, γ, is given by Scale Around Middle. This distribution has larger tails than the normal distribution, so it has more outliers, meaning that Min Value and Max Value will probably be useful for preventing problematic outliers.

With Dimensions greater than 1, this samples the multi-variate Cauchy distribution, forcing the distribution to be isotropic, i.e. rotationally symmetrical. For 2 Dimensions, this is the distribution of photons hitting a plane from a point light at (0,0,scale).

Custom Ramp

The custom ramp will be sampled as the inverse cumulative distribution function (inverse CDF) of a probability distribution, and then scaled by Fit Value 1 To minus Fit Value 0 To, and added to Fit Value 0 To.

Custom Discrete

The specified values will be sampled with the specified weights, i.e. unnormalized probabilities.

Type

Specifies whether to randomly sample from a list of Float or String values.

Options

Visualize as Points

When enabled, the specified number of points are generated whose positions are sampled from the specified distribution, instead of modifying input geometry. No input is needed when this is enabled.

Visualize as Points

When enabled, the specified number of points are generated whose positions are sampled from the specified distribution, instead of modifying input geometry. No input is needed when this is enabled.

Fraction Attribute

This gives a way of non-randomly sampling the distribution, by specifying locations in the uniform parametric space of the distribution, known as “quantiles”.

For example, if the fraction attribute is 0.61 for some element, and the distribution is continuous and 1-dimensional, the resulting value should be greater than exactly 61% of samples, if one were to sample the distribution an infinite number of times. For multi-dimensional distributions, the fraction attribute should have as many components as are needed to represent the distribution. For example, when sampling directions in 3D, it should have size 2, corresponding (non-linearly) with longitude and latitude.

Global Seed

All generated values depend (psuedo)randomly on this value. No two Attribute Randomize nodes in a scene should have the same value here, unless required, because the same or similar values may be generated if two are the same. Choose a different value if the current seed produces samples that are from the right distribution, but happen to be undesirable samples.

This is not applicable when Fraction Attribute is enabled.

Seed Attribute

Normally the element number is mixed with the Global Seed parameter to form the random seed for each element. The Seed Attribute can be used instead. An explicit attribute allows for consistent generation when deleting geometry by using a consistent ID.

You can also change of seeds for just a few elements. For example, if the randomization is approved for most of the model but needs to be re-rolled for a subset, those elements can be given new seeds.

This is not applicable when Fraction Attribute is enabled.

If the specified seed attribute cannot be found the element number will be used.

See also

Geometry nodes