Jump to content
  • Advertisement
Sign in to follow this  
Farci

write out normalbuffer for ssao

This topic is 2177 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

Hello,

just a short question, a normal can point in any direction so it can cotain negativ values. So whats the best way to handle negativ values for an normalbuffer which will be used for ssao. (I'm writing the normals on rendertarget with 4 floats)
Or are these values saved as they are, even if they are negativ?

Share this post


Link to post
Share on other sites
Advertisement

A common way to solve this problem is to convert the values in your normal vector from a range of [-1, 1] to a range of [0, 1] and back again when you do your ssao pass

You can do said conversion like this: n = (n + 1) / 2


The conversion back to your original range would then become: n = n * 2 - 1

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!