Search code examples
three.jswebgluv-mapping

Where is the documentation for "uv" and other WebGL variables?


In the three.js example "webgl_rtt.html" one can see:

    varying vec2 vUv;

    void main() {

        vUv = uv;
        gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );

    }

webgl_rtt.html

"uv" is not defined in any .js file in this example, nor in three.js. Obviously it is part of WebGL, but where is it defined, where is the documentation about it, and what other WebGL vars exist???


Solution

  • uv is not part of WebGL. Since the posted vertex shader is used to create a THREE.ShaderMaterial, uv is provided as a default attribute by three.js (see section Built-in attributes and uniforms).

    They are listed in the WebGLProgram docs.