The Road Decals pack helps you to enrich your roads by adding more detail such as cracks, oil spills, dirt, puddles, damaged asphalt, and much more.
The pack contains both the asset files for the road decals as well as ready made configurations for our tools Gaia and GeNa so you can bring those decals on your roads quickly.
For a quick introduction, please see this mini tutorial video:
You can download the pack here from Canopy:
You can discuss the pack on the forum here:
Read on for more in-depth information about the pack.
If you wish to use this pack with GeNa Spawners, ensure you install the following:
You can install the assets in any order.
Then install the Road Decals Volume 1 from Procedural Worlds. It will be installed into the following directories.
Road Decals Volume 1
Content Resources: The textures and materials used to build the assets.
Decal Prefabs: Ready-made presets that can be added to the scene.
Documentation: Contains this document
Gena Spawners: Gena spawners to quickly spawn the Road Decal assets with GeNa
The package itself can be installed through Assets -> Import Package -> Custom Package. There are no other setup steps required beyond the initial installation. You might want to fine tune the HDRP parameters for decal rendering, more information can be found in the “Optimisation” chapter further down in the manual.
This asset currently only supports HDRP in Unity versions 2019 and above.
Using the Road Decals
Using as Prefab / Game Object
Prefabs have been made of each decal texture set that include the ‘Decal Projector’ component. A relative offset has been applied to allow better collisions with GeNa roads. To use a decal prefab, navigate to any prefab in the Decal Prefabs folder, select it, and drag it into the scene.
Adjustments to the projection depth and size of the decal can be made by lifting the prefab up, or by editing the prefab component and adjusting the scale in the Decal Projector Component.
NOTE: In previous versions of Unity, the Projection Depth parameter was grouped with the Size parameter in the Z component.
To use the premade spawners for GeNa, navigate to their location in the project: Procedural Worlds -> Content Packs -> Decals -> Road Decals Volume 1 -> GeNa Spawners. Select the GeNa road in which to spawn the decals on and add a new Extension of type Spawner.
Under the Spawner section, drag in the spawner you wish to use in the Spawner variable.
The rate in which the decals are spawned apart from each other can be adjusted through the Flow Rate number. Smaller numbers result in smaller distances apart.
Flow Rate = 5
Flow Rate = 1
The range in which the decals can be spawned are controlled by the Spawn Range and the Throw Distance parameters. The Spawn Range controls the maximum area in which a decal can be spawned in. The Throw Distance controls the maximum distance a decal can spawn to the next spawn location. A Throw Distance of 0 will ensure no decals are spawned in overlapping Spawn Ranges.
It is recommended to enable the following settings for correct alignment with the GeNa road:
- Align to Spline
- Conform to Slope
- Conform Children
To respawn the set of decals along the spline with a different random seed, the ‘Iterate’ button can be pressed.
Further projection offsets can be altered from the spawned decals along the road through adjusting the Offset Position Y parameter.
Unity provides a couple of settings to alter the performance impact of drawing decals on screen. They can be found in the project’s HD Render Pipeline Asset.
Draw Distance controls the maximum distance at which decals are drawn to. This parameter also works in conjunction with each Decal Projector’s Start Fade parameter – where at a certain distance the decals will fade out.
Decals are combined into a texture atlas to save performance. If your decals in the scene suddenly renders incorrectly, as shown below:
Unity displays an error related to the atlas size:
Increasing the Atlas Width and Atlas Height will allow more decals to be drawn on screen at once. Reducing the sizes of the textures used on the decal material will also allow more space for more decals to be drawn.
The Metal and Ambient Occlusion Properties should be enabled if the decal materials make use of these outputs in their rendering, which some of the assets in this pack to make use of.
The Maximum Clustered Decals on Screen parameter controls how many decals can be drawn in the frame when rendering on top of transparent gameobjects, such as the road. A value of 1 will only allow 1 decal to drawn on the screen, if even it is surrounded by many more. The default value of 512 should be enough.
NOTE: Decals are spawned with gameobject prefabs. Whilst the HD Render Pipeline Asset allows for a maximum draw distance to be set on the decals, the gameobjects will still be active in the scene, which still contributes to the overall performance of the scene. Turning currently invisible decal prefabs off from a distance may help reduce the time taken to each frame.