TriangleGeometry

@three-blocks/coreWebGPUWebGL
new TriangleGeometry()
Extends
THREE.BufferGeometry

Single large triangle covering NDC space for fullscreen post-processing.

Purpose

  • Efficient fullscreen pass geometry (1 triangle vs 2 for quad)
  • Covers entire screen in clip space: (-1,-1) to (3,-1) to (-1,3)
  • Eliminates center seam artifact present in traditional screen quads

Usage

Example
import { TriangleGeometry } from '@three-blocks/core';
import { MeshBasicNodeMaterial } from 'three/webgpu';
import { pass, screenUV } from 'three/tsl';

// Fullscreen post-processing
const scenePass = pass(scene, camera);
const postGeo = new TriangleGeometry();
const postMat = new MeshBasicNodeMaterial();
postMat.colorNode = scenePass.mul(0.5); // Darken scene

const postMesh = new Mesh(postGeo, postMat);
postMesh.frustumCulled = false;