Files
healer-man/src/scene/AdaptiveGraphicsQuality.tsx
T
2026-08-22 15:53:43 -04:00

21 lines
538 B
TypeScript

import { PerformanceMonitor } from "@react-three/drei";
import { dprForPerformanceFactor } from "./adaptiveGraphicsQualityMath";
export function AdaptiveGraphicsQuality({
onDprChange,
}: {
readonly onDprChange: (dpr: number) => void;
}) {
return (
<PerformanceMonitor
factor={1}
iterations={6}
ms={250}
step={0.25}
threshold={0.75}
bounds={(refreshRate) => refreshRate > 100 ? [60, 100] : [52, 58]}
onChange={({ factor }) => onDprChange(dprForPerformanceFactor(factor))}
/>
);
}