Total internal reflection debug