How to use AOMap

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
three.js examples
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.

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.

1 Like

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.

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

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


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

Yeaay, it is working, Thanks :slight_smile: