QualityController

Chooses a render quality level from measured frame times. Game runs one for you after enableAdaptiveQuality(); you don't normally create one yourself.

Properties

  • targetFps (float)
  • minLevel (integer)
  • maxLevel (integer)
  • windowSeconds (float)
  • outlierFrameSeconds (float)
  • settleSeconds (float)
  • stepDownBelowFraction (float)
  • stepUpHeadroomFraction (float)
  • stepUpSustainSeconds (float)
  • maxMeasurableFps (float)
  • stepDownCooldownSeconds (float)
  • probeFailWindowSeconds (float)
  • probeBackoffSeconds (float)
  • stepUpJumpFraction (float)

Constructor

new QualityController( options?: BGE.AdaptiveQualityOptions, ): QualityController

Parameters


Instance Methods

update(dt: float, currentLevel: integer): integer

Feed one frame's duration; returns the level to use (currentLevel if no change).

Parameters

  • dt (float) — full frame time in seconds, including the buffer swap
  • currentLevel (integer) — the level currently applied

Returns

  • integer

notifyLevelChanged(): void

Call after a new level has been applied: clears the average and waits out the settle period so one-off rebuild costs don't count against the new level.

Returns

  • void

notifySceneChanged(): void

Call after a scene change, for the same reason as notifyLevelChanged().

Returns

  • void