WebGL
Khronos
 

WebGL EXT_shader_texture_lod Extension Specification

Name

EXT_shader_texture_lod

Contact

WebGL working group (public_webgl 'at' khronos.org)

Contributors

Vladimir Vukicevic (vladimir 'at' mozilla.com)

Florian Boesch (pyalot 'at' gmail.com)

Members of the WebGL working group

Version

Last modified date: July 15, 2014
Revision: 4

Number

WebGL extension #27

Dependencies

Written against the WebGL API 1.0 specification.

Overview

This extension exposes the EXT_shader_texture_lod functionality to WebGL.

There are no WebGL-specific behavioral changes.

Consult the above extension for documentation, issues and new functions and enumerants.

When this extension is enabled:

IDL

    [NoInterfaceObject]
    interface EXT_shader_texture_lod {
    };
  

Sample Code

    #extension GL_EXT_shader_texture_lod : enable
    #extension GL_OES_standard_derivatives : enable

    uniform sampler2D myTexture;
    varying vec2 texcoord;

    void main(){
        // avoids artifacts when wrapping texture coordinates
        gl_FragColor = texture2DGradEXT(myTexture, mod(texcoord, vec2(0.1, 0.5)), dFdx(texcoord), dFdy(texcoord));
    }
    

Revision History

Revision 1, 2014/02/10

Revision 2, 2014/02/18

Revision 3, 2014/06/27

Revision 4, 2014/07/15