      for (let p = 0; p <= numPoints; ++p) {
        const u = p / numPoints;
        const r = (u * 2 - 1) * surfaceWidth * .5;
        const c = Math.cos(direction);
        const s = Math.sin(direction);
        const x = c * r;
        const y = s * r + sy;
        const a = -Math.atan2(lx - x, ly - y);

        const eyeToSurfaceDir = [-Math.sin(a), -Math.cos(a)];
        const surfaceNormal = [Math.sin(direction), Math.cos(direction)];
        const dot = v3.dot([...eyeToSurfaceDir, 0], [...surfaceNor