> [!abstract] Summary
> **Scattering in Houdini** — the foundational technique for environments: scatter **points** on a surface, then place **instances** of an asset on each point. Covers masking (mask-by-features, attribute paint), point creation (scatter & align), scale and orientation variation, scatter-in-scatter, and the **LOP-side Scatter / Instancer** for USD with the 6 reference/inherit/specialize methods explained.
---
# Basics
- **Scatter** points on a surface, then assign **instances** of an asset to each point.
- **Instance:**
- Tree geometry is impossible to duplicate — the polycount would explode.
- An instance is a **reference** to the source geo that uses far less data → polycount stays manageable.
- *If you change the source object, all instances update automatically.*
- The act of instancing is called **scattering**.
- You scatter **on points**.
---
# Mask — Where to Scatter
## Mask by Features
- Builds a definition based on the object's tessellation. Writes it into the **mask attribute**.
### Parameters
- **Vector** — direction-based (e.g. light direction for moss on the lit side).
- **Shadow.**
- **Ambient Occlusion.**
### Inputs
- **3rd input** — caster influence geo, without including the geo itself.
### Common Use
- **Scatter around a rock:**
- Use the **inverted AO mask**.
- Use a **group** to select the interaction between rock and ground via a **bounding-box region** mask.
## Hand-Paint Masking
- Use the **Attribute Paint** node.
---
# Make Points
## Scatter and Align
The big difference vs the plain Scatter node: **automatic `pscale`** — sizes instances based on distance to neighbours, avoiding overlap.
### Parameters
- **Density:**
- Point-count method.
- Use the **mask attribute** (typically `mask`) as the density input.
- ![[file-20240904190427704.png]]
- **Coverage** — pulls points closer together.
- **Orientation** — rotation. Maximise variation to avoid visible repetition.
- **Alignment** — direction facing.
- **Relax** — pushes points apart, removes overlap.
> [!info] Reference
> [SideFX — What's New in 18.5](https://www.sidefx.com/products/whats-new-18-5/) — original `scatter_and_align` rollout.
---
# Variations
## Scale
**Attribute Randomize** node:
- Uniform scale.
- Min/Max for variation.
- ![[file-20240904183915820.png]]
- Or **Attribute Randomize** with `pscale` to **keep** `pscale` at `1` while randomising other attributes.
## Piece Variation
- **Attribute from Pieces** in **random** mode with **piece weight** to control how often each variant appears.
## Constrained Rotation
- Constrain rotation to multiples of **90°** for grid-like layouts.
- ![[file-20240912174113612.png]]
---
# Scatter-in-Scatter
Use the **second input** of Scatter and Align to integrate another scatter set into the current one.
![[file-20240912171255875.png]]
## City Example
- Drive scatter density by **point spacing** to avoid building collisions.
- ![[file-20240915141932221.png]]
---
# Scatter on the LOP / USD side
> [!tip] Prefer a Collection node for prototype selection
> Build a collection of the variants you want to instance, then feed it to the Instancer LOP. Cleaner than picking prims one by one.
### Per-prototype variant scattering
1. Use an [**Explore Variants**](https://www.sidefx.com/docs/houdini/nodes/lop/explorevariants.html) node on the second input of the Instancer LOP.
2. Specify the variant set(s) you want to use as prototypes.
3. On the **Instancer**, set **Prototype Primitives** to target the prototypes generated from Explore Variants.
4. **Uncheck** *Only Copy Specified Prototype Primitives*.
### Per-point visibility
You can create a `usdvisibility` **point string** SOP attribute to control the visibility metadata of the corresponding USD prim / point instance. Valid values: `invisible` or `inherit`. If you create point instances, this visibility is converted to an `invisibleIds` USD attribute.
## Instancing Methods (Instancer LOP)
> See also [SideFX — Instancing in USD](https://www.sidefx.com/docs/houdini/solaris/instancing.html).
| Method | What it does |
|---|---|
| **Point Instancer** | A single prim (with the prototypes as children) that draws the instanced geometry on-demand in the viewer/renderer. Cheapest at scale. |
| **Instanceable Reference** | Creates an instanceable prim at each point. Separate prims in the scene graph, individual top-level overrides possible, but descendants share a "shadow" copy (not editable per-instance). |
| **Reference** | Separate prim at each point that **references** the prototype. More storage than instanceable, but descendants are editable / override-able. |
| **Instanceable Inherit** | Like "Instanceable Reference" but instance prims **inherit** from the source instead of referencing. |
| **Inherit** | Like "Reference" but with **inherit** composition arc. |
| **Instanceable Specialize** | Like "Instanceable Reference" but with **specialize** composition arc. |
| **Specialize** | Like "Reference" but with **specialize** composition arc. |
---
# 🔗 Related
- [[../SOLARIS/WORKFLOW/SOLARIS Instancing|SOLARIS Instancing]] — LOP-side workflow.
- [[../ENVIRONMENT/Houdini Environment Workflow|Houdini Environment Workflow]] — full env pipeline.
- [[Houdini Scatter on curve|Scatter on Curve]] — scatter onto a curve.
- [[../../../ARTFX OSMIUM/PIPELINE/Notes/DETAILS/PIPELINE ENVIRONMENT|OSMIUM PIPELINE ENVIRONMENT]] — set dressing context.