Fix flickering

This commit is contained in:
schmelczerandras 2020-11-03 17:27:39 +01:00
parent c22e18f78c
commit ee03bf1153
2 changed files with 3 additions and 3 deletions

View file

@ -15,7 +15,6 @@ export const getUniversalRenderingContext = (
alpha: true, alpha: true,
antialias: false, antialias: false,
depth: false, depth: false,
desynchronized: true,
preserveDrawingBuffer: true, preserveDrawingBuffer: true,
powerPreference: 'high-performance', powerPreference: 'high-performance',
}; };

View file

@ -234,7 +234,7 @@ export class RendererImplementation implements Renderer {
} }
} }
const distanceSizeChanged = this.distanceFieldFrameBuffer.setSize(this.canvasSize); this.distanceFieldFrameBuffer.setSize(this.canvasSize);
const lightsSizeChanged = this.lightingFrameBuffer.setSize(this.canvasSize); const lightsSizeChanged = this.lightingFrameBuffer.setSize(this.canvasSize);
const common = { const common = {
@ -252,7 +252,7 @@ export class RendererImplementation implements Renderer {
...this.textures, ...this.textures,
]); ]);
if (!distanceSizeChanged && !lightsSizeChanged) { if (!lightsSizeChanged) {
this.gl.enable(this.gl.BLEND); this.gl.enable(this.gl.BLEND);
this.gl.blendColor(this.blendFactor, this.blendFactor, this.blendFactor, 1); this.gl.blendColor(this.blendFactor, this.blendFactor, this.blendFactor, 1);
} }
@ -261,6 +261,7 @@ export class RendererImplementation implements Renderer {
this.uniformsProvider.getUniforms(common), this.uniformsProvider.getUniforms(common),
this.distanceFieldFrameBuffer.textures this.distanceFieldFrameBuffer.textures
); );
this.gl.disable(this.gl.BLEND); this.gl.disable(this.gl.BLEND);
this.distanceFieldFrameBuffer.invalidate(); this.distanceFieldFrameBuffer.invalidate();