Jump to content
  • Advertisement
Sign in to follow this  
Mumsfilibaba

Implement baked AO-maps

This topic is 805 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just a quick question, What is the standard equation for implementing baked AO-maps (from maya, 3DS max etc.)? Becuase of the fact that it is how much light a specific point is exposed to, would it not just be diffuse * ao?

 

Here is the result after I tested that:

[attachment=32543:ao_no-ao.png]

Share this post


Link to post
Share on other sites
Advertisement

Not sure what you are asking. In a shader you can implement AO a few different ways. Add all the lighting in your shader from all lights and then multiply that value by the AO texture. Or you can simply take the scenes ambient lighting and multiply it by the AO map. What you have right there is wrong. Those bricks should have no AO. They are so low in height displacement that they aren't blocking any light rays from hitting the crevices. Not sure how you calculated that AO.

Share this post


Link to post
Share on other sites

As I wrote I just multiplied the AO with the diffuse color. It was the first thing that came to mind. 

 

EDIT:

I now take the sampled color from the ao-map multiplied by the ambient light, then ambient result + diffuse color (the resulting color after normal calcuation etc)

 

"saturate((ambientCol * ao) + diffuse)"

 

Personally I think it looks alot better:

[attachment=32544:No-AO_AO.png]

Edited by Mumsfilibaba

Share this post


Link to post
Share on other sites
Add all the lighting in your shader from all lights and then multiply that value by the AO texture. Or you can simply take the scenes ambient lighting and multiply it by the AO map.

 

 

The second option is the only correct option when it comes to AO. Contrary to what you sometimes see in games, AO should only be applied to your ambient/indirect lighting term as it is a form of shadowing generated by ambient lighting, not direct lighting. Applying it to your direct lighting term will result in those overly dark ugly halos around objects, which you often see with SSAO-like implementations.

 

 

 

I now take the sampled color from the ao-map multiplied by the ambient light, then ambient result + diffuse color (the resulting color after normal calcuation etc)

 

This is correct :)

Edited by Radikalizm

Share this post


Link to post
Share on other sites

I'm also not clear on why those bricks have AO or how it was calculated.  As dpadam450 said above, there shouldnt be that much height difference there.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!