# Confusion about Occlusion

**URL:** https://qa.fmod.com/t/confusion-about-occlusion/18628
**Category:** FMOD Engine
**Created:** [April 6, 2022, 3:43pm UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628 "2022-04-06T15:43:53Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![TColesy](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TColesy](https://qa.fmod.com/u/TColesy)
#### Post date: [April 6, 2022, 3:43pm UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/1 "2022-04-06T15:43:53Z")

</div>

![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/d/dce4b0069bebcc768d08d2fe1dad8a052841d409.png)

Hi, i am trying to get occlusion working using the fmod core api and im finding it a bit confusing. The image above is what ive tried, based off the little documentation I could find on it. I am trying to add the occlusion to act as the wall seperating the outside of a scene to inside. Can anyone point me towards what i might be missing? Thanks

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/b/bad100caf1d0e9bc0245386ff10a52e348beee1f.jpeg)

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/9/986771bebaf2e524af494299569173a7f4acf5bb.jpeg)

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [April 12, 2022, 4:43am UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/2 "2022-04-12T04:43:35Z")

</div>

That looks correct to me. Are you using the Core or Studio API? Geometry occlusion only works with the Core API- to use it with FMOD Studio you would need to poll [`System::getGeometryOcclusion`](https://fmod.com/resources/documentation-api?version=2.02&page=core-api-system.html#system_getgeometryocclusion) and use the `direct` and `reverb` values to drive an FMOD Studio parameter controlling volume, filters etc to create an occluded sound.  
`System::getGeometryOcclusion` can also be a good way to debug your geometry, if you place your geometry between your playing channel and listener and find that the `direct` and `reverb` are still 0.f then your geometry might not be where you think it is. In such cases, try matching the geometry of your world by using global vertex positions in your polygon instead of their local position, and leave transform, position and rotation as their default values.

---

<div class="post-metadata">

### Author: ![TColesy](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TColesy](https://qa.fmod.com/u/TColesy)
#### Post date: [April 15, 2022, 9:58am UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/3 "2022-04-15T09:58:13Z")

</div>

I am using the Core API, and yeah I thought everything looked sound but couldnt ever get it working. I flew around the scene and didnt ever come across any audible occlusion, so surely it wasnt placed extremely far away from the world origin?. So now i am attempting to build the FMOD Geometry based off the vertices loaded in from an OBJ loader so the main model of the scene itself is occluded. I could not get this working either however, there was still just no audible occlusion.

---

<div class="post-metadata">

### Author: ![TColesy](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TColesy](https://qa.fmod.com/u/TColesy)
#### Post date: [April 18, 2022, 2:17pm UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/4 "2022-04-18T14:17:25Z")

</div>

If it helps, I have checked that the listener position is correct (on the camera). When I use getGeometryOcclusion both values are still 0 afterwards. Something I have noticed is that the FMOD::Geometry object always seems to be NULL, even right after running the createGeometry function, is this normal?

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [April 19, 2022, 1:31am UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/5 "2022-04-19T01:31:15Z")

</div>

A NULL value for the Geometry object is certainly suspicious, is `System::createGeometry` returning `FMOD_OK`?  
Can you please provide a code snippet of your `CreateFmodGeometry` method?

---

<div class="post-metadata">

### Author: ![TColesy](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TColesy](https://qa.fmod.com/u/TColesy)
#### Post date: [April 21, 2022, 11:34am UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/6 "2022-04-21T11:34:35Z")

</div>

Yeah createGeometry returns FMOD\_OK, my call to createGeometry is within a function in my audio engine, which in this instance is being called from within the OBJ loader (as a last ditch effort to try and get occlusion working with the geometry engine), here is my implementation

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/7/72b66ae6e2708e25855db4b5e9f7a200a2b45078.png)  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/a/a57a70560e69978360a5ce8bf6f3283ca20f8b9d.png)

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [April 27, 2022, 3:02am UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/7 "2022-04-27T03:02:51Z")

</div>

That all looks fine to me, and you are using a left-handed coordinate system in your game?  
I think I am going to need a reproduction to assist any further with this, would it be possible for you to upload a reproduction to your [FMOD Profile](https://www.fmod.com/profile#uploads)?

---

<div class="post-metadata">

### Author: ![TColesy](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TColesy](https://qa.fmod.com/u/TColesy)
#### Post date: [April 27, 2022, 10:17am UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/8 "2022-04-27T10:17:28Z")

</div>

Okay no worries, by a reproduction do you mean my entire solution? or just a reproduction of this certain issue? I’m happy to do either or

---

<div class="post-metadata">

### Author: ![TColesy](https://avatars.discourse-cdn.com/v4/letter/t/e480ec/32.png) [@TColesy](https://qa.fmod.com/u/TColesy)
#### Post date: [April 27, 2022, 10:44am UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/9 "2022-04-27T10:44:37Z")

</div>

Also yes the solution uses DirectX and is left handed

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [April 27, 2022, 10:50pm UTC](https://qa.fmod.com/t/confusion-about-occlusion/18628/10 "2022-04-27T22:50:14Z")

</div>

In this case just a reproduction of this issue would be good, but if you are short on time then the whole project is fine too.
