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

fix downsampled ssao

parent c28dd813
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
- Improve boundary calculation performance - Improve boundary calculation performance
- Add option to create & include images in state snapshots - Add option to create & include images in state snapshots
- Fix SSAO artefacts with high bias values - Fix SSAO artefacts with high bias values
- Fix SSAO resolution scale parameter handling
- Improve outlines, visually more stable at different view distances - Improve outlines, visually more stable at different view distances
## [v3.29.0] - 2023-01-15 ## [v3.29.0] - 2023-01-15
......
...@@ -452,7 +452,7 @@ export class PostprocessingPass { ...@@ -452,7 +452,7 @@ 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);
this.downsampledDepthTarget = webgl.createRenderTarget(sw, sh, false, 'uint8', 'linear'); this.downsampledDepthTarget = webgl.createRenderTarget(sw, sh, false, drawPass.packedDepth ? 'uint8' : 'float32', 'linear');
this.downsampleDepthRenderable = createCopyRenderable(webgl, depthTextureOpaque); this.downsampleDepthRenderable = createCopyRenderable(webgl, depthTextureOpaque);
this.ssaoDepthTexture = webgl.resources.texture('image-uint8', 'rgba', 'ubyte', 'linear'); this.ssaoDepthTexture = webgl.resources.texture('image-uint8', 'rgba', 'ubyte', 'linear');
...@@ -465,7 +465,7 @@ export class PostprocessingPass { ...@@ -465,7 +465,7 @@ export class PostprocessingPass {
this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer, 'color0'); this.ssaoDepthTexture.attachFramebuffer(this.ssaoBlurSecondPassFramebuffer, 'color0');
this.ssaoRenderable = getSsaoRenderable(webgl, this.downsampleFactor === 1 ? depthTextureOpaque : this.downsampledDepthTarget.texture); this.ssaoRenderable = getSsaoRenderable(webgl, this.ssaoScale === 1 ? depthTextureOpaque : this.downsampledDepthTarget.texture);
this.ssaoBlurFirstPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthTexture, 'horizontal'); this.ssaoBlurFirstPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthTexture, 'horizontal');
this.ssaoBlurSecondPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthBlurProxyTexture, 'vertical'); this.ssaoBlurSecondPassRenderable = getSsaoBlurRenderable(webgl, this.ssaoDepthBlurProxyTexture, 'vertical');
this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture, depthTextureOpaque, depthTextureTransparent, this.shadowsTarget.texture, this.outlinesTarget.texture, this.ssaoDepthTexture, true); this.renderable = getPostprocessingRenderable(webgl, colorTarget.texture, depthTextureOpaque, depthTextureTransparent, this.shadowsTarget.texture, this.outlinesTarget.texture, this.ssaoDepthTexture, true);
...@@ -583,7 +583,7 @@ export class PostprocessingPass { ...@@ -583,7 +583,7 @@ export class PostprocessingPass {
this.ssaoDepthBlurProxyTexture.define(sw, sh); this.ssaoDepthBlurProxyTexture.define(sw, sh);
if (this.ssaoScale === 1) { if (this.ssaoScale === 1) {
ValueCell.update(this.ssaoRenderable.values.tDepth, this.drawPass.depthTextureTransparent); ValueCell.update(this.ssaoRenderable.values.tDepth, this.drawPass.depthTextureOpaque);
} else { } else {
ValueCell.update(this.ssaoRenderable.values.tDepth, this.downsampledDepthTarget.texture); ValueCell.update(this.ssaoRenderable.values.tDepth, this.downsampledDepthTarget.texture);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment