Export to GitHub

glextensions - GL_EXT_framebuffer_sRGB.wiki


Contents

  • Dependencies
  • Overview
  • New Procedures and Functions
  • New Tokens
  • Errors
  • New State
  • New Implementation Dependent State

Dependencies

OpenGL 1.1 required

This extension is written against the OpenGL 2.0 (September 7, 2004) specification.

WGL_EXT_extensions_string is required for WGL support.

WGL_EXT_pixel_format is required for WGL support.

GL_ARB_color_buffer_float interacts with this extension.

GL_EXT_framebuffer_object interacts with this extension.

GL_EXT_texture_sRGB interacts with this extension.

GL_ARB_draw_buffers interacts with this extension.

Overview

Conventionally, OpenGL assumes framebuffer color components are stored in a linear color space. In particular, framebuffer blending is a linear operation.

The sRGB color space is based on typical (non-linear) monitor characteristics expected in a dimly lit office. It has been standardized by the International Electrotechnical Commission (IEC) as IEC 61966-2-1. The sRGB color space roughly corresponds to 2.2 gamma correction.

This extension adds a framebuffer capability for sRGB framebuffer update and blending. When blending is disabled but the new sRGB updated mode is enabled (assume the framebuffer supports the capability), high-precision linear color component values for red, green, and blue generated by fragment coloring are encoded for sRGB prior to being written into the framebuffer. When blending is enabled along with the new sRGB update mode, red, green, and blue framebuffer color components are treated as sRGB values that are converted to linear color values, blended with the high-precision color values generated by fragment coloring, and then the blend result is encoded for sRGB just prior to being written into the framebuffer.

The primary motivation for this extension is that it allows OpenGL applications to render into a framebuffer that is scanned to a monitor configured to assume framebuffer color values are sRGB encoded. This assumption is roughly true of most PC monitors with default gamma correction. This allows applications to achieve faithful color reproduction for OpenGL rendering without adjusting the monitor's gamma correction.

New Procedures and Functions

None

New Tokens

Accepted by the

<attribList>

parameter of glXChooseVisual, and by the

<attrib>

parameter of glXGetConfig:

|GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT|0x20B2| |:-----------------------------------|:-----|

Accepted by the

<piAttributes>

parameter of wglGetPixelFormatAttribivEXT, wglGetPixelFormatAttribfvEXT, and the

<piAttribIList>

and

<pfAttribIList>

of wglChoosePixelFormatEXT:

|WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT|0x20A9| |:-----------------------------------|:-----|

Accepted by the

<cap>

parameter of Enable, Disable, and IsEnabled, and by the

<pname>

parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:

|FRAMEBUFFER_SRGB_EXT|0x8DB9| |:---------------------|:-----|

Accepted by the

<pname>

parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:

|FRAMEBUFFER_SRGB_CAPABLE_EXT|0x8DBA| |:------------------------------|:-----|

Errors

Enable, Disable, IsEnabled, GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev now accept the new token as allowed in the "New Tokens" section.

New State

Add to table 6.20 (Pixel Operations)

| Get Value | Type | Get Command | Initial Value | Description | |:--------------|:---------|:----------------|:------------------|:----------------| |FRAMEBUFFER_SRGB_EXT|B |IsEnabled |False |sRGB update and blending enable|

| Get Value | Type | Get Command | Initial Value | Description | |:--------------|:---------|:----------------|:------------------|:----------------| |FRAMEBUFFER_SRGB_CAPABLE_EXT|B |IsEnabled |- |true if drawable supports sRGB update|

New Implementation Dependent State

None