compute_ssao2
English | 日本語

Overview
GeometryBufferPassfromwebg/GeometryBufferPass.jsoutputs lit color, view-space normals, and depth inlitmodeSsaoPassfromwebg/SsaoPass.jsreads the normal texture and surrounding depth to calculate ambient occlusion- It shares G-buffer generation, normal encoding, and depth reconstruction rules with
compute_deferred_lightingandcompute_ssr GeometryBufferPasscollects Shapes fromSpace, so the same Shapes are not registered separately with the scene graph and G-buffer- It reads the standard Shape material used by
SmoothShaderand applies textures, normal maps, skinning, ambient, specular, and power to the G-buffer
How to Run
- Open ./compute_ssao2.html
- Use a browser with WebGPU support, and check the help panel and HUD together with the sample when needed
Checkpoints
- Press
Vto switch betweencomposite / scene / AO / normaland inspect the G-buffer normals - Compared with the depth-difference normal approximation used by
compute_ssao, this sample can use more stable normals on object boundaries and flat surfaces radius,strength,bias, andsample counthave the same meanings as incompute_ssao- Bright back, left, and right walls make it possible to compare the stronger AO where the floor and walls or two walls meet
- Boxes, spheres, the pillar, the textured cube, and the skinned cylinder are slightly enlarged and moved toward the scene center so AO is visible both at floor contacts and between nearby objects
- The textured cube uses a fine height pattern, a generated normal map, and strong specular lighting so its small bumps are visible without subdividing the surface
- Three spheres use specular highlights to make their smooth surface directions visible
- The skinned cylinder rotates its root bone by 90 degrees to lie parallel to the floor, then distributes the bend across four remaining joints so skinning and contact AO can be inspected together
- Alpha-blended transparency remains separate because a single depth and normal cannot preserve multiple front-to-back surfaces