Wheel Rendering

The wheels are rendered with great detail in Subtransit at highest quality settings and the highest detail LOD model. The wheels are a product of a complex multi-layered material and some mesh decal based multi-layering… but mostly just the product of how the source texture is made! As usual, this is just work in progress – only the base rendering with little to no polishing done on it.

wheel1

wheel4

The wheel mesh is divided into four distinct mesh elements: the main wheel body, the rolling surface, additional meshes that are not rendered when wheel is installed in the bogey and a transition decal that masks transition from painted to rolling surface.

The additional pieces are the wheel axis endpoints (which are part of the bearings assembly that normally keeps wheels attached to the bogey frame through the primary suspension) and the reductor gear, which is normally hidden inside the reductor assembly and isn’t rendered in-game.

wheel3

Most of the wheel is rendered with the common base shader used for all other objects. Primer paint is applied to the wheel, with additional layers of edge wear based on model curvature and dirt based on occlusion/cavity map. An additional decal is used to mask a complicated transition between the multi-layered based material and the rolling surface.

wheel2

The wheel encodes three UV maps that are used for rendering:

  1. General UV map that is used for reading curvature/occlusion maps, used by the decal to map the decal texture to a proper gradient and transition
  2. UV map that is used to read the tint mask (in decal and in the base material) that adds white paint over the normal primer
  3. Additional UV map for the rolling surface of the wheel, which maps the rolling surface to a continuous wide texture strip

The effect of the transition decal can be seen here. This decal is a modified version of the base material, masked with a rust texture. It supports the same features as the base material of the wheel, giving a nearly complete smooth transition (currently the texture mapping is discontinuous between the main primer and the decal – but that may be refined in the future):


The rolling surface is made from the albedo texture that I’ve drawn as a composition of several photo sources (all taken by me over the span of development) and the physmap (a special texture that encodes height, roughness and metallicity variation of the surface):


The variation map is drawn based on the albedo and is normalized to represent gaussian variation of physics parameters centered at 0.5. I will explain how this works more in the further posts, but this just means that the exact PBR values for metallicity/roughness and variation range can be specified in-engine.

The decal mask is very simple and ugly. All of the interesting variation comes from running two threshold filters against the alpha channel of this texture. One threshold filter creates the clip mask that is used as opacity for the decal. The second threshold filter clips the normal paint material and fades out to the rust material – adding the subtle effect of rust that divides the wheel rolling surface from the paint layers.

texture1

The wheel presented above is just a reference/work in progress version. The actual game will feature a variety of different wheel textures, as in real life the wheels vary in different ways. They can be freshly primed/painted or they may have been in use for a long while (getting a thick coat of raildust over them). Independently of that, the wheels may be freshly cut or well worn after prolonged use, as well as contain additional indications of damage.

Subtransit physics engine supports per-wheel slip and heating calculations, creating a possibility for another wheel-rendering related feature. After heavy braking (involving wheels getting locked) it would be possible to find thermal damage traces over the wheel surface. These marks will be done through a very similar mesh decal approach using a small runtime texture that defines distribution of the damage along the wheels rim (a small 1×32 texture that corresponds to internal wheel shape/thermal damage state that is calculated by the physics engine). Though this feature is among those which will be introduced much later.