Sketchfab Forum

Question about ambient oclussion maps


(Rdmdanimation) #1

my question is that I dont know very well how the ambient occlusion map works

since ambient oclussion is about "shadows" in the space beetween object very close,I allways htough that was just added to the texture,wich means that lets say a arm of a character raises,the shadowing would still be visible

but using a map speciphically for oclusion means that the renders only "shows" the shadow when the objects are nearby?

sorry if I am hard to understand,is just that I dont know whats the diference beetwen applying oclusion to the difusse and the AO map slot


(Shaderbytes) #2

The reason it has a separate texture slot is because you can use multiple UV layouts per mesh.

So for example you could have the diffuse or normal UV charts/islands scaled way beyond the 0-1 range to get tiling or even have several charts/islands on top of each other sharing texel space , but for the AO you then create a second UV layout within the 0-1 range with no overlaps

Look at this model of mine :

HHV ATEĀ® Ballistic Helmet Multicam by shaderbytes on Sketchfab

Take the straps as an example , here are the two UV layouts used. The diffuse does not even use a texture, its a flat color , the surface detailing comes from the cavity and normal maps. They use the UV set on the left so they tile and look hi-res when zoomed in and it does not take long to load. The AO is on the right and as I mentioned, all islands are separated and fit within the UV boundaries.

Your model may have a mixture of materials with single UV sets and many many with multiple UV sets. When you upload and assign a texture into a slot of a material that has multiple UV sets , sketchfab will display a selection list where you can choose which set to use. I think they support up to 4 unique UV sets per material

So now you know why and how to use it :wink:


(Rdmdanimation) #3

so thats the only thing the AO slot do? I thought it was more than just that

thanks a lot,your example is very good and usefull


(Stephomi) #4

We don't have any limit concerning UV sets, as I've seen a model with >10 UV sets.
However, try to keep this number as low as possible as it might not work on all devices (especially if you also used blendshape/morph on the geometry), and we are not incredibly smart at detecting issue on this side since most artist only use 1 UV set.

As for AO, it's not exactly the same as diffuse, here is our pbr shader in a nutshell:

Alpha * ( Cavity * ( EnvironmentSpec{roughness/specular} * AOspec + EnvironmentDiffuse{diffuse} * AO + EmitColor + LightPonctual{diffuse/roughness/specular}) )

So basically, what it tells is that :

  • AO does not impact the ponctual lights
  • you choose whether or not the AO impacts the specular reflection (checkbox in the editor)
  • cavity is much more "stronger" as it darkens everything, even the fresnel, it's more for micro-occlusion