PointUVNode.js 444 B

1234567891011121314151617181920212223242526
  1. import Node, { addNodeClass } from '../core/Node.js';
  2. import { nodeImmutable } from '../shadernode/ShaderNode.js';
  3. class PointUVNode extends Node {
  4. constructor() {
  5. super( 'vec2' );
  6. this.isPointUVNode = true;
  7. }
  8. generate( /*builder*/ ) {
  9. return 'vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y )';
  10. }
  11. }
  12. export default PointUVNode;
  13. export const pointUV = nodeImmutable( PointUVNode );
  14. addNodeClass( 'PointUVNode', PointUVNode );