Skip to content

True PBR

ThePagi edited this page Mar 22, 2024 · 56 revisions

About True PBR

Frequently Asked Questions

  • Texture compression

Preparing Meshes

Texture Creation Workflow

Reference

Main material (meshes in .nif)

Shader

Shader implements roughness-metallic workflow closely following Unreal. In base version it requires base color, opacity, normal, roughness, metalness, AO and nonmetal reflectance (specular in Unreal) to be provided. Additionally it supports emission if emissive color map is provided and parallax occlusion mapping if displacement map is provided. Two additional shading models are implemented (also following Unreal):

  • Two-sided foliage which simulates transmission of light through foliage. Requires subsurface color to be provided.
  • Subsurface which approximates subsurface scattering with provided subsurface color and opacity.

Textures

  1. Base color in RGB, opacity in A.
  2. Normal in RGB, A unused.
  3. Emissive color in RGB, A unused.
  4. Displacement in R, GBA unused.
  5. Unused.
  6. RMAOS - Roughness in R, metallic in G, AO in B, specular in A.
  7. Unused.
  8. Subsurface color in RGB, subsurface opacity in A.

Color maps are assumed to be in SRGB format.

Flags

Three flags of BSShaderProperty are replaced:

  • Byte 55 (Unused01 in NifSkope) - enables PBR for this BSGeometry
  • Byte 57 (Soft_Lighting in NifSkope) - enables two-sided foliage shading
  • Byte 58 (Rim_Lighting in Nifskope) - enables subsurface shading in NifSkope

Parameters

Some parameters of BSShaderProperty are reused:

  • Specular Level (replaces Glossiness) - linear multiplier for nonmetal reflectance. Should be 0.04 for meshes which do not have specular map (and have 1 in alpha of RMAOS map) or 0.08 for meshes which have specular map created for Unreal.
  • Subsurface Color (replaces Specular Color) - used in Two-Sided Foliage and Subsurface models. If subsurface map is provided it's used as linear multiplier for its RGB.
  • Roughness Scale (replaces Specular Strength) - linear multiplier for roughness.
  • Subsurface Opacity (replaces Lighting Effect 1) - used in Subsurface model. If subsurface map is provided it's used as linear multiplier for its alpha.
  • Displacement Scale (replaces Lighting Effect 2) - linear multiplier for displacement.

Landscape material

Shader

Landscape texture is assumed to be PBR if its record's EDID contains _PBR substring. Landscape material requires base color, normal, roughness, metalness, AO and nonmetal reflectance to be provided.

If any of textures in quad is PBR quad is rendered as PBR so in order to avoid issues with blending between PBR and non-PBR textures all land textures in worldspace need to be converted to PBR together. That seems to be okay since mods replacing land textures usually replace them all. Also land LOD also need to be rendered as PBR to avoid issues with blending with non-LOD textures (that could be made optional).

Textures

  1. Base color in RGB (assumed to be in SRGB format), displacement in A.
  2. Normal in RGB, A unused.
  3. Unused.
  4. Unused.
  5. Unused.
  6. RMAOS - Roughness in R, metallic in G, AO in B, specular in A.
  7. Unused.
  8. Unused.

Parameters

Some parameters of TXST record are reused:

  • Roughness Scale (replaces Shininess) - linear multiplier for roughness.
  • Displacement Scale (replaces Parallax Scale) - linear multiplier for displacement.
  • Specular Level (replaces Decal Min Width) - linear multiplier for nonmetal reflectance. Should be 0.04 for textures which do not have specular map (and have 1 in alpha of RMAOS map) or 0.08 for textures which have specular map created for Unreal.

Clone this wiki locally