Export to GitHub

glextensions - GL_ARB_fragment_shader.wiki


Contents

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

Dependencies

OpenGL 1.0 is required.

This extension is written against version 1.10 of the OpenGL Shading Language Specification.

The extension is written against the OpenGL 1.4 Specification.

The GL_ARB_shader_objects extension is required.

This extension interacts with the GL_ARB_vertex_shader extension.

Overview

This extension adds functionality to define fragment shader objects. A fragment shader object is a shader object (see the ARB_shader_objects extension) that, when attached to a program object, can be compiled and linked to produce an executable that runs on the fragment processor in OpenGL. The fragment processor is a programmable unit that replaces the OpenGL 1.4 fixed-function texturing, color sum and fog stages. This extension also defines how such an executable interacts with the fixed functionality fragment processing of OpenGL 1.4. The language used to write fragment shaders is not discussed here. That language is defined in the OpenGL Shading Language specification as the Fragment Shading Language.

New Procedures and Functions

None

New Tokens

Accepted by the

<shaderType>

argument of CreateShaderObjectARB and returned by the

<params>

parameter of GetObjectParameter{fi}vARB:

|FRAGMENT_SHADER_ARB |0x8B30| |:------------------------------|:-----|

Accepted by the

<pname>

parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:

|MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB | 0x8B49| |:------------------------------------------|:------| |MAX_TEXTURE_COORDS_ARB | 0x8871| |MAX_TEXTURE_IMAGE_UNITS_ARB |0x8872 |

Accepted by the

<target>

parameter of Hint and the

<pname>

parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:

|FRAGMENT_SHADER_DERIVATIVE_HINT_ARB | 0x8B8B| |:---------------------------------------|:------|

Errors

The error INVALID_OPERATION is generated by any command accessing texture coordinate processing state if the texture unit number corresponding to the current value of ACTIVE_TEXTURE is greater than or equal to the implementation-dependent constant MAX_TEXTURE_COORDS_ARB.

The error INVALID_OPERATION is generated by any command accessing texture image processing state if the texture unit number corresponding to the current value of ACTIVE_TEXTURE is greater than or equal to the implementation-dependent constant MAX_TEXTURE_IMAGE_UNITS_ARB.

The error INVALID_VALUE is generated by any command that takes one or more handles as input, and one or more of these handles are not an object handle generated by OpenGL.

The error INVALID_OPERATION is generated by GetObjectParameter{if}vARB if

<pname>

is OBJECT_TYPE_ARB and

<obj>

is not of type PROGRAM_OBJECT_ARB or SHADER_OBJECT_ARB.

The error INVALID_OPERATION is generated by GetObjectParameter{if}vARB if

<pname>

is OBJECT_SUBTYPE_ARB and

<obj>

is not of type SHADER_OBJECT_ARB.

New State

| Get Value | Type| Get Command | Initial Value | Description | |:--------------|:----|:----------------|:------------------|:----------------| |OBJECT_TYPE_ARB |Z2 |GetObjectParameterivARB|SHADER_OBJECT |Type of object | |OBJECT_SUBTYPE_ARB|Z2 |GetObjectParameterivARB|FRAGMENT_SHADER |Sub type of object |

Table X Shader object state.

| Get Value | Type| Get Command | Initial Value | Description | |:--------------|:----|:----------------|:------------------|:----------------| |FRAGMENT_SHADER_DERIVATIVE_HINT |Z3 | GetIntegerv |DONT_CARE |fragment shader hint|

New Implementation Dependent State

| Get Value | Type| Get Command | Minimum Value | Description | |:--------------|:----|:----------------|:------------------|:----------------| |MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB |Z+ | GetIntegerv | 64 | Number of words for fragment shader uniform variables| |MAX_TEXTURE_IMAGE_UNITS_ARB |Z+ |GetIntegerv |2 |Number of separate texture image units| |MAX_TEXTURE_COORDS_ARB|Z+ | GetIntegerv |2 |number of texture coordinate sets|