# Class FpsQualityAutoscaler

Set the quality of rendering based on FPS values.

When using this, the size of the canvas must be fixed with CSS.

The `addDeltaTime` method should be called once every frame.

Usage:

     const renderer = await compile(...);
     const autoscaler = new FpsQualityAutoscaler(renderer);

- Defined in graphics/rendering/fps-quality-autoscaler.ts:19

##### Index

### Constructors

constructor

### Properties

fpsHysteresis
scalingEnabled
fpsTarget

### Accessors

FPS

### Methods

addDeltaTime

## Constructors

### constructor

- new FpsQualityAutoscaler(
  renderer: Renderer,
  initialScales?: Partial<
  Pick<RuntimeSettings, "distanceRenderScale" | "lightsRenderScale">,
  >,
  ): FpsQualityAutoscaler

  #### Parameters

  - renderer: Renderer
  - initialScales: Partial<Pick<RuntimeSettings, "distanceRenderScale" | "lightsRenderScale">> = {}

  #### Returns FpsQualityAutoscaler

  - Defined in graphics/rendering/fps-quality-autoscaler.ts:33

## Properties

### fpsHysteresis

fpsHysteresis: number = 5

- Defined in graphics/rendering/fps-quality-autoscaler.ts:26

### scalingEnabled

scalingEnabled: boolean = true

When `false`, FPS is still measured but the render scales are left alone.

- Defined in graphics/rendering/fps-quality-autoscaler.ts:31

### `Static` fpsTarget

fpsTarget: number = 30

- Defined in graphics/rendering/fps-quality-autoscaler.ts:25

## Accessors

### FPS

- get FPS(): number

  #### Returns number

  - Defined in graphics/rendering/fps-quality-autoscaler.ts:47

## Methods

### addDeltaTime

- addDeltaTime(deltaTimeInMilliseconds: number): void

  Record the time taken by the latest frame. Autoscaling is also performed as part of this call.

  #### Parameters

  - deltaTimeInMilliseconds: number

  #### Returns void

  - Defined in graphics/rendering/fps-quality-autoscaler.ts:59