Rock
A deterministic procedural rock built from an icosphere with layered noise, asymmetry, facets, ridges and ground flattening.
Rock is a procedural rock generated from an icosphere. Layered noise, asymmetry, stretch, compression, facets, ridges and ground flattening are stacked on top of the sphere, so a single Seed value gives you an endless supply of distinct boulders without sculpting anything by hand.
Generation is deterministic — the same settings always produce the same rock. Nothing is baked into the scene file beyond the settings themselves, so a rock stays editable forever.
Geometry
The base is an icosphere subdivided Subdivision times. Each vertex direction is then pushed through a fixed pipeline:
- Asymmetry — scales the radius along
Asymmetry Direction, so one side grows and the opposite side shrinks. - Lobes — optional bulges, each with its own direction, radius, strength and sharpness.
- Ridge — raises (or cuts) a band around the plane defined by
Ridge Normal.Ridge Sharpnesscontrols how tight the band is. - Noise — the Large, Medium and Small layers are added on top of each other. The resulting radius is clamped to 0.2 ~ 2.5.
- Stretch → Compression → Facets → Top / Bottom Flatten, in that order.
- Ground — the bottom is flattened and the whole rock is shifted down by
Ground Embed.
Finally the unit shape is scaled into the Width · Height · Depth box. The pivot sits at the center of the bottom face, so a rock at y = 0 rests on the ground.
Parameters
Size
| Label | Script key | Default | Range | Description |
|---|---|---|---|---|
| Width | w | 3 | 0.01 ~ 10000 | Size along local X (m) |
| Depth | d | 2.5 | 0.01 ~ 10000 | Size along local Z (m) |
| Height | h | 1.8 | 0.01 ~ 10000 | Size along local Y (m) |
| Subdivision | ord | 2 | 0 ~ 4 | Icosphere subdivision level — the final density after baking |
Rock Settings
Everything below lives under the Rock Settings group in the Inspector.
| Label | Script key | Default | Range | Description |
|---|---|---|---|---|
| Seed | seed | 1 | int | Master seed. Changing it reshuffles every noise layer |
| Asymmetry Direction | rockasymmetrydirection | (1, 0.25, 0) | vector | The direction the rock leans toward |
| Asymmetry Amount | rockasymmetry | 0.12 | 0 ~ 1 | How strongly it leans. 0 is perfectly symmetric |
| Stretch Direction | rockstretchdirection | (1, 0, 0) | vector | Axis to stretch along |
| Stretch Amount | rockstretch | 0 | -0.9 ~ 3 | Positive stretches, negative squashes |
| Compression Direction | rockcompressiondirection | (1, 0, 0) | vector | Direction of the flat cut |
| Compression Amount | rockcompression | 0 | 0 ~ 1 | Strength of the cut. 0 disables it |
| Compression Distance | — | 0.75 | -1 ~ 1.5 | Where the cutting plane sits |
| Compression Blend Distance | — | 0.2 | 0.001 ~ 1 | How softly the cut blends into the body |
| Flatten Top | rockflattentop | 0 | 0 ~ 1 | Flattens the top face |
| Flatten Bottom | rockflattenbottom | 0 | 0 ~ 1 | Flattens the bottom face |
| Ground Flatten | rockgroundflatten | 0.55 | 0 ~ 1 | Flattens the contact area so the rock sits on the ground without a gap |
| Ground Embed | rockgroundembed | 0.05 | 0 ~ 10 | Sinks the rock below the pivot plane (m) |
| Angularity | rockangularity | 0.15 | 0 ~ 1 | How sharply facets bite in. High values give a chiselled look |
| Automatic Facet Count | rockfacetcount | 4 | 0 ~ 24 | Number of facet planes generated automatically |
| Facet Strength | rockfacetstrength | 0.25 | 0 ~ 1 | How deep each facet cuts |
| Facet Size Variation | — | 0.25 | 0 ~ 1 | Spread of facet sizes |
| Ridge Normal | rockridgenormal | (0, 0, 1) | vector | Normal of the plane the ridge runs along |
| Ridge Strength | rockridgestrength | 0 | -1 ~ 1 | Positive raises a ridge, negative carves a groove |
| Ridge Sharpness | rockridgesharpness | 6 | 0.1 ~ 32 | Higher values make the ridge narrower |
| Flat Shading | rockflatshading | off | on / off | Splits vertices per face for a hard low-poly look |
| Write Vertex Masks | rockmasks | off | on / off | Writes shader masks into vertex colors |
Each Noise layer (Large · Medium · Small) exposes the same fields:
| Label | Default (Large / Medium / Small) | Range | Description |
|---|---|---|---|
| Enabled | on / on / off | on / off | Whether the layer contributes |
| Frequency | 0.8 / 2.1 / 5.0 | above 0 | Feature size — higher is finer |
| Amplitude | 0.16 / 0.07 / 0.025 | 0 ~ 1 | How far it displaces the surface |
| Octaves | 2 / 2 / 1 | 1 ~ 6 | Fractal layer count |
| Lacunarity | 2.0 | 1 ~ 4 | Frequency multiplier per octave |
| Persistence | 0.5 | 0 ~ 1 | Amplitude falloff per octave |
| Offset | (0, 0, 0) | vector | Shifts the noise field |
| Seed | 11 / 29 / 47 | int | Per-layer seed, combined with the master Seed |
Vertex masks
With Write Vertex Masks on, each vertex color carries a mask a shader can read:
| Channel | Meaning |
|---|---|
| R | Variation |
| G | Moss |
| B | Dirt |
| A | Wetness |
The masks are derived from slope and height, so moss lands on upward faces and dirt gathers near the base. Leave it off if your material does not use them — the colors are extra vertex data either way.
Collider
| Label | Default | Description |
|---|---|---|
| Collider Mode | None | None · MeshCollider · SimplifiedMeshCollider |
| Collider Subdivision | 1 | Subdivision used for the collider mesh (0 ~ 4) |
Simplified Mesh Collider builds the collider at a lower subdivision than the visible mesh, which is almost always what you want for a rock.
Presets
Pick one in the Preset dropdown and press Apply Preset. This overwrites all Rock Settings, so apply the preset first and fine-tune afterwards.
| Preset | Script value | Character |
|---|---|---|
| Rounded River Rock | river | Smooth and rounded, worn by water. Weak facets, strong ground flattening |
| Mountain Boulder | boulder | Large and angular with deep facets and coarse noise |
| Flat Rock | flat | Flattened top and bottom — a stepping stone or a slab |
| Vertical Rock | vertical | Stretched upward into a standing stone or pillar |
| Low Poly Rock | lowpoly | Flat shading with hard facets, for a stylized look |
Preview and Bake
A rock is built in Preview Mode by default, which caps the subdivision at Preview Subdivision (default 1) so dragging sliders stays responsive.
- Generate Preview — returns to the light preview mesh.
- Bake Rock — rebuilds at the full Subdivision and generates the collider.
Preview Mode is only a display cap; the settings are untouched, so you can switch back and forth freely. Bake before you ship a scene, or the rock will be left at preview density.
How to create
-
Drag in empty space to set the base rectangle — Width and Depth.
-
Move the mouse up to set the Height.
-
Click to finish. Adjust Seed until you like the silhouette, then bake.
Scene view editing
The ±X, ±Y and ±Z handles drive Width, Height and Depth. Everything else is edited in the Inspector.
Tips
Scatter with the Seed, not with new shapes. Duplicate one rock, change only its Seed, and you get an unrelated silhouette at the same size and density.
Non-uniform Width · Depth · Height is the cheapest variety of all — the same seed reads as a different rock once it is flattened or stretched.
For cliff faces, raise Ridge Strength and point Ridge Normal along the wall. For rubble, use Flat Rock with a low Subdivision.
Keep Ground Embed slightly above 0 so the rock never floats on uneven terrain.
Turn on Flat Shading for a stylized scene — it also makes low Subdivision values read as deliberate rather than cheap.
Script
In a script this shape is written as rock (alias boulder).
rock "RiverStone" w=1.2 d=1 h=0.6 preset=river seed=7 @0,0,0
rock "Boulder" w=4 d=3.5 h=3 preset=boulder ord=3 seed=21 @5,0,0
rock "Menhir" w=1 d=1 h=4 preset=vertical seed=3 @10,0,0
rock "Stylized" w=2 d=2 h=1.4 preset=lowpoly rockflatshading=1 @15,0,0
Beyond preset and seed, the individual settings are available as rockasymmetry, rockstretch, rockangularity, rockfacetcount, rockfacetstrength, rockridgestrength, rockgroundflatten and so on. Use preview=0 to bake from a script.
See also — Shape Type List · Creating Shapes and Modes · Scene Script Syntax
