Skip to content
You're reading the docs for Railroader 0.6 (the MoW Update), currently available on the Experimental branch.

Shaders

Railroader provides several shaders for use in asset packs. These are distributed in the shared asset pack and are available to all mods. The ADK includes a copy of this pack so your materials can use them; see Shared Assets.

We strongly recommend using the provided shaders rather than URP/Lit. The provided shaders are shared across all asset packs, so using them keeps your asset pack smaller by avoiding bundling duplicate shader code. Using a common set of shaders also improves rendering performance, as shared shaders batch more efficiently. Finally, the provided shaders are tuned for Railroader’s visual style, for a consistent appearance across the game.

ShaderUse Case
Standard Car ShaderRolling stock (cars, locomotives)
Standard Environment ShaderScenery and structures
Standard ShaderSimple objects without wear or UV1 features
Aggregate Shader StochasticGround/ballast with stochastic tiling

The Car, Environment, and Standard shaders are each available in Metallic and Specular variants. The metallic workflow is recommended for new content.

TexturesRGBImport Type
MainTex / BaseMapYesDefault
Normal MapNoNormal map
MetallicGlossMapNoDefault
Specular MapYesDefault
OcclusionMapNoDefault

Textures containing non-color data (normals, metallic, AO, smoothness) must be imported as Linear (sRGB unchecked). Base color / diffuse textures and the Specular Map use sRGB, since both hold color. The Specular Map’s alpha carries smoothness, which is unaffected — Unity never applies the sRGB curve to an alpha channel.

For how to produce these maps out of Substance 3D Painter with the right channels in the right places, see Texturing Workflow.

The car shaders are the simplest option for rolling stock. At runtime, Railroader replaces these shaders with builtin versions and applies wear automatically based on car condition. You do not need to configure wear properties on car materials.

TextureChannel Mapping
MainTexRGB = Base color
Normal MapTangent-space normal
MetallicGlossMapR = Metallic, G = Ambient occlusion, A = Smoothness

Properties:

PropertyTypeDefaultDescription
Base ColorColor—Tint multiplied with MainTex
SmoothnessFloat0.92Multiplied with MetallicGlossMap alpha
TextureChannel Mapping
MainTexRGB = Base color
Normal MapTangent-space normal
Specular MapRGB = Specular color, A = Smoothness
OcclusionMapG = Ambient occlusion

Properties:

PropertyTypeDefaultDescription
Base ColorColor—Tint multiplied with MainTex
SmoothnessFloat0.92Multiplied with Specular Map alpha

The environment shaders add weathering and color variation features for scenery and structures. They are more expensive than the car or standard shaders due to additional texture samples.

Both environment shader variants share these features on top of the base PBR inputs:

Wear System: Applies a weathering/aging effect using a triplanar-projected noise texture. The wear intensity is controlled by the Wear property (0 = pristine, 1 = full wear).

Noise Color Pattern: Adds subtle per-object color variation using object-space position to sample a noise texture, mapped through a gradient. This prevents identical objects from looking like copies.

UV1 System: Uses the secondary UV channel (UV1) to blend a tint color and modify ambient occlusion. Controlled by influence properties (default 0 = disabled).

TextureChannel Mapping
MainTexRGB = Base color
Normal MapTangent-space normal
MetallicGlossMapR = Metallic, G = Ambient occlusion, A = Smoothness
WearNoiseR = Wear pattern (triplanar sampled)
Noise textureR = Color variation pattern (embedded, not a property)

Properties:

PropertyTypeDefaultDescription
Base ColorColor—Tint multiplied with MainTex
SmoothnessFloat0.92Multiplied with MetallicGlossMap alpha
TilingVector—UV tiling for all texture samples
OffsetVector—UV offset for all texture samples
WearFloat1Wear intensity (0 = none, 1 = full)
WearNoiseTexture2D—Noise texture for wear pattern
WearColorColor—Color of worn areas
WearNoiseEdge1Float0.4Smoothstep lower edge for wear pattern
WearNoiseEdge2Float0.6Smoothstep upper edge for wear pattern
WearTileFloat0.04Triplanar tiling scale for wear noise
WearOcclusionInfluenceFloat1How much wear darkens ambient occlusion
UV1DiffuseColorColor—Tint color applied via UV1
UV1DiffuseInfluenceFloat0Strength of UV1 diffuse tint (0 = disabled)
UV1AOInfluenceFloat0Strength of UV1 ambient occlusion blend (0 = disabled)
UV1SharpnessFloat0.5Sharpness of UV1 edge detection
TextureChannel Mapping
MainTexRGB = Base color
Normal MapTangent-space normal
Specular MapRGB = Specular color, A = Smoothness
OcclusionMapG = Ambient occlusion
WearNoiseR = Wear pattern (triplanar sampled)
Noise textureR = Color variation pattern (embedded, not a property)

Properties: Same as Environment Metallic above, except uses Specular Map and OcclusionMap instead of MetallicGlossMap.

The standard shaders are simple PBR shaders with no wear, noise, or UV1 features. Use these for objects that don’t need weathering effects.

TextureChannel Mapping
MainTexRGB = Base color
Normal MapTangent-space normal
Metallic Gloss MapR = Metallic, G = Ambient occlusion, A = Smoothness

Properties:

PropertyTypeDefaultDescription
Base ColorColor—Tint multiplied with MainTex
GlossinessFloat0.9Multiplied with Metallic Gloss Map alpha
TextureChannel Mapping
MainTexRGB = Base color
Normal MapTangent-space normal
Specular MapRGB = Specular color, A = Smoothness
OcclusionMapG = Ambient occlusion

Properties:

PropertyTypeDefaultDescription
Base ColorColor—Tint multiplied with MainTex
Spec ColorColor—Tint multiplied with Specular Map RGB
SmoothnessFloat0.92Multiplied with Specular Map alpha
TilingVector—UV tiling for all texture samples
OffsetVector—UV offset for all texture samples

A specialized shader for ground surfaces (ballast, gravel, dirt) that uses stochastic texture sampling to break up visible tiling patterns.

Textures:

TextureChannel Mapping
BaseMapRGB = Base color
MetallicGlossMapR = Metallic, A = Smoothness
BumpMapNormal map
OcclusionMapR = Ambient occlusion
HeightHeight map (stochastic blend weights)

Properties:

PropertyTypeDefaultDescription
ColorColor—Base color tint
TilingVector(1, 3.24)UV tiling
NormalLevelFloat1Normal map strength
StochasticContrastFloat0.15Contrast for stochastic blending (0.01–0.99)
StochasticScaleFloat1Scale of stochastic pattern (0–2)

Quick reference for how each shader packs data into texture channels.

Normal maps must be in Unity/OpenGL/Y+ format. More information here.

ChannelMetallicGlossMap
RMetallic
GAO
B—
ASmoothness
ChannelSpecular MapOcclusionMap
RSpecular color—
GSpecular colorAO
BSpecular color—
ASmoothness—