which way a surface faces
A normal is a unit vector that points straight out of a surface. Lighting compares it with the direction to the light, so in the demo the faces whose normal lines point at the bulb are bright. Gameplay code uses the same vector to bounce objects off walls and to tell a floor from a steep slope.
Use the surface normal from each collision or raycast hit: reflect the velocity around it for bounces, and count a surface as walkable floor only when the normal's up component is above 0.7, which is about 45 degrees.