Fix resize handling
This commit is contained in:
parent
5b37f4bcd4
commit
c22e18f78c
1 changed files with 7 additions and 5 deletions
|
|
@ -234,8 +234,8 @@ export class RendererImplementation implements Renderer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.distanceFieldFrameBuffer.setSize(this.canvasSize);
|
const distanceSizeChanged = this.distanceFieldFrameBuffer.setSize(this.canvasSize);
|
||||||
const sizeChanged = this.lightingFrameBuffer.setSize(this.canvasSize);
|
const lightsSizeChanged = this.lightingFrameBuffer.setSize(this.canvasSize);
|
||||||
|
|
||||||
const common = {
|
const common = {
|
||||||
// texture units
|
// texture units
|
||||||
|
|
@ -252,9 +252,11 @@ export class RendererImplementation implements Renderer {
|
||||||
...this.textures,
|
...this.textures,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
this.gl.enable(this.gl.BLEND);
|
if (!distanceSizeChanged && !lightsSizeChanged) {
|
||||||
const q = sizeChanged ? 1 : this.blendFactor;
|
this.gl.enable(this.gl.BLEND);
|
||||||
this.gl.blendColor(q, q, q, 1);
|
this.gl.blendColor(this.blendFactor, this.blendFactor, this.blendFactor, 1);
|
||||||
|
}
|
||||||
|
|
||||||
this.lightsPass.render(
|
this.lightsPass.render(
|
||||||
this.uniformsProvider.getUniforms(common),
|
this.uniformsProvider.getUniforms(common),
|
||||||
this.distanceFieldFrameBuffer.textures
|
this.distanceFieldFrameBuffer.textures
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue