Fix bugs and add improvements

This commit is contained in:
schmelczerandras 2020-10-13 12:47:25 +02:00
parent 555be9d602
commit ba4dd5c470
10 changed files with 26 additions and 21 deletions

View file

@ -74,7 +74,7 @@ export class Game {
}
private async setupRenderer(): Promise<void> {
const noiseTexture = await renderNoise([64, 1], 20, 1 / 10);
const noiseTexture = await renderNoise([256, 256], 2, 1 / 10);
this.renderer = await compile(
this.canvas,
@ -123,6 +123,7 @@ export class Game {
overrides: {
maxFilter: FilteringOptions.LINEAR,
wrapS: WrapOptions.MIRRORED_REPEAT,
wrapT: WrapOptions.MIRRORED_REPEAT,
},
},
},
@ -135,7 +136,7 @@ export class Game {
}
public displayToWorldCoordinates(p: vec2): vec2 {
return this.renderer.displayToWorldCoordinates(p);
return this.renderer?.displayToWorldCoordinates(p);
}
public aspectRatioChanged(aspectRatio: number) {