TA Toolbox Home / TA Glossary

IBL Image-Based Lighting: Principles and Implementation

2026-08-24

What is IBL

IBL (Image-Based Lighting) is a technique that uses an environment map (usually HDRI) to illuminate objects. It encodes surrounding lighting information into a texture, sampled to provide diffuse and specular lighting, seamlessly integrating objects into the scene. IBL is an essential part of global illumination and reflections in PBR workflows.

Principles of IBL

An environment map records incoming light from all directions. For a point on a surface, its reflected light comprises:

  • **Diffuse component**: The integral of incoming light from all directions after diffuse reflection, generally uniform.
  • **Specular component**: Light near the reflection direction, dependent on surface roughness. Lower roughness yields sharper reflections; higher roughness yields blurrier reflections.

Directly sampling the environment map for real-time integration is expensive, so precomputation techniques are typically used.

Precomputation Process

IBL precomputation typically involves:

  1. **Generate Irradiance Map**: For diffuse lighting. Convolve the original environment map to compute the hemispherical integral (Lambertian diffuse) for each direction. The result is a low-frequency, blurry map that can be sampled directly for diffuse.
    1. **Generate Prefiltered Environment Map**: For specular reflection. Filter the environment map with Gaussian blurs at different roughness levels, generating a mipmap chain where each level corresponds to a roughness. Higher roughness means stronger filtering. In the shader, select the appropriate mipmap level based on surface roughness.
      1. **Generate BRDF Integration Look-Up Table (BRDF LUT)**: To accelerate specular computation. The LUT stores the integral of the Fresnel and geometry terms, typically as a 2D texture with NdotV on the X axis and roughness on the Y axis. In the shader, sample the LUT and combine with the prefiltered environment map to obtain specular.
      2. These precomputations can be done offline or at engine startup. Unity and Unreal automatically precompute when importing HDRI.

        Shader Implementation

        In a fragment shader, typical IBL usage:

        1. Compute diffuse: `irradiance = textureCube(irradianceMap, N).rgb * albedo`
        2. Compute specular:
        3. - Sample prefiltered environment map: `prefilteredColor = textureCubeLod(prefilteredMap, R, roughness * maxMipLevel).rgb`

          - Sample BRDF LUT: `brdf = texture2D(brdfLUT, vec2(NdotV, roughness)).rg`

          - Specular = `prefilteredColor * (F * brdf.x + brdf.y)`

          1. Sum diffuse and specular for ambient lighting.
          2. Combining IBL with Direct Lighting

            IBL is usually combined with direct lighting (point lights, directional lights). IBL provides ambient and reflections, while direct lighting provides primary shading. Both use the same BRDF in PBR for consistency.

            FAQ

            What is the difference between IBL and direct lighting?

            Direct lighting comes from discrete light sources; IBL uses an environment map to simulate indirect lighting from all directions.

            Why is precomputation necessary?

            Real-time integration of environmental lighting is expensive; precomputation converts complex integrals into texture lookups, greatly improving performance.

            Does IBL support dynamic environments?

            Yes, but precomputation must be redone when the environment changes. For dynamic environments, real-time reflection probes or simplified methods can be used.

            Can IBL be used on mobile?

            Yes, mobile typically uses lower-resolution precomputed maps and simplified BRDF LUTs to save performance.

            What is the relationship between HDRI and IBL?

            HDRI is the data source for IBL, usually as an environment map. IBL uses the lighting information from HDRI for rendering.

FAQ

What is the difference between IBL and direct lighting?

Direct lighting comes from discrete light sources; IBL uses an environment map to simulate indirect lighting from all directions.

Why is precomputation necessary?

Real-time integration of environmental lighting is expensive; precomputation converts complex integrals into texture lookups, greatly improving performance.

Does IBL support dynamic environments?

Yes, but precomputation must be redone when the environment changes. For dynamic environments, real-time reflection probes or simplified methods can be used.

Can IBL be used on mobile?

Yes, mobile typically uses lower-resolution precomputed maps and simplified BRDF LUTs to save performance.

What is the relationship between HDRI and IBL?

HDRI is the data source for IBL, usually as an environment map. IBL uses the lighting information from HDRI for rendering.