Skip to content
Snippets Groups Projects
Commit 55e940e8 authored by Alexander Rose's avatar Alexander Rose
Browse files

fix rendering with very small viewport and SSAO

parent 5e1bb4b1
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,7 @@ Note that since we don't clearly distinguish between a public and private interf ...@@ -13,6 +13,7 @@ Note that since we don't clearly distinguish between a public and private interf
- Fix rendering issues caused by VAO reuse - Fix rendering issues caused by VAO reuse
- Add "Zoom All", "Orient Axes", "Reset Axes" buttons to the "Reset Camera" button - Add "Zoom All", "Orient Axes", "Reset Axes" buttons to the "Reset Camera" button
- Improve trackball move-state handling when key bindings use modifiers - Improve trackball move-state handling when key bindings use modifiers
- Fix rendering with very small viewport and SSAO enabled
## [v3.33.0] - 2023-04-02 ## [v3.33.0] - 2023-04-02
......
...@@ -506,11 +506,11 @@ export class PostprocessingPass { ...@@ -506,11 +506,11 @@ export class PostprocessingPass {
const sw = Math.floor(width * this.ssaoScale); const sw = Math.floor(width * this.ssaoScale);
const sh = Math.floor(height * this.ssaoScale); const sh = Math.floor(height * this.ssaoScale);
const hw = Math.floor(sw * 0.5); const hw = Math.max(1, Math.floor(sw * 0.5));
const hh = Math.floor(sh * 0.5); const hh = Math.max(1, Math.floor(sh * 0.5));
const qw = Math.floor(sw * 0.25); const qw = Math.max(1, Math.floor(sw * 0.25));
const qh = Math.floor(sh * 0.25); const qh = Math.max(1, Math.floor(sh * 0.25));
this.downsampledDepthTarget = drawPass.packedDepth this.downsampledDepthTarget = drawPass.packedDepth
? webgl.createRenderTarget(sw, sh, false, 'uint8', 'linear', 'rgba') ? webgl.createRenderTarget(sw, sh, false, 'uint8', 'linear', 'rgba')
...@@ -562,12 +562,12 @@ export class PostprocessingPass { ...@@ -562,12 +562,12 @@ export class PostprocessingPass {
this.ssaoDepthTexture.define(sw, sh); this.ssaoDepthTexture.define(sw, sh);
this.ssaoDepthBlurProxyTexture.define(sw, sh); this.ssaoDepthBlurProxyTexture.define(sw, sh);
const hw = Math.floor(sw * 0.5); const hw = Math.max(1, Math.floor(sw * 0.5));
const hh = Math.floor(sh * 0.5); const hh = Math.max(1, Math.floor(sh * 0.5));
this.depthHalfTarget.setSize(hw, hh); this.depthHalfTarget.setSize(hw, hh);
const qw = Math.floor(sw * 0.25); const qw = Math.max(1, Math.floor(sw * 0.25));
const qh = Math.floor(sh * 0.25); const qh = Math.max(1, Math.floor(sh * 0.25));
this.depthQuarterTarget.setSize(qw, qh); this.depthQuarterTarget.setSize(qw, qh);
ValueCell.update(this.renderable.values.uTexSize, Vec2.set(this.renderable.values.uTexSize.ref.value, width, height)); ValueCell.update(this.renderable.values.uTexSize, Vec2.set(this.renderable.values.uTexSize.ref.value, width, height));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment