Aplicou onda 1 do perf
X-Lovable-Edit-ID: edt-6241e8b0-1d0a-4655-9655-08f6dba08e57 Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com>
This commit is contained in:
@@ -476,12 +476,12 @@ export function ModelViewerCanvas({ url }: ModelViewerProps) {
|
|||||||
<Canvas
|
<Canvas
|
||||||
camera={{ position: [2, 2, 2], fov: 50, near: 0.001, far: 1000 }}
|
camera={{ position: [2, 2, 2], fov: 50, near: 0.001, far: 1000 }}
|
||||||
gl={{ antialias: true, alpha: true, powerPreference: 'high-performance', preserveDrawingBuffer: true }}
|
gl={{ antialias: true, alpha: true, powerPreference: 'high-performance', preserveDrawingBuffer: true }}
|
||||||
frameloop="demand"
|
frameloop="always"
|
||||||
className="!bg-background"
|
className="!bg-background"
|
||||||
onCreated={({ gl, invalidate }) => {
|
onCreated={({ gl }) => {
|
||||||
gl.setPixelRatio(Math.min(window.devicePixelRatio, 1.5));
|
const isApple = /Mac|iPhone|iPad/.test(navigator.platform);
|
||||||
const loop = () => { invalidate(); requestAnimationFrame(loop); };
|
const maxRatio = isApple ? 2 : 1.5;
|
||||||
loop();
|
gl.setPixelRatio(Math.min(window.devicePixelRatio, maxRatio));
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ambientLight intensity={0.6} />
|
<ambientLight intensity={0.6} />
|
||||||
|
|||||||
Reference in New Issue
Block a user