Skip to content

SSAO example is broken, just darkening based on normal direction #8576

@bhouston

Description

@bhouston
Description of the problem

The SSAO shader should produce darker output in areas that are more enclosed. The current SSAO example actually is just using the normal derived from the depth buffer and making it darker the more they are not facing the camera.

Not sure what it is trying to do but the current implementation is just broken - it is more like a directional light facing in the same direction as the camera:

image

Link: http://threejs.org/examples/#webgl_postprocessing_ssao

Here is what an SSAO/SAO implementation should look like - enclosed regions are darkened, everything else (including non-camera facing normals) should be left alone:

ao comparison 1

Link: https://clara.io/view/76f2e700-042d-4c80-bf0b-19e18d262513
...

Three.js version
  • Dev
  • r75
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions