1
\$\begingroup\$

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?

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

1 Answer 1

3
\$\begingroup\$

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 ;-)

\$\endgroup\$
2
  • \$\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
    Jun 4, 2016 at 7:48
  • \$\begingroup\$ @MickLH This sounds reasonable. Can you post an equation for that? \$\endgroup\$
    – Kromster
    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 .