fix ray intersection performance