# SSAO2 wrong shade

**URL:** <https://forum.babylonjs.com/t/ssao2-wrong-shade/3471>\
**Category:** Questions\
**Created:** [May 23, 2019, 7:43am UTC](https://forum.babylonjs.com/t/ssao2-wrong-shade/3471 "2019-05-23T07:43:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![val](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@val](https://forum.babylonjs.com/u/val)\
**Post date:** [May 23, 2019, 7:43am UTC](https://forum.babylonjs.com/t/ssao2-wrong-shade/3471/1 "2019-05-23T07:43:21Z")

</div>

Hi there,

On the following image the interior shade of the base cabinet is applied to the front of door center panel. When I remove affected cabinet the wrong shade reappeared on the next one.

 ![wglr-ssao-issue-sbs-accent](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/0/07e30022043fa2970a871a1eccac0e21994a1a71.jpeg)

This issue is reproduced on the playground  
[[https://www.babylonjs-playground.com/#WGZLGJ#648](https://www.babylonjs-playground.com/#WGZLGJ#648)]([http://Playground](http://Playground) example)

Any advise will be appreciated,  
Thanks

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [May 23, 2019, 4:22pm UTC](https://forum.babylonjs.com/t/ssao2-wrong-shade/3471/2 "2019-05-23T16:22:51Z")

</div>

Maybe @julien-moreau has an idea?

---

<div class="post-metadata">

**Author:** ![julien-moreau](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/julien-moreau/32/12070_2.png) [@julien-moreau](https://forum.babylonjs.com/u/julien-moreau)\
**Post date:** [May 29, 2019, 6:59pm UTC](https://forum.babylonjs.com/t/ssao2-wrong-shade/3471/3 "2019-05-29T18:59:11Z")

</div>

Hi @val!  
I notice that the geometry buffer renderer (used by the SSAO pipleine) doesn’t render the door as you can see in the normals:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/4/4ca07bd5db24a9f22d51b4d1076de379d6ca4fb6.png)

I’m testing if there is any alpha or whatever but I find nothing at the moment ☹

---

<div class="post-metadata">

**Author:** ![julien-moreau](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/julien-moreau/32/12070_2.png) [@julien-moreau](https://forum.babylonjs.com/u/julien-moreau)\
**Post date:** [May 29, 2019, 7:08pm UTC](https://forum.babylonjs.com/t/ssao2-wrong-shade/3471/4 "2019-05-29T19:08:59Z")

</div>

Ok found, the material’s albedo texture has the flag “hasAlpha” set to “true”.  
Then, it will not be renderered as geometry buffer renderer will render only opaque and alpha-test meshes. Here the material needs alpha blending.

Fixed here: [https://www.babylonjs-playground.com/#WGZLGJ#657](https://www.babylonjs-playground.com/#WGZLGJ#657)  
Maybe you can re-export by deleting the unnecessary alpha flag on the albedo texture (that looks to have no alpha)

Hope that helps 🙂

---

<div class="post-metadata">

**Author:** ![val](https://avatars.discourse-cdn.com/v4/letter/v/e56c9b/32.png) [@val](https://forum.babylonjs.com/u/val)\
**Post date:** [May 30, 2019, 7:13am UTC](https://forum.babylonjs.com/t/ssao2-wrong-shade/3471/5 "2019-05-30T07:13:38Z")

</div>

Yes, that is it! Thank you @julien-moreau for your help!
