Built-in vertex attribute uv2 undeclared

Description of the problem

THREE does not always declare attribute uv2 as a built-in, contradicting documentation (see https://threejs.org/docs/api/renderers/webgl/WebGLProgram.html).

Three.js version
  • Dev
  • r82
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)

No relevant hardware requirements.

Interim fix: Include “attribute vec2 uv2” in user’s shader header (test cases were with ShaderMaterial and BufferGeometry; latter included uv2 attribute).

Permanent fix: Either…

  1. Update documentation to include conditional declaration (see https://threejs.org/docs/api/renderers/webgl/WebGLProgram.html), or
  2. Include missing declaration in shader segment (currently defined in src/renderers/shaders/ShaderChunk/uv2_pars_vertex.glsl, but ignored unless USE_LIGHTMAP or USE_AOMAP are defined).

My preference is for 2., but I’m happy to produce a PR for either approach.

Author: Fantashit

1 thought on “Built-in vertex attribute uv2 undeclared

Comments are closed.