PointUVNode.js 412 B

123456789101112131415161718192021222324
  1. import Node from '../core/Node.js';
  2. class PointUVNode extends Node {
  3. constructor() {
  4. super( 'vec2' );
  5. Object.defineProperty( this, 'isPointUVNode', { value: true } );
  6. }
  7. generate( builder, output ) {
  8. const type = this.getNodeType( builder );
  9. const snippet = 'vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )';
  10. return builder.format( snippet, type, output );
  11. }
  12. }
  13. export default PointUVNode;