The Road and Curb Shaders, extends on the Standard Shader and build on the options found in the old non PBR shaders. Additionally you can now enable and disable functionality to allow you to have a much lighter version of the shader for roads outside of the track ribbon for example.
You can find the technical reference for these shaders here: IBL Road & Curb Shaders
It's recommend that you read PBR - Using Standard Shader before proceeding with this article, as issues are not covered again such as UV options and Material Adjust settings.
If we take a step back, compared to the previous non PBR version of the shader what has changed? Well a brief summary would be as follows:
All of these are in addition to standard upgrades such as the ability to enable and disable maps and input static values as well as UVW and Material Adjust options explained previously.
With the new shader we can enable and disable large features of the Road Shader on a per material basis.
This is the build up of rubber on the racing line as cars drive around the track.
The way this is shown is controlled by the grooveMap. This is a two channel mask for the groove.
Map acts as a mask for the effect, and the Albedo, Roughness, Specular and AO is all configured via Shader Parameters.
The mask works by blending in the Red Channel over the first 50% of wear and then the Green Channel over the second 50% of wear. The maximum value of the two is used.
For this reason it's recommended that the two masks are different, and the red mask slightly darker than the green mask.
Additionally, pre-baked wear can be configured by painting in details to the Road Details map - Green Channel, if it is being used.
Beneath shows the groove effects with "Heavy.rrbin" at Le Mans.
We should limit this effect to drive able surfaces, and as before for it to be dynamic objects need to be prefixed with "RaceSurface".
This is the build up of rubber "marbles" off the racing line as cars drive around the track.
The way these are shown is controlled by the red channel of the MarbleDustMask map, and the Marble profile in the Shader Parameters. Similar to how the Groove works.
Unfortunately there is no space to add a normal map for the marbles and as such they just appear as a static overlay. Normal map information beneath them is ignored though.
Beneath shows how Marbles would look if they were everywhere!
We should limit this effect to drive able surfaces, and as before for it to be dynamic objects need to be prefixed with "RaceSurface".
Via the red channel of the Road Details Map we can paint in areas that we wish dust to occur on the track by default. Dust will then be removed when cars drive over the section, and can be added in areas Marbles occur too.
This effect is profiled very similar to the way marbles are. The green channel of the Marble Dust Mask Map contains an opacity mask for the tiling dust pattern.
There are additional settings in the Dust parameter section where you can configure the visual profile (it's colour, AO, Specular & Roughness).
Additionally there are scalars to limit the overall maximum amount of dust, as well as how much dust should appear underneath areas where Marbles build up.
We would limit this effect to drive able surfaces.
Wet Effects covers the entire range of wet effects on the road. From darkening the albedo as the road gets damp, to the reflections both from puddles, and also seams that follow the road surface.
The seams that follow the road surface are controlled by the BlendWetMaskMap Green Channel. The areas that are black on this become more reflective when damp than those that are not.
For large surface puddles, we paint them in a puddle map, similar as before. This is now packed into the alpha channel of the RoadDetails map.
The shader code for handling wet weather at this time is the same as the old shader, aside from some lightness clamps. There are intentions to improve this in the future.
It is possible to disable rain drops splashing in puddles with out disabling any other of the wet weather features. This maybe recommended for road surfaces outside of the track ribbon.
A good way to setup unique types of roads is to group together asphalt detail maps by type and use these as sets.
This is done by using an Overlay, Normal and AO Specular Map to create a profile for the finer details of the road.
With the Overlay map, the rgb values are applied to the Albedo map, and the alpha channel is applied to the Roughness map.
Set all of these up to use WorldPlanar mapping either directly in the shader or through the UVW you export, and with the same scale.
Additionally these details can be blended out via the Blend Mask found in the Red Channel of the Blend Wet Mask.
A typical good suggestion for this is to have it use the same mapping as the Albedo map, but stretched ever so slightly so that the details don't tile perfectly. This will break up tiling patterns on the road a little bit.
In the above image you can see some areas where the detail map is not being used as strongly. The values used in this area are configured by the No Overlay section in Parameters. Note that Roughness value is used as an Overlay, where AO and Specular are just multipliers.
This effect can be disabled by disabling the Use Mask option next to Overlay Map in the Shader Configuration area.
The Road Detail Map is a Map which covers the entire drive-able surface and should be shared with all road and curb materials.
It tells us where dust should appear, allows pre-baking of groove, adds wear effects and also contains the puddle map information.
Here I explain how you can generate this map using 3ds Max and Substance Designer.
There is an early version of a Substance generator for the Road Details Map available in the Substance Utility Pack
This generator takes several inputs as follows:
In order to generate most of these inputs, it is necessary to do the following:
3ds Max
Substance Designer
Beneath you can see the sample setup for Circuit d'Azur.
Hook up the generated masks to the RoadDetailsGenerator as follows:
You can then configure various parameters and scalars to adjust the effects as you please.
The generator outputs both the final result and various steps along the way to help you fine tune the settings.
Sample Final Road Details Map:
When using the Curb Shader, the maps are re-arranged a little and we have a second Albedo Roughness Map to play with.
These two maps are blended together based on the road information so that in some areas the same curb can look more worn.
The shader parameters beneath allow us to configure this, splitting up how much of an effect comes from the Road Detail Map's Wear Information found in the blue channel, as well as how much the blend occurs based on current Groove and Marbles levels.
The blend is carried out using a mix map function, using the blendMask and the bias configured beneath.