Duke experimenting with the PBR – physically-based rendering, combined with IBL – image-based lighting. In order to integrate this in SE, I added support of PBR textures set for ships, ability to specify if the material requires the environment map, and implemented a pre-filtering pass for the generated environment map (a special blur filters, needed for PBR and IBL). So models are now illuminated by the environment (this is called image-based lighting), and their surface reflectance and scattering properties are defined by texture on a per-pixel basis. The texture set includes:

  • Albedo, normal and emission maps – as in SE before, a textures that defines surface color, lighting normal and self-emission color.
  • Roughness and metallic maps are now replaced the specular map. Both are gray-scale textures. The first defines the smoothness of a surface, i.e. less rough more resembles a mirror, while more rough looks matted. The second is a switch between metals and dielectrics, because these two classes of materials interacts with light differently.
  • Ambient occlusion map is a gray-scale texture that defines a small “shadows” in a grooves and pits of the model.
  • Currently the roughness, metallic and ambient occlusion maps are combined into a single RGB texture, but future development will allow to specify any kind of combinations (for example, putting metallic map to alpha channel of albedo map, and roughness to alpha channel of normal map).

    An early test screenshots doesn’t look 100% correct, but this is just the beginning. Standard PBR test – array of balls with changing metallicity (from top to bottom) and roughness (from left to right):

    A new tag MaterialPBR {…} is provided to the ship material script (*.sml file). It contains paths to the above-mentioned textures, as well as a scaling and offsetting constants. The latter can be used to tweak the material appearance, or to implement a texture-less material, i.e. with uniform color, roughness or metallicity, like on the screenshot with balls. So SE now supports both PBR and “specular” workflows (which is used for old ship models, whose materials and described by Material {…} tag in the script).

    The Damaged helmet test model:

    The Cerberus test model:

    This system has many issues, so don’t expect it be completed in 0.990. The major issue is performance of the environment map updating. It’s rendering is a hard task for SE (remember the black hole and warp settings “high”?) And the pre-filtering pass is even worse, its shader is very heavy, because it computes a two-dimensional convolution. There is also problems with adding illumination by sun, which must be analytical anyway (thus doesn’t affected by any occluders, like clouds, mountains and other ships – shadows must be implemented to deal with this). But as long as PBR workflow is now provided in the *.sml files, modders can start to upgrade their old ship addons to the new system. There are plenty of tools which can help in converting color-specular textures into PBR ones, for example, this one.

    Discuss this post on the forum.