[QUESTION] Detail PBR map blending

I have been trying to decode the logic of the detail textures with some success, but I have trouble understanding how the detail Roughness and Metallic channels blend with the base texture. Before anyone reads through the book below, I want to ask what the per-pixel blending formula is for detail Occlusion-Roughness-Metallic textures is.

I used the simple aircraft example and applied a detail swatch on the seats. On the roughness channel the center square is 50% gray. The numbers indicate the % of brightness for the roughness map on each square of the swatch.

Using it on a surface with 128 roughness, the ingame Roughness is as shown:

I would expect the center block with 50% gray to remain the same as in the base texture (128 gray) but what I’m getting is shown on the table below. Long story short, using a 50% gray for the base roughness, the detail Roughness texture produces a final result of 0 roughness at 25% gray on the swatch and 100% roughness on 75% gray on the swatch.

The problem is that the results are inconsistent if the base Roughness is changed. Below are the final results with a 25% base roughness and the same swatch:
If Rougness goes lower than 50%, then the same swatch will produce skewed results. We have less room to play towards darker shades and more control towards brighter ones.

Per the SDK if we go 50% gray the final roughness should be unchanged. According to the results above this is clearly not the case.

From toying around in Photoshop, it seems that the final blend is similar to a Vivid light blending mode, but very complex.

  • When a pixel in the swatch is above 128, the detail texture is layered over the base textured in a “Vivid Light” blending mode.
  • When a pixel in the swatch is below 128, the base texture is the one blending in Vivid light mode and is layered over the swatch

Essentially, the brighter pixel between the detail texture and the regular texture is put atop in vivid light mode and then the end result is rendered in MSFS. The photos below show the Photoshop “emulator” and the MSFS result using a 128-gray base roughness and the colour swatch at the top.

The problem with this is that while it can be emulated somewhat in photoshop, it is tough to get predictable and consistent results without delving into math or experimentation. It would be much simpler if the shader was changed to a basic lighten/darken formula:

  • 50-100% detail roughness will take the base roughness from its current value, up to 255
  • 50% detail roughness does nothing
  • 0-50% detail roughness will take the base roughness from 0 up to its current value

It is too late to change that shader for MSFS2020 and probably MSFS2024 as well, but if it is possible to change it, it would be better to give us a predictable shader.

Having such way to manipulate detail textures will help reduce texture sizes a lot as big surfaces can be textured with a tiling grunge, reducing the base texture to a low resolution that only holds the large surface variations.

1 Like