Detail shaders

Detail shaders are basically standard PBR shaders that blend in a second set of textures based on how close the camera is to the surface.

Shader table

Shader

Texture
diffuse
Texture
specular
Texture
normal
Texture
diffuse1
Texture
specular1
Texture
normal1
Parameter

Detail_dpndpn

Detail_dpndpn

Behavior

Standard behaviors
Rendering

The shaders only support deferred rendering and have not been compiled for forward rendering.

Transparency

Supports transparency clipping, but does not support transparency blending as the shaders do not support forward rendering.

Vertex colors

Vertex colors, including alpha, get combined with the diffuse texture via multiplication

Exceptions:
  • Detail_dpndpn also combines the vertex color alpha with ambient occlusion via multiplication.

Dithering

Uses dithering, although the dithering for Detail_dpndpn is broken.

Distance blending

The shader will fade in the second set of textures (diffuse1, specular1, normal1) based on the distance between the camera and surface being rendered. The game usually starts the fade-in at a distance of 180, and fully fades them in at a distance of 150.

Textures

diffuse

A standard albedo texture.

Uses alpha channel for transparency.

Uses the 1st UV channel.

specular

A standard PRM texture.

Uses the 1st UV channel.

normal

A standard normal map texture.

Uses the 1st UV channel.

diffuse1

A standard albedo texture.

Attempts to use the 3rd UV channel.

The RGB channels get “overlaid” over diffuse (influenced by the camera distance).

../../../_images/shaders_overlay_ref.png

An image overlaid over various base colors

specular1

A standard PRM texture.

Attempts to use the 3rd UV channel.

Each channel affects the base of the specular texture differently (influenced by the camera distance):

  • Specular is ignored

  • Smoothness is overlaid over the base (see diffuse1)

  • Metallic is remapped to range from -1 to 1 and then added to the base

  • Ambient occlusion is multiplied to the base

normal1

A standard normal map texture.

Attempts to use the 3rd UV channel.

Gets blended together with the normal texture (influenced by the camera distance).

Parameters

DetailFactor

A float parameter of which the first component scales the texture coordinates of the second texture set (diffuse1, specular1, normal1).