History: HLMS Materials
Source of version: 2
Copy to clipboard
!!High Level Materials System (HLMS)
HLMS is the new material system replacing the old material system of earlier Ogre versions. This doesn't mean that the old material system is completely gone, but for most of the cases the HLMS materials are sufficient. The HLMS system is extendable, e.g. you can implement a 'skin' or 'fur' HLMS yourself. Ogre includes two HLMS flavours out-of-the-box:
*__PBS - Physically Based Shading__; an approach for materials and rendering that creates more accurate and predictable results than previous game rendering techniques [http://wiki.polycount.com/wiki/PBR|Polycount wiki] for more information.
*__Unlit - Unlit rendering__; the textures in the material are not affected by light.
Materials can be loaded and saved as a file, but unlike the previous material system, the format of the HLMS materials is Json.
{img fileId="1759" thumb="y" width = "24" height = "24" rel="box[g]"}
Note, that there are 2 other HLMS implementations named PbsMobile and UnlitMobile. They are used for GLES2 rendering and may not be completely on-par with the regular Pbs and Unlit verions.
!!!Material structure
A material consists of a certain structure:
__Datablock __- contains individual information about a specific material and may 'consist' of:
~hs~~hs~~hs~~hs~|_ __Samplerblock__ (0..32); A sampler block contains the properties of a texture.
~hs~~hs~~hs~~hs~|_ __Macroblock__ (0..32); Describes the rasterizer state and includes properties such as depth check, depth write, cull mode, ... Macrcoblocks may be shared between datablocks.
~hs~~hs~~hs~~hs~|_ __Blendblock__ (0..32); Also describes the rasterizer state, but is separated from macroblocks because of sorting of transparent materials. Blendblocks may be shared between datablocks.
!!!Pbs
The Pbs material is probably the most used material. It is build up by using different texture maps. A texture map is an image that can be loaded from a .png or .jpg file for example:
*__Diffuse map__; Wraps the texture image onto the 3D geometry surface while displaying its original pixel color.
*__Normal map__; The textures' color representation affects surfaces (bumps, scratches, ...) while providing higher degrees of detail. Sometimes used by the name 'albedo'.
*__Specular / Metallic map__; When in metal workflow, the texture is used as a metallic texture and is expected to be a monochrome texture. When in specular workflow, the texture is used as a specular texture, and is expected to be either coloured or monochrome.
*__Roughness map__; The roughness map describes the surface irregularities that cause light diffusion. Rougher surfaces will have larger and dimmer looking highlights. Smoother surfaces will keep specular reflections focused, which can appear to look brighter or more intense even though the same total amount of light is reflected.
*__Detail weight map__; It provides a mask to cover detail maps over the mesh, by controlling weight of each of the 4 maps via the RGBA channels of the weight map. 'R' controls the detail map 0, 'G' the detail map 1, 'B' the detail map 2, and 'A' the detail map 3.
*__Detail map 0__;
*__Detail map 1__;
*__Detail map 2__;
*__Detail map 3__;
*__Detail normal map 0__;
*__Detail normal map 1__;
*__Detail normal map 2__;
*__Detail normal map 3__;
*__Environment probe map__; Environment probe map is also referred to as Reflection map. The image map is projected onto a 3D surface to represent a reflection of the environment.
!!!Unlit
!!Material workflow
Ogre V2 support two basic types of workflow, Specular Workflow and Normal workflow. Both types of workflow are explained in more detail in [https://www.allegorithmic.com/system/files/software/download/build/PBR_volume_02_rev05.pdf|PBR Guide volume 2]
(See also [https://www.allegorithmic.com/system/files/software/download/build/PBR_Guide_Vol.1.pdf|PBR Guide volume 1] for the first part of the PBR guide).
Ogre also supports