import { ssaoPixels } from "../../PostProcessPass.js";
import { applyThreeCompatPixelKernel, createThreeCompatDepthProxy } from "./PostProcessTypes.js";
export class SSAOPassThreeCompat {
    radius;
    name = "SSAOPass";
    enabled = true;
    constructor(radius = 0.7) {
        this.radius = radius;
    }
    apply(frame) {
        return applyThreeCompatPixelKernel({ ...frame, ambientOcclusion: frame.ambientOcclusion + this.radius }, this.name, (pixels, width, height) => ssaoPixels(pixels, width, height, {
            depth: frame.depth ?? createThreeCompatDepthProxy(width, height),
            radius: Math.max(1, Math.round(this.radius * 3)),
            intensity: Math.max(0.1, this.radius),
            bias: 0.01
        }).pixels, "ssaoPixels kernel");
    }
}
//# sourceMappingURL=SSAOPass.js.map