Rebel Fork Framework
|
In a PBR pipeline, textures play a crucial role in defining the appearance of materials. Each texture channel encodes different properties that collectively contribute to the final look of the surface in a realistic manner.
The Albedo texture represents the base color of a material and is encoded in the RGB channels of albedo texture. It defines the color of the material under neutral lighting and does not contain any shading or lighting information.
The alpha channel is the fourth channel in albedo texture. It is used to encode the opacity level of the texture:
The Normal Map is used to simulate fine surface details by altering the surface normals. It is typically stored in an RGB texture where each channel corresponds to a direction in space.
This map affects how light interacts with the surface, creating the illusion of depth and complexity without adding additional geometry.
The normal vector is calculated in the shader using the following logic:
In a packed normal map, the X and Y components of the normal vector are stored in the G and A channels of the texture, respectively. Packed mode is enabled with PACKEDNORMAL define in fragment shader.
The third component, Z, is calculated in the shader using the following logic:
This calculation is based on the fact that a normal vector is of unit length, so we can derive the Z component from the X and Y components.
The Metallic, Roughness, and Ambient Occlusion properties are often packed into a single texture to optimize performance. They are encoded into the R, G, and A channels respectively.
By combining these channels, the PBR pipeline can efficiently simulate realistic material properties and interactions with light.
The Roughness and Metallic components from texture get multiplied by material properties in the shader.