0
\$\begingroup\$

If an Ambient Occlusion Map is for mapping shadows based on closeness of neighboring geometry, and a Cavity Map is for mapping smaller shadows based on angle or distance, then is there any reason not to mix these into one unified shadow map? It seems desirable to do so for saving a game from having to load extra textures, but I ask in case I'm overlooking something.

This article gives an overview of the differences between the two types of maps, but it never mentions combining them. This made me wonder if there was some reason to keep them as separate images.

Thanks in advance for any insight.

\$\endgroup\$
2
  • \$\begingroup\$ Assuming they are separate right now, what is your current average framerate running under your development environment's version of "Release"? \$\endgroup\$
    – Jon
    Commented Mar 12, 2016 at 9:00
  • \$\begingroup\$ @Jon My question isn't about a specific "Release" I'm working on. \$\endgroup\$
    – Mentalist
    Commented Mar 13, 2016 at 8:20

1 Answer 1

0
\$\begingroup\$

I cannot speak to any hidden technical limitations that prevent you from sharing the texture (if that was your intended question). That being said, I doubt anyone here is going to recommend that you make your code/algorithm more complex than it has to be without a specific and measurable reason.

Here are two good reasons to combine them:

  1. Reduce memory usage
    • A 2048x2048x32 texture is about 16MB, less than 1% of a 2GB video card's memory.
    • If you are not memory-capped, don't combine them for this reason.
  2. Reduce the overhead required to use them (binding and such)
    • If you are not framerate-capped (under RELEASE and not DEBUG), don't combine them for this reason.

Even though you technically cut resource usage in half, either way, the benefit of doing so for a single pair of textures is probably negligible (60FPS vs. 59FPS). If your question was about a potentially large array of separated textures, I'd recommend combining them, instead, because half of "a lot" equates to a significant improvement to performance (60FPS vs. 1FPS).

\$\endgroup\$
1
  • \$\begingroup\$ Thanks for the perspective. So basically it comes down to how much memory usage you are allowed... Since in my case this would be for a WebGL game that needs to run in a browser, memory usage should be kept at a minimum, so it would be best to combine them. \$\endgroup\$
    – Mentalist
    Commented Mar 13, 2016 at 22:26

You must log in to answer this question.

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