Call to Arms - Gates of Hell: Ostfront

Call to Arms - Gates of Hell: Ostfront

Total Graphics Conversion: PBR Shader for Gate of Hell
 This topic has been pinned, so it's probably important
FNSOIDATHQ  [developer] Aug 14 @ 7:03pm
3. Development Guide for Modders
If you want to import a model using pure PBR textures (metallic, roughness, AO and emissive),

New MTL and texture samples for previews and testing can be found in "mod/resource/entity/misc/materials/pbr" folder.

3.1 mtl Structure
When both
  • {height "xxx"}
  • {lightmap "xxx"}
exist in mtl, shader will activate pure PBR mapping mode.

Among them:
The height entry, originally used for parallax mapping of ground texture, is now used to index indirect specular cube map.
The lightmap entry, originally used for pre-baked lightmap, is now used to store a four-channel mask texture.

In addition, additional parameters=
{parallax_scale 10000}: is used to enable automatic Phong to PBR conversion including indirect specular reflections.
{full_specular}: is used to enable support for emssive texture in pure PBR mode.

3.2 Indirect Specular Map
The indirect specular map is a texture that stores pre-filtered environment light information. We sample it to calculate the indirect specular reflections in PBR rendering.
The pre-made indirect specular map is stored in "mod/resource/texture/common/envmap".
This is not a mipmapped environment map! Textures stored in mipmaps are calculated using a special method, which is completely different from pure mipmaps.
These textures are obtained from Poly Haven under a CC0 license. Thanks to artist and website for their generosity!

You can simply access our pre-made indirect specular map using {height "$/envmap/env"}.

3.3 Texture Mapping for Pure PBR Rendering
After enabling pure PBR texture mode with changes in section 3.1. Textures in MTL will be mapped to PBR according to following logic:
Original Texture
Target Texture
diffuse.rgb
base color.rgb
diffuse.a
alpha
specular.r
metallic
specular.gba
emssive.rgb
height.rgb
Indirect Light Specular Cube Map
lightmap.r
roughness
lightmap.g
empty
lightmap.b
ambient occlusion(AO)
lightmap.a
parallax occlusion mapping (have not implemented)
*Note: rgba= rad,green,blue,alpha= red,green,blue,alpha four texture channels

3.5 Shader Development Guide
I will (sooooon!) be writing about this on my website and github.
Last edited by FNSOIDATHQ; Aug 14 @ 7:03pm