Is direct line of sight necessary?

No, it is not completely necessary. But if possible, you should aim for direct line of sight. You may experience an increase in packet loss and/or reduced speed and/or reduced range if you can’t mount the modems with direct line of sight.