This is the documentation for Enlighten.

GLES2 irradiance output

This page describes how the irradiance output format is determined on OpenGL ES devices. The irradiance output format used by your application will be dictated by the OpenGL ES 2.0 texture formats supported by the target device, which in turn depends on the OpenGL ES 2.0 extensions that have been implemented.

Uncompressed irradiance output

Enlighten's uncompressed irradiance output format can be used on devices that support half float textures via the implementation of GL_OES_texture_half_float. However, the irradiance texture must be bilinearly filtered when it is sampled in the shader. If the device implements the GL_OES_texture_half_float_linear extension, this can be achieved by simply setting the texture minification and magnification filters to GL_LINEAR and sampling the texture in the fragment shader using the interpolated irradiance map texture coordinates passed through from the vertex shader.

If the device supports half float textures but does not implement GL_OES_texture_half_float_linear, the irradiance output texture minification and magnification filters must be set to GL_NEAREST and bilinearly filtered "manually" in the shader. This obviously has an impact on rendering performance, mainly due to the three additional dependent texture reads that are required.

Compressed irradiance output

For devices which do not support half float textures, Enlighten's compressed LRB irradiance output format can be used. This output format uses a GL_RGBA format texture of type GL_UNSIGNED_BYTE to store the irradiance as a 16 bit luminance value and 8 bit normalised Red and Blue values. This format consumes less texture bandwidth than the half float alternative and can be bilinearly filtered without the need for any OpenGL ES 2.0 extensions, however, the irradiance value must be decoded which requires additional shader instructions. It is important to note that some mobile GPUs do not interpolate the encoded irradiance at the correct precision leading to banding artifacts (see the screenshot below). If you do see these artifacts in your application the alternative is to use GL_NEAREST for texture minification and magnification and "manually" bilinearly filter in the shader.

GeoMobileDemo includes example application and shader code for using compressed and uncompressed irradiance output formats according to the capabilities of a given device.

This page describes how the irradiance output format is determined on OpenGL ES devices. The irradiance output format used by your application will be dictated by the OpenGL ES 2.0 texture formats supported by the target device, which in turn depends on the OpenGL ES 2.0 extensions that have been implemented.

Uncompressed irradiance output

Enlighten's uncompressed irradiance output format can be used on devices that support half float textures via the implementation of GL_OES_texture_half_float. However, the irradiance texture must be bilinearly filtered when it is sampled in the shader. If the device implements the GL_OES_texture_half_float_linear extension, this can be achieved by simply setting the texture minification and magnification filters to GL_LINEAR and sampling the texture in the fragment shader using the interpolated irradiance map texture coordinates passed through from the vertex shader.

If the device supports half float textures but does not implement GL_OES_texture_half_float_linear, the irradiance output texture minification and magnification filters must be set to GL_NEAREST and bilinearly filtered "manually" in the shader. This obviously has an impact on rendering performance, mainly due to the three additional dependent texture reads that are required.

Compressed irradiance output

For devices which do not support half float textures, Enlighten's compressed LRB irradiance output format can be used. This output format uses a GL_RGBA format texture of type GL_UNSIGNED_BYTE to store the irradiance as a 16 bit luminance value and 8 bit normalised Red and Blue values. This format consumes less texture bandwidth than the half float alternative and can be bilinearly filtered without the need for any OpenGL ES 2.0 extensions, however, the irradiance value must be decoded which requires additional shader instructions. It is important to note that some mobile GPUs do not interpolate the encoded irradiance at the correct precision leading to banding artifacts (see the screenshot below). If you do see these artifacts in your application the alternative is to use GL_NEAREST for texture minification and magnification and "manually" bilinearly filter in the shader.

GeoMobileDemo includes example application and shader code for using compressed and uncompressed irradiance output formats according to the capabilities of a given device.