Ah! The dot product check! Of course! This is like checking if an incident ray is hitting the back or the front of a surface.

Good one. I'll update (at some point).