# How to use AOMap

**URL:** https://discourse.threejs.org/t/how-to-use-aomap/22294
**Category:** Questions
**Tags:** textures, materials
**Created:** [January 11, 2021, 5:06am UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294 "2021-01-11T05:06:18Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![jaya\_kannan](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jaya_kannan/32/6847_2.png) [@jaya\_kannan](https://discourse.threejs.org/u/jaya_kannan)
#### Post date: [January 11, 2021, 5:06am UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294/1 "2021-01-11T05:06:18Z")

</div>

Hi, I need to add an AOMap for getting better output in my project. I tried a lot. Still I couldn’t find the solution. How to apply this. Please say any suggestions.  
I have seen this following example in [threejs.org](http://threejs.org/)  
[three.js examples](https://threejs.org/examples/?q=dis#webgl_materials_displacementmap)  
in this example, we can see the AOMap is working.  
but when I download the same model and same texture and try this in **threejs editor** to see the AOMap effects. But in that is not working. Please help.

---

<div class="post-metadata">

### Author: ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)
#### Post date: [January 11, 2021, 6:27am UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294/2 "2021-01-11T06:27:53Z")

</div>

The examples show correct, complete use of an `aoMap`. If your own examples are not working you will need to share them so we can help you figure out what is not matching the correct usage.

Also note that AO (ambient occlusion) affects only _ambient_ light sources. If your scene in the editor only uses direct lights, AO will not do anything. Also note that models must have a second UV set for use with an AO map. When loading a model using AO in GLTFLoader, the second UV set is added automatically if needed.

---

<div class="post-metadata">

### Author: ![jaya\_kannan](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jaya_kannan/32/6847_2.png) [@jaya\_kannan](https://discourse.threejs.org/u/jaya_kannan)
#### Post date: [January 11, 2021, 6:41am UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294/3 "2021-01-11T06:41:23Z")

</div>

Wow. Thanks for brief explanation @donmccurdy . I need to know, what is the second UV set. Because, I just loaded the same model which is used in the above example in Blender. It has a single UV only. So What do you mean by second UV set. And One more thing, I have to say is, the whole object is being black when I enable aoMap with several flip. If I not do that, then there is no effect in the model.

---

<div class="post-metadata">

### Author: ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)
#### Post date: [January 11, 2021, 7:17pm UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294/4 "2021-01-11T19:17:21Z")

</div>

If you check the code from that example, it’s modifying the model after loading it to add the second UV set:

> <https://github.com/mrdoob/three.js/blob/670b1e9e85356d98efa4c702e93c85dd52f01e1e/examples/webgl_materials_displacementmap.html#L192>

This is necessary for formats like OBJ where the file does not contain the AO map and it has to be added afterward.

---

<div class="post-metadata">

### Author: ![jaya\_kannan](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jaya_kannan/32/6847_2.png) [@jaya\_kannan](https://discourse.threejs.org/u/jaya_kannan)
#### Post date: [January 12, 2021, 6:49am UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294/5 "2021-01-12T06:49:27Z")

</div>

Thank you so much for your reply @donmccurdy . Awesome. It is working 😃

---

<div class="post-metadata">

### Author: ![Nursefa\_Baybara](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/nursefa_baybara/32/18008_2.png) [@Nursefa\_Baybara](https://discourse.threejs.org/u/Nursefa_Baybara)
#### Post date: [January 21, 2022, 10:02am UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294/6 "2022-01-21T10:02:01Z")

</div>

Yeaay, it is working, Thanks 🙂

---

<div class="post-metadata">

### Author: ![DarioMQD](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/dariomqd/32/41157_2.png) [@DarioMQD](https://discourse.threejs.org/u/DarioMQD)
#### Post date: [October 18, 2023, 2:20pm UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294/7 "2023-10-18T14:20:44Z")

</div>

In the current version of the example you mantioned uv2 is not there anymore. We don’t need to specify a 2nd uv set while using aO maps with the same uv layout or am I missing something?

---

<div class="post-metadata">

### Author: ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)
#### Post date: [October 18, 2023, 2:25pm UTC](https://discourse.threejs.org/t/how-to-use-aomap/22294/8 "2023-10-18T14:25:12Z")

</div>

This isn’t required in recent three.js versions, correct. If your aoMap was designed for a different set of UVs than other textures, you’d specify that with `aoMap.channel = 1` (or whichever index).
