I've seen many tutorials on SSAO, but none for simple ambient occlusion maps.

I can see myself working things out alone, as AO maps are simple greyscale maps that indicate where there should be more lighting and where less, right? Something like

float ao = texture(ambientOcclusionMap, uvCoords);
vec3 lighting = ambient + (diffuse + specular) * ao; 

Is there something more to it?

  • \$\begingroup\$ Instead of multiplying diffuse and specular terms with ao, you should multiply ambient term with ao. \$\endgroup\$
    – msell
    Commented May 27, 2016 at 5:57
  • \$\begingroup\$ Oh ok. That's the only thing to it though? \$\endgroup\$
    – McLovin
    Commented May 28, 2016 at 7:38
  • 1
    \$\begingroup\$ Yes, that's all. \$\endgroup\$
    – msell
    Commented May 28, 2016 at 9:52

1 Answer 1


Correct approach is to multiply ambient component with AO:

vec3 lighting = ambient * ao + diffuse + specular;

** it is not a coincidence, that both items have the the word "ambient" in them ;-)

  • \$\begingroup\$ This is not exactly "correct" it's just a reasonable approximation of correct. Correct would involve computing a darkening factor for the diffuse term. \$\endgroup\$
    – MickLH
    Commented Jun 4, 2016 at 7:48
  • \$\begingroup\$ @MickLH This sounds reasonable. Can you post an equation for that? \$\endgroup\$
    – Kromster
    Commented Jun 4, 2016 at 7:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .