-
Notifications
You must be signed in to change notification settings - Fork 6
True PBR
About True PBR
PBR (physically based rendering) approximates how real materials react to light and is used in most modern games. True PBR is a (work in progress) part of Community Shaders that allows the usage of metallic workflow PBR materials in Skyrim. The biggest upside to using PBR materials is the available tooling and workflow for texture creation. Most modelling and texturing tools also use a PBR workflow, and therefore what you create in e.g. Blender will look the same way in Skyrim; there is no need for experimenting to make your textures as bright as vanilla, or for messing with env masks to try replicating a metallic look. Additionally, there are many free PBR materials available online, and it is easy to mix and modify them while retaining realistic and consistent visuals.
The base textures for True PBR are albedo, normal, roughness, metallic, ambient occlusion and specular. Parallax and emission are also supported. Additionally the material can use two-sided foliage or subsurface shading, which require subsurface color map.
True PBR only cares about meshes marked with a specific flag, everything else is rendered as usual. True PBR mods therefore contain meshes marked for PBR and a set of PBR textures.
Frequently Asked Questions
- Do I care about this as a user? No, it just works. There may be some settings in the CS menu that you can customize. If a mod doesn't come with its own meshes or you have custom meshes that you want to apply the textures to, you might want to use the PBR Mesh Patcher.
- Do I care about this as a modder? If you create custom meshes or textures, you might want to switch over to True PBR. The upside is easier workflow and potentially better quality. The downside is that your creations will only work with Community Shaders (it is possible methods of fallback will be available though).
- What about Complex Materials? Complex materials are totally separate from True PBR and there would be no point in combining them. You can still use complex materials on non-pbr objects as usual.
- Can I convert vanilla shaded textures to True PBR? If you originally had PBR textures that you somehow converted for Skyrim, you can use those easily. Otherwise it is impossible to do without assumptions, because Skyrim textures contain fundamentally different data. For example, many objects using enviornment mapping are metallic, but not all of them. You can do manual work or use some AI to make the necessary textures, but it is unlikely that it will be a meaningful visual improvement over vanilla.
Preparing Meshes
For a mesh to be recognized as PBR, it must have in BSLightingShaderProperty:
- Default shader type
- In Shader Flags 2 have Unused01 (or PBR) flag set
For texture slot setup and additional settings scroll down to Reference.
To set up PBR meshes in batch, you can use PbrNifPatcher. It is useful especially when remaking vanilla textures that are used in many meshes.
To get descriptions for PBR properties and correct rendering of PBR in Nifscope, add these files into your Nifscope folder: TODO insert link
Texture Creation Workflow
Many programs can be used to work with PBR textures. To generate textures from scratch, you can use for example Substance Designer or Material Maker (free). To edit, mix and apply materials to meshes, you can use Quixel Mixer (free), ArmorPaint (free) or Substance Painter. In this short guide I will show the workflow I use to retexture vanilla meshes.
TODO
About Texture Compression
TODO
Reference
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.
- Base color in RGB, opacity in A.
- Normal in RGB, A unused.
- Emissive color in RGB, A unused.
- Displacement in R, GBA unused.
- Unused.
- RMAOS - Roughness in R, metallic in G, AO in B, specular in A.
- Unused.
- Subsurface color in RGB, subsurface opacity in A.
Color maps are assumed to be in SRGB format.
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
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 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).
- Base color in RGB (assumed to be in SRGB format), displacement in A.
- Normal in RGB, A unused.
- Unused.
- Unused.
- Unused.
- RMAOS - Roughness in R, metallic in G, AO in B, specular in A.
- Unused.
- Unused.
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.