diff --git a/src/drawables/shapes/noisy-polygon-factory.ts b/src/drawables/shapes/noisy-polygon-factory.ts index 55b9bab..d1ff919 100644 --- a/src/drawables/shapes/noisy-polygon-factory.ts +++ b/src/drawables/shapes/noisy-polygon-factory.ts @@ -19,10 +19,10 @@ export const NoisyPolygonFactory = ( public static descriptor: DrawableDescriptor = { sdf: { shader: ` - uniform vec2 noisyPolygon${vertexCount}Vertices[NOISY_POLGYON${vertexCount}_COUNT * ${vertexCount}]; - uniform vec2 noisyPolygon${vertexCount}Centers[NOISY_POLGYON${vertexCount}_COUNT]; - uniform float noisyPolygon${vertexCount}Lengths[NOISY_POLGYON${vertexCount}_COUNT]; - uniform float noisyPolygon${vertexCount}Randoms[NOISY_POLGYON${vertexCount}_COUNT]; + uniform vec2 noisyPolygon${vertexCount}Vertices[NOISY_POLYGON${vertexCount}_COUNT * ${vertexCount}]; + uniform vec2 noisyPolygon${vertexCount}Centers[NOISY_POLYGON${vertexCount}_COUNT]; + uniform float noisyPolygon${vertexCount}Lengths[NOISY_POLYGON${vertexCount}_COUNT]; + uniform float noisyPolygon${vertexCount}Randoms[NOISY_POLYGON${vertexCount}_COUNT]; uniform sampler2D noiseTexture; @@ -56,7 +56,7 @@ export const NoisyPolygonFactory = ( float minDistance = 100.0; - for (int j = 0; j < NOISY_POLGYON${vertexCount}_COUNT; j++) { + for (int j = 0; j < NOISY_POLYGON${vertexCount}_COUNT; j++) { vec2 startEnd = noisyPolygon${vertexCount}Vertices[j * ${vertexCount}]; vec2 vb = startEnd; @@ -110,7 +110,7 @@ export const NoisyPolygonFactory = ( center: `noisyPolygon${vertexCount}Centers`, vertices: `noisyPolygon${vertexCount}Vertices`, }, - uniformCountMacroName: `NOISY_POLGYON${vertexCount}_COUNT`, + uniformCountMacroName: `NOISY_POLYGON${vertexCount}_COUNT`, shaderCombinationSteps: [0, 1, 2, 3, 8, 16], empty: (new NoisyPolygon( new Array(vertexCount).fill(vec2.create()) @@ -123,7 +123,7 @@ export const NoisyPolygonFactory = ( super(vertices); } - protected getObjectToSerialize(transform2d: mat2d, transform1d: number): any { + protected getObjectToSerialize(transform2d: mat2d, _: number): any { const transformedVertices = (this as any).actualVertices.map((v: vec2) => vec2.transformMat2d(vec2.create(), v, transform2d) ); diff --git a/src/drawables/shapes/polygon-factory.ts b/src/drawables/shapes/polygon-factory.ts index 131c726..c093ea9 100644 --- a/src/drawables/shapes/polygon-factory.ts +++ b/src/drawables/shapes/polygon-factory.ts @@ -25,7 +25,7 @@ export const PolygonFactory = ( public static descriptor: DrawableDescriptor = { sdf: { shader: ` - uniform vec2 polygon${vertexCount}Vertices[POLGYON${vertexCount}_COUNT * ${vertexCount}]; + uniform vec2 polygon${vertexCount}Vertices[POLYGON${vertexCount}_COUNT * ${vertexCount}]; vec2 polygon${vertexCount}LineDistance(vec2 target, vec2 from, vec2 to) { vec2 targetFromDelta = target - from; @@ -47,7 +47,7 @@ export const PolygonFactory = ( float minDistance = 100.0; - for (int j = 0; j < POLGYON${vertexCount}_COUNT; j++) { + for (int j = 0; j < POLYGON${vertexCount}_COUNT; j++) { vec2 startEnd = polygon${vertexCount}Vertices[j * ${vertexCount}]; vec2 vb = startEnd; @@ -85,7 +85,7 @@ export const PolygonFactory = ( vertices: `polygon${vertexCount}Vertices`, }, objectCountScaler: 1 / vertexCount, - uniformCountMacroName: `POLGYON${vertexCount}_COUNT`, + uniformCountMacroName: `POLYGON${vertexCount}_COUNT`, shaderCombinationSteps: [0, 1, 2, 3, 8, 16], empty: new Polygon(new Array(vertexCount).fill(vec2.create())), }; @@ -147,7 +147,7 @@ export const PolygonFactory = ( : this.vertices; } - protected getObjectToSerialize(transform2d: mat2d, transform1d: number): any { + protected getObjectToSerialize(transform2d: mat2d, _: number): any { return { vertices: this.actualVertices.map((v) => vec2.transformMat2d(vec2.create(), v, transform2d) diff --git a/src/graphics/graphics-library/helper/stopwatch.ts b/src/graphics/graphics-library/helper/stopwatch.ts index 9d2dbbb..452855a 100644 --- a/src/graphics/graphics-library/helper/stopwatch.ts +++ b/src/graphics/graphics-library/helper/stopwatch.ts @@ -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; } } diff --git a/src/graphics/rendering/fps-quality-autoscaler.ts b/src/graphics/rendering/fps-quality-autoscaler.ts index 7b43665..e4371b8 100644 --- a/src/graphics/rendering/fps-quality-autoscaler.ts +++ b/src/graphics/rendering/fps-quality-autoscaler.ts @@ -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; } diff --git a/src/graphics/rendering/renderer/noise-renderer.ts b/src/graphics/rendering/renderer/noise-renderer.ts index cc91c6f..7c004d1 100644 --- a/src/graphics/rendering/renderer/noise-renderer.ts +++ b/src/graphics/rendering/renderer/noise-renderer.ts @@ -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, diff --git a/src/graphics/rendering/renderer/renderer-implementation.ts b/src/graphics/rendering/renderer/renderer-implementation.ts index 7f2cd28..6c05f97 100644 --- a/src/graphics/rendering/renderer/renderer-implementation.ts +++ b/src/graphics/rendering/renderer/renderer-implementation.ts @@ -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; } } diff --git a/src/graphics/rendering/renderer/renderer.ts b/src/graphics/rendering/renderer/renderer.ts index af8b180..2e834a4 100644 --- a/src/graphics/rendering/renderer/renderer.ts +++ b/src/graphics/rendering/renderer/renderer.ts @@ -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; } diff --git a/src/helper/colors/hex.ts b/src/helper/colors/hex.ts index 0a952d9..475ebb0 100644 --- a/src/helper/colors/hex.ts +++ b/src/helper/colors/hex.ts @@ -5,7 +5,7 @@ import { rgb255 } from './rgb255'; * Return a color given in a hexadecimal form as a vec3. * * @param hex A hexadecimal color with (#ff0000) or without (ff0000) - * a leading hashmark. + * a leading hash mark. * * source: https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb *