In src/EffectCompositer.js:179-180, the halfRes path handles sky pixels
(depth == 1.0) by setting texel = vec4(0.0, 0.0, 0.0, 1.0). Since only
texel.r is read downstream as the AO value, this makes
finalAo = pow(0, intensity) = 0, and the final
mix(sceneTexel.rgb, aoApplied, 1.0 - finalAo)
collapses fully onto aoApplied — i.e. the AO color (black by default).
The result is that when scene.background is set to a texture, the sky
renders solid black. The non-halfRes path has no such branch and works
correctly.
Repro: three.js r180, postprocessing 6.39, N8AOPostPass with
configuration.halfRes = true and scene.background = someEquirectTexture.
Disabling halfRes or using an in-scene sky sphere (which writes depth < 1)
both avoid the issue.
Suggested fix: texel = vec4(1.0, 0.0, 0.0, 1.0) — texel.r = 1 gives
finalAo = 1, so the mix leaves sceneTexel untouched on sky pixels.
In
src/EffectCompositer.js:179-180, the halfRes path handles sky pixels(depth == 1.0) by setting
texel = vec4(0.0, 0.0, 0.0, 1.0). Since onlytexel.ris read downstream as the AO value, this makesfinalAo = pow(0, intensity) = 0, and the finalcollapses fully onto
aoApplied— i.e. the AO color (black by default).The result is that when
scene.backgroundis set to a texture, the skyrenders solid black. The non-halfRes path has no such branch and works
correctly.
Repro: three.js r180, postprocessing 6.39, N8AOPostPass with
configuration.halfRes = trueandscene.background = someEquirectTexture.Disabling halfRes or using an in-scene sky sphere (which writes depth < 1)
both avoid the issue.
Suggested fix:
texel = vec4(1.0, 0.0, 0.0, 1.0)—texel.r = 1givesfinalAo = 1, so the mix leavessceneTexeluntouched on sky pixels.