UVNode.js 354 B

12345678910111213141516171819202122232425
  1. import AttributeNode from '../core/AttributeNode.js';
  2. class UVNode extends AttributeNode {
  3. constructor( index = 0 ) {
  4. super( null, 'vec2' );
  5. this.index = index;
  6. }
  7. getAttributeName( /*builder*/ ) {
  8. const index = this.index;
  9. return 'uv' + ( index > 0 ? index + 1 : '' );
  10. }
  11. }
  12. UVNode.prototype.isUVNode = true;
  13. export default UVNode;