Skip to content
Curious Trove
Workflow Imported assets OctoShaper 1.2Updated

Procedural Prefabs

A procedural prefab turns a graph and its settings into an imported Unity asset. Unity rebuilds it whenever the graph, its parameters or a sampled texture changes, so you get a reusable result without generating anything in Play Mode.

Create one

  1. In the Project window, select the folder where the asset should live.
  2. Choose Create > OctoShaper > Procedural Prefab and name it. In 1.2 it is created and named directly in that folder.
  3. Assign the graph, set its parameters and click Apply.

Generated graph code must be available. Run Tools > OctoShaper > Generate Graph Code if the import complains.

Change a setting, and the asset reimports.

What gets saved

Graph output In the procedural prefab
Spawned prefabs Prefab instances in the hierarchy
Draw Instanced / Indirect rows Drawn meshes, kept with their transforms, submeshes and shadow settings
Generated meshes and temporary materials Subassets of the .octoasset
Material overrides Serialized with referenced textures. Temporary Texture2D overrides become subassets
Sampled textures Tracked as dependencies, so editing a height or color map triggers a reimport

Moving the prefab moves its drawn geometry and parent hierarchies with it. Indirect rendering still needs a shader compatible with OctoShaper's _InstanceData buffer. Transient RenderTextures must be baked to Texture2D assets before import.

Connect rendered output to Main Output. The generated hierarchy is rebuilt on every reimport, so don't edit it by hand.

Procedural prefab or executor?

Procedural prefab Procedural Graph Executor
Generates At import time In Edit Mode or Play Mode
Result lives In the project, as an asset In the scene
Regenerates When inputs change When you, or gameplay, ask
Best for Props and pieces you reuse Content that reacts to the game

Frequently asked questions

Can I edit the generated hierarchy of a procedural prefab?
No. It is rebuilt on every reimport. Change the graph or the prefab's parameters instead.
Why does my procedural prefab fail to import?
Imports use generated graph code. Run Tools > OctoShaper > Generate Graph Code and let Unity compile, then reimport.
Do procedural prefabs keep GPU-instanced meshes?
Yes. Direct and indirect drawn meshes, material overrides, transforms, submeshes and shadow settings are preserved in Edit Mode and Play Mode.