Fix typos
This commit is contained in:
parent
55eb0cf0d2
commit
5b37f4bcd4
8 changed files with 25 additions and 26 deletions
|
|
@ -73,7 +73,7 @@ export class WebGlStopwatch {
|
|||
return this.state == StopwatchState.waitingForResults;
|
||||
}
|
||||
|
||||
public get resultsInMilliSeconds(): number {
|
||||
public get resultsInMilliseconds(): number {
|
||||
return this.resultsInNanoSeconds! / 1000 / 1000;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ import { Renderer } from './renderer/renderer';
|
|||
* ```
|
||||
*/
|
||||
export class FpsQualityAutoscaler {
|
||||
private readonly maxAdjusmentRateInMilliseconds = 10000;
|
||||
private readonly adjusmentRateIncrease = 2;
|
||||
private adjusmentRateInMilliseconds = 500;
|
||||
private readonly maxAdjustmentRateInMilliseconds = 10000;
|
||||
private readonly adjustmentRateIncrease = 2;
|
||||
private adjustmentRateInMilliseconds = 500;
|
||||
private fps = 0;
|
||||
|
||||
public static fpsTarget = 30;
|
||||
|
|
@ -39,12 +39,12 @@ export class FpsQualityAutoscaler {
|
|||
public addDeltaTime(deltaTimeInMilliseconds: DOMHighResTimeStamp) {
|
||||
this.deltaTimes.push(deltaTimeInMilliseconds);
|
||||
this.deltaTimeSinceLastAdjustment += deltaTimeInMilliseconds;
|
||||
if (this.deltaTimeSinceLastAdjustment > this.adjusmentRateInMilliseconds) {
|
||||
if (this.deltaTimeSinceLastAdjustment > this.adjustmentRateInMilliseconds) {
|
||||
this.calculateFPS();
|
||||
this.adjustQuality();
|
||||
this.adjusmentRateInMilliseconds = Math.min(
|
||||
this.maxAdjusmentRateInMilliseconds,
|
||||
this.adjusmentRateInMilliseconds * this.adjusmentRateIncrease
|
||||
this.adjustmentRateInMilliseconds = Math.min(
|
||||
this.maxAdjustmentRateInMilliseconds,
|
||||
this.adjustmentRateInMilliseconds * this.adjustmentRateIncrease
|
||||
);
|
||||
this.deltaTimeSinceLastAdjustment = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,13 +31,13 @@ export const renderNoise = async (
|
|||
const program = new FragmentShaderOnlyProgram(gl);
|
||||
const compiler = new ParallelCompiler(gl);
|
||||
|
||||
const pogramPromise = program.initialize(
|
||||
const programPromise = program.initialize(
|
||||
gl.isWebGL2 ? [randomVertex, randomFragment] : [randomVertex100, randomFragment100],
|
||||
compiler
|
||||
);
|
||||
|
||||
await compiler.compilePrograms();
|
||||
await pogramPromise;
|
||||
await programPromise;
|
||||
|
||||
program.draw({
|
||||
scale,
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ export class RendererImplementation implements Renderer {
|
|||
this.stopwatch.start();
|
||||
} else {
|
||||
this.stopwatch.tryGetResults();
|
||||
this.gl.insights.gpuRenderTimeInMilliseconds = this.stopwatch.resultsInMilliSeconds;
|
||||
this.gl.insights.gpuRenderTimeInMilliseconds = this.stopwatch.resultsInMilliseconds;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ export interface Renderer {
|
|||
|
||||
/**
|
||||
* The inverse of `displayToWorldCoordinates`, returns the screen space position
|
||||
* of a point given in world space cooridnates.
|
||||
* of a point given in world space coordinates.
|
||||
*
|
||||
* While the origin for worldCoordinates resides in the bottom-left corner,
|
||||
* the origin of the returned display coordinates is placed in the top left.
|
||||
|
|
@ -89,10 +89,9 @@ export interface Renderer {
|
|||
/**
|
||||
* Get useful information about the hardware and the SDF2D renderer.
|
||||
*
|
||||
* Its sheme is subject to change.
|
||||
* Its scheme is subject to change.
|
||||
*
|
||||
* During context lost it might be null.
|
||||
*
|
||||
*/
|
||||
readonly insights: RendererInfo | null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue