question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SSAO broken on windows

See original GitHub issue

This is how it looks on my machine:

Screenshot 2020-09-23 at 20 53 51

And this happens on windows:

200923_215241_7VLwgkfkk3

the first one runs 60fps, the other 2fps, it seems to really struggle for some reason.

do you know what it could be? i have it online here: http://warm-vessel.surge.sh and here’s a codesandbox: https://codesandbox.io/s/lllt8?file=/src/App.js

the AO config:

<EffectComposer multisampling={0}>
  <SSAO samples={25} intensity={60} luminanceInfluence={0.5} radius={10} scale={0.5} bias={0.5} />
  <SMAA edgeDetectionMode={EdgeDetectionMode.DEPTH} />
</EffectComposer>

These props will overwrite the following default props:

new SSAOEffect(camera, normalPass.renderTarget.texture, {
  blendFunction: BlendFunction.MULTIPLY,
  samples: 30,
  rings: 4,
  distanceThreshold: 1.0,
  distanceFalloff: 0.0,
  rangeThreshold: 0.5,
  rangeFalloff: 0.1,
  luminanceInfluence: 0.9,
  radius: 20,
  scale: 0.5,
  bias: 0.5,
  ...props,
}),

the high intensity is intentional, im going for a pixelated raytraced look emulating soft shadows with AO.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:36 (35 by maintainers)

github_iconTop GitHub Comments

2reactions
vanruesccommented, Sep 24, 2020

I think I found the reason why the powerPreference setting is ignored in your app: https://www.khronos.org/webgl/public-mailing-list/public_webgl/1703/msg00022.php explains that the canvas needs to have event listeners for webglcontextlost and webglcontextrestored set prior to the WebGL context creation or else the powerPreference setting will be ignored. Your app appears to create a Canvas without setting these listeners.

ThreeJS sets the listeners correctly if you don’t provide your own canvas. See https://github.com/mrdoob/three.js/blob/33acbbef6b7cd6afa98e1cf6f02d3f23aaf5bfa0/src/renderers/WebGLRenderer.js#L200-L203 and https://github.com/mrdoob/three.js/pull/12753 for details.

1reaction
drcmdacommented, Oct 10, 2020

the weird thing is, that demo now runs fine again. it seems to be related by my computer switching gfx cards. similar to the reports i got. sometimes my system gets really slow and it switches from dedicated to integrated. i dont think it does anything out of the ordinary with normal textures.

it creates the composer, adds a render pass and then a normal pass

        // Initialize composer
        const effectComposer = new EffectComposer(gl, {
          depthBuffer,
          stencilBuffer,
          multisampling: isWebGL2Available() ? multisampling : 0,
          frameBufferType,
        })
        // Add render pass
        effectComposer.addPass(new RenderPass(scene, camera))
        // Create normal pass
        const pass = new NormalPass(scene, camera)
        effectComposer.addPass(pass)

which it keeps and forwards it to effects that may need it

new SSAOEffect(camera, normalPass.renderTarget.texture, {
        blendFunction: BlendFunction.MULTIPLY,
        samples: 30,

i am looking for something now that would allow me to switch between gfx cards manually to see if it’s really that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSAO broken on windows · Issue #227 · pmndrs/postprocessing
This is how it looks on my machine: And this happens on windows: the first one runs 60fps, the other 2fps, it seems...
Read more >
Broken SSAO - Godot Community Forums
This is the look I got with using baked lightmaps in Godot 3.2.4. Looks better than the SSAO and doesn't kill performance.
Read more >
SSAO issue. :: ARK: Survival Evolved General Discussions
SSAO issue. Screen space ambient occlusion seems to disable itself depending on the direction I happen to be looking. I can consistently toggle ......
Read more >
I swear to God the SSAO bug is even worse now than before
SSAO is so broken in this game, i didnt even buy DLC in the first place, couse i didnt finish any ME campaign...
Read more >
Developers - SSAO broken on windows - - Bountysource
A post processing library that provides the means to implement image filter effects for three.js. See More. Top Supporters. This team needs your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found