# Cannot get SSAO with R3F to work

**URL:** <https://discourse.threejs.org/t/cannot-get-ssao-with-r3f-to-work/60662>\
**Category:** Questions\
**Tags:** r3f, postprocessing\
**Created:** [January 24, 2024, 8:19am UTC](https://discourse.threejs.org/t/cannot-get-ssao-with-r3f-to-work/60662 "2024-01-24T08:19:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![GGAlanSmithee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/ggalansmithee/32/43082_2.png) [@GGAlanSmithee](https://discourse.threejs.org/u/GGAlanSmithee)\
**Post date:** [January 24, 2024, 8:19am UTC](https://discourse.threejs.org/t/cannot-get-ssao-with-r3f-to-work/60662/1 "2024-01-24T08:19:59Z")

</div>

Hi.

I am attempting to get SSAO working with latest R3F. I’ve tried a couple of publically available examples, amongst others, this one: [react-three-fiber by example | A collection of examples of using react-three-fiber](https://onion2k.github.io/r3f-by-example/examples/effects/postprocessing-ssao/)

I get a lot of Typescript errors about missing properties (21 or so) but they all seem to be non-required, so not really sure what’s going on. I’ve made sure the imports are from the correct libraries, etc.

In other words, I can’t even get the code to compile.

Thankful for any help

Example I’ve tried:

```tsx
<EffectComposer>
  <SSAO
    blendFunction={BlendFunction.MULTIPLY} // Use NORMAL to see the effect
    samples={31}
    radius={5}
    intensity={30}
  />
</EffectComposer>

```

---

<div class="post-metadata">

**Author:** ![drcmda](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@drcmda](https://discourse.threejs.org/u/drcmda)\
**Post date:** [January 25, 2024, 7:59am UTC](https://discourse.threejs.org/t/cannot-get-ssao-with-r3f-to-work/60662/2 "2024-01-25T07:59:01Z")

</div>

I don’t know TS, React or Fiber have nothing to do otherwise with AO, this is just Threejs and the effect composer. But SSAO is very old and uses an outdated algorithm. prefer N8AO if you can, it is much faster and better looking.

> **[BestServedBold Christmas Baubles - CodeSandbox](https://codesandbox.io/s/zxpv7?file=%2Fsrc%2FApp.js)**
>
> Physics, effects, lights and colors.

you find the full docs for this effect here [GitHub - N8python/n8ao: An efficient and visually pleasing implementation of SSAO with an emphasis on temporal stability and artist control.](https://github.com/N8python/n8ao)

---

<div class="post-metadata">

**Author:** ![GGAlanSmithee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/ggalansmithee/32/43082_2.png) [@GGAlanSmithee](https://discourse.threejs.org/u/GGAlanSmithee)\
**Post date:** [January 25, 2024, 8:09am UTC](https://discourse.threejs.org/t/cannot-get-ssao-with-r3f-to-work/60662/3 "2024-01-25T08:09:54Z")

</div>

Thanks @drcmda, works great!
