Quick Start: Samples

The sample scene BridgeHouse is configured for the Universal Render Pipeline (URP), the High Definition Render Pipeline (HDRP) and the Built-In Render Pipeline. This page documents the samples, while the other pages document each part in depth, starting with the Spline Generators Overview.

Open the sample scene

Before you open the scene, import PolyBash and install the Unity packages that it needs, as the section Requirements describes.

After the import, open the scene Assets/Snowtop/PolyBash Samples/Scenes/BridgeHouse/BridgeHouse.unity from the Project window.

The first load takes longer than a normal scene load. The scene contains Texture Definition Applier and Surface Variant Applier components, one for each textured material that a generator uses. The sample includes its textures in the folder Assets/Snowtop/PolyBash Samples/GeneratedTextures. On the first load, the appliers create the materials in that folder from those textures. The generators then rebuild with the new materials, and the scene is complete.

The appliers work only in the editor, and they do nothing in Play Mode or in a player build. The generated textures stay in your project as normal assets.

Scene contents

GameObject Component It shows
RedHouseGenerator Spline Building Generator A two level building.
BlueHouseGenerator Spline Building Generator A single level building that uses a second level to extend the height of part of the first level.
RedHouseStairs Spline Stair Path Generator The stairway that leads to the second level of RedHouseGenerator.
Bridge Spline Stair Path Generator The bridge that carries both buildings, with stairs on both ends.

RedHouseGenerator and RedHouseStairs are children of RedHouse, and BlueHouseGenerator is a child of BlueHouse.

Each generator GameObject also carries several applier components, which fill its material fields. A Texture Definition Applier captures one texture definition from the folder Assets/Snowtop/PolyBash/Texture Definitions. A Surface Variant Applier bakes one surface variant from the folder Assets/Snowtop/PolyBash/Surface Variants. Every applier writes its output into the folder Assets/Snowtop/PolyBash Samples/GeneratedTextures.

Sample prefabs

The folder Assets/Snowtop/PolyBash Samples/Prefabs holds two sample prefabs, and each prefab carries its generators together with their appliers.

Prefab It shows
Assets/Snowtop/PolyBash Samples/Prefabs/SplineBuildingSample.prefab A building with a door, windows, a floor opening and a roof on the child SplineBuilding, and a stair path on the child SplineBuildingStairs.
Assets/Snowtop/PolyBash Samples/Prefabs/SplineStairPathSample.prefab One stair path with stairs, a flat path, side walls, a tunnel with an arch frame, edge trims and railings.

Experiment with the scene

  • Select a generator and move a knot of its spline. The generator rebuilds immediately.
  • Open the inspector of a generator. Each optional stage, such as the roof, has its own section with a checkbox. The section Developer view explains how to display the list of every stage.
  • On BlueHouseGenerator, find the Surface Variant Applier whose Variant field shows SurfaceVariant-Wood, and drag its Gradient Interpolation slider. The applier bakes a recolored texture, and the generator updates with it. No other applier uses this surface variant, so the other generators keep their colors.
  • Open an asset in the folder Assets/Snowtop/PolyBash/Texture Definitions, and select Capture Preview in its Preview section. The preview shows the captured layout, and it writes no image file.
  • Open the Save to Prefab section of a generator, and select Save to Prefab…. The new prefab receives copies of the generated meshes, so you can use it in any scene. A material that is a project asset stays a reference. A later rebuild of the generator does not modify the prefab. The section Save to Prefab documents the options of the save.

Troubleshooting

Problem Cause and fix
The surfaces of the sample show no textures. The appliers run only in the editor, and only outside Play Mode. Exit Play Mode, select a generator GameObject, and select Capture Now or Bake Now on its appliers.
The textures look stale after an edit. An applier reuses the textures that exist on disk. Select Recapture on a Texture Definition Applier, or Rebake on a Surface Variant Applier.

Next steps